We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For long vectors of "simple values", expanding one value per line really is a bit too much. For instance, for this vector:
c( "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" )
air formats it like:
air
c( "a", "b", "c", [...] "x", "y", "z" )
while it would probably be better (in this particular case) to have:
I'm sure there are a ton of counter examples where having one element per line is actually better, but I just wanted to mention this case.
Note that this is particularly visible when formatting the output of dput(). This is what dput(mtcars) gives:
dput()
dput(mtcars)
structure(list(mpg = c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 22.8, 19.2, 17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14.7, 32.4, 30.4, 33.9, 21.5, 15.5, 15.2, 13.3, 19.2, 27.3, 26, 30.4, 15.8, [...] 2, 2, 4, 4, 3, 3, 3, 4, 4, 4, 1, 2, 1, 1, 2, 2, 4, 2, 1, 2, 2, 4, 6, 8, 2)), row.names = c("Mazda RX4", "Mazda RX4 Wag", "Datsun 710", "Hornet 4 Drive", "Hornet Sportabout", "Valiant", "Duster 360", "Merc 240D", "Merc 230", "Merc 280", "Merc 280C", "Merc 450SE", "Merc 450SL", "Merc 450SLC", "Cadillac Fleetwood", "Lincoln Continental", "Chrysler Imperial", "Fiat 128", "Honda Civic", "Toyota Corolla", "Toyota Corona", "Dodge Challenger", "AMC Javelin", "Camaro Z28", "Pontiac Firebird", "Fiat X1-9", "Porsche 914-2", "Lotus Europa", "Ford Pantera L", "Ferrari Dino", "Maserati Bora", "Volvo 142E"), class = "data.frame")
This is how styler formats it (61 lines):
styler
structure(list( mpg = c( 21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 22.8, 19.2, 17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14.7, 32.4, 30.4, 33.9, 21.5, 15.5, 15.2, 13.3, 19.2, 27.3, 26, 30.4, 15.8, 19.7, 15, 21.4 ), cyl = c( 6, 6, 4, 6, 8, 6, 8, 4, 4, 6, 6, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 8, 6, 8, 4 ), [...] ), row.names = c( "Mazda RX4", "Mazda RX4 Wag", "Datsun 710", "Hornet 4 Drive", "Hornet Sportabout", "Valiant", "Duster 360", "Merc 240D", "Merc 230", "Merc 280", "Merc 280C", "Merc 450SE", "Merc 450SL", "Merc 450SLC", "Cadillac Fleetwood", "Lincoln Continental", "Chrysler Imperial", "Fiat 128", "Honda Civic", "Toyota Corolla", "Toyota Corona", "Dodge Challenger", "AMC Javelin", "Camaro Z28", "Pontiac Firebird", "Fiat X1-9", "Porsche 914-2", "Lotus Europa", "Ford Pantera L", "Ferrari Dino", "Maserati Bora", "Volvo 142E" ), class = "data.frame")
And this is how air formats it (413 lines):
structure( list( mpg = c( 21, 21, 22.8, 21.4, 18.7, [...] "Maserati Bora", "Volvo 142E" ), class = "data.frame" )
The text was updated successfully, but these errors were encountered:
We're considering special comments that would let you request specific layouts for a function call.
Sorry, something went wrong.
No branches or pull requests
For long vectors of "simple values", expanding one value per line really is a bit too much. For instance, for this vector:
air
formats it like:while it would probably be better (in this particular case) to have:
I'm sure there are a ton of counter examples where having one element per line is actually better, but I just wanted to mention this case.
Note that this is particularly visible when formatting the output of
dput()
. This is whatdput(mtcars)
gives:This is how
styler
formats it (61 lines):And this is how
air
formats it (413 lines):The text was updated successfully, but these errors were encountered: