5 Matching Annotations
- May 2022
-
stackoverflow.com stackoverflow.com
-
df %>% group_by(cat) %>% mutate(id = row_number())
numbering index within a group
-
- Oct 2020
-
tidyr.tidyverse.org tidyr.tidyverse.org
-
dplyr::coalesce() to replaces NAs with values from other vectors.
Tags
Annotators
URL
-
- Apr 2020
-
cran.r-project.org cran.r-project.org
-
Adding variable labels using pipe
-
- Mar 2020
-
-
dplyr in R also lets you use a different syntax for querying SQL databases like Postgres, MySQL and SQLite, which is also in a more logical order
-
- Feb 2020
-
www.r-bloggers.com www.r-bloggers.com
-
Now this can be simplified using the new {{}} syntax: summarise_groups <- function(dataframe, grouping_var, column_name){ dataframe %>% group_by({{grouping_var}}) %>% summarise({{column_name}} := mean({{column_name}}, na.rm = TRUE)) } Much easier and cleaner! You still have to use the := operator instead of = for the column name however. Also, from my understanding, if you want to modify the column names, for instance in this case return "mean_height" instead of height you have to keep using the enquo()–!! syntax.
curly curly syntax
-