Skip to content

how to split the parameters into different lines and keep them aligned? #57

@fyears

Description

@fyears

After using "format code" in the latest RStudio, the parameters of functions are split into different lines and kept aligned.

But I am unable to find the corresponding settings in formatR package. How to do it with formatR?

Consider the source code:

my_sum = function(a = 1, b = 2, c =3) {
  return(a + b + c)
}

The desired formatted result (RStudio returns this):

my_sum = function(a = 1,
                  b = 2,
                  c = 3) {
  return(a + b + c)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions