I have a data frame like this:
df <- data.frame(x = 1:100, y = runif(100))
And I splitted it into 5 parts:
z <- split(df, rep(1:5, length.out = nrow(df), each = ceiling(nrow(df)/5)))
Now I'm trying to find descriptive statistics for every part in z but I'm getting this error: (I'm actually interested in finding descriptive statistics of df$y column in these 5 parts.)
psych::describe(z,na.rm = TRUE)
Error in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
is.atomic(x) is not TRUE
Ek olarak: Warning message:
In mean.default(x, na.rm = na.rm) :
argument is not numeric or logical: returning NA
I'm trying to find something like this: (probably it won't look like z[1]$y, but assume that that's what I'm trying to find please)
vars n mean sd median trimmed mad min max range skew kurtosis se
z[1]$y 5 44813 0.02 0.17 0.00 0.01 0.10 -0.97 8.87 9.84 6.19 211.87 0.00
....
z[5]$y 6 45220 0.15 0.07 0.14 0.15 0.05 0.05 0.81 0.76 3.83 31.53 0.00
Also, how can I use describe function for only y values in z[1] or z[5]?
I'm not sure about how to handle the list here, so thanks and appreciating your response.