Re:Show HN: Create Music with R
by andylynch on Saturday July 13, 2024 @04:44AM
(#40952687)
This is quite idiomatic for R; packages like ggplot do the same thing to, for instance, build up graphics- see https://r4ds.hadley.nz/data-visualize for some nice examples
[ Parent
| on HN ]
Re:Show HN: Create Music with R
by erikgahner on Saturday July 13, 2024 @05:04AM
(#40952757)
ggplot2 is pretty much an exception at this point, and if the package was created today it would use the pipe instead of add [1]. Most packages use pipes now (especially with the introduction of the pipe operator in R 4.1.0).
Re:Show HN: Create Music with R
by dr_kiszonka on Saturday July 13, 2024 @11:59AM
(#40954791)
I am no R expert, but pipes don't seem the most intuitive for ggplot. This is because they would imply that, e.g., ggtitle() %>% geom_point() means that ggtitle() outputs an input for geom_point().
That’s exactly how ggplot (not 2!) worked: https://github.com/hadley/ggplot1