Could not find function "describe" (descriptive stats analysis

I'm getting an error message (could not find function "describe") when attempting descriptive statistical analysis, here's my reprex...

library(tidyverse)
library(dplyr)

data.frame(
                   row.names = c("Mazda RX4",
                                 "Mazda RX4 Wag","Datsun 710",
                                 "Hornet 4 Drive","Hornet Sportabout","Valiant",
                                 "Duster 360","Merc 240D"),
         mpg = c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4),
         cyl = c(6, 6, 4, 6, 8, 6, 8, 4),
          hp = c(110, 110, 93, 110, 175, 105, 245, 62)
                )
#>                    mpg cyl  hp
#> Mazda RX4         21.0   6 110
#> Mazda RX4 Wag     21.0   6 110
#> Datsun 710        22.8   4  93
#> Hornet 4 Drive    21.4   6 110
#> Hornet Sportabout 18.7   8 175
#> Valiant           18.1   6 105
#> Duster 360        14.3   8 245
#> Merc 240D         24.4   4  62

describe(mtcars,
         mean_mpg = mean(mpg),
         sd_mpg = sd(mpg))
#> Error in describe(mtcars, mean_mpg = mean(mpg), sd_mpg = sd(mpg)): could not find function "describe"

Any help in solving this would be much appreciated.

this is not a function in the tidyverse....
its possible you mean to use a describe function from another library, would you know which one?
or perhaps you mean to use summarise rather than describe?

summarise(mtcars,
         mean_mpg = mean(mpg),
         sd_mpg = sd(mpg))
  mean_mpg   sd_mpg
1 20.09062 6.026948

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.