I am trying to use summarize a dataset so that it would list out the mean, median, SD, 25th, 5th percentile for all columns with numeric values with NA removed. I have the below so far, but cannot seem to get it into the appropriate structure.
mtcars %>% summarize(across(where(is.numeric), list(mean = mean, sd = sd), na.rm = TRUE))
I am looking for something like the below:
MPG CYL DISP HP DRAT etc Mean # # # # # Median # 90% Percentile(q90) # SD # 5% Percentile (q5) # N #
and also like the below
Mean Median Q90 SD Q5 N MPG # # # # # # CYL # DISP # HP # DRAT # etc #
Is it possible to shape the data this way? Thanks for helping a novice in R.