Wondering how to get this to work? I am trying to get the mean of number of gears for cars with less than 8 cylinders.
library(reprex)
library(tidyverse)
data("mtcars")
x <- mtcars %>%
filter(cyl < 8) %>%
count(gear)
list(x) %>%
mean()
#> Warning in mean.default(.): argument is not numeric or logical: returning NA
#> [1] NA