Hi.
I'm a beginner when it comes to the R program, I have a problem with dplyr, specifically with the group_by command. I have a task with the following summary:
"Using the dplyr package, extract setosa, versicolor and virginica species.
Using the dplyr package, create a table containing the mean and deviation
standard, minimum value, maximum value, median, for different species
irises (use the group by function)."
I have no idea how to extraxt these species
Hi, and welcome!
Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. It's not needed for this question because it uses the standard data set iris.
Also, please see the homework policy.
Here is a simple example of the workflow
suppressPackageStartupMessages(library(dplyr))
iris %>% group_by(Species) %>% summarize(sum(Sepal.Length))
#> # A tibble: 3 x 2
#> Species `sum(Sepal.Length)`
#> <fct> <dbl>
#> 1 setosa 250.
#> 2 versicolor 297.
#> 3 virginica 329.
Created on 2020-03-25 by the reprex package (v0.3.0)
sum
is a function that would be replaced with the appropriate functions for mean
, etc.
Thank you very much!
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.