![]() ![]() Just do pivotlonger and leftjoin: df > leftjoin (pivotlonger (., -c (Student, ID)) > groupby (Student, ID) > summarise (Total sum (sort (value, TRUE) 1:2). Try the following: fivenumbersummary <- iris > groupby (Species) > summariseat (vars (Sepal.Length), list (minmin, Q1quantile (., probs 0.25), medianmedian, Q3quantile (., probs 0. Note that the longer format is the tidy format.All packages share an underlying design philosophy, grammar, and data structures. Youre missing the in front of the quantile function in the summariseat call that failed. All packages share an underlying design philosophy, grammar, and data structures. #> x 'x' and 'w' must have the same lengthĬreated on by the reprex package (v0.3. The tidyverse is an opinionated collection of R packages designed for data science. #> ℹ The error occurred in group 1: Species = "setosa".įo1(iris, fun=an, w=.data$Petal.Length) #> ℹ Input `.1` is `across(starts_with("sepal"), fun. like many tidyverse functions, automatically ignores NULL s. The tidyverse method requires a bit more planning and preparation than the statsummary method, but the end result is the same. ![]() #> Error: Problem with `summarise()` input `.1`. across() is a great match for summarize() and mutate() but its more awkward to use with. #> `summarise()` ungrouping output (override with `.groups` argument)įo1(iris, fun=an, w=Petal.Length) Summarise(across(starts_with("sepal"), fun. refer to a variable within the data-frame? The example below is given using across(), but the same happens if I use instead summarize_at() The problem is that I don't find a way to have that. ![]() the aggregation function might use further arguments which refer to variables within the data itself.Ī good example is the user providing fun=an() and specifying the weight argument w.įor now, I am trying with the.the aggregation function is given by user.I want to have a flexible function using summarize in which: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |