'Attempting to gather descriptive statistics on some data using sapply() and running into some issues

I'm currently attempting to take my data, which is a 3 variable table defined by data, and find the mean, median, standard deviation, 20th percentile, and 70th percentile using the following code:

sapply(data,mean,median,sd,quantile(probs=c(0.2,0.7)))

However when I use this I get an error stating the following:

Error in if (na.rm) x <- x[!is.na(x)] : 
  argument is not interpretable as logical

Is there something I'm doing wrong? It's the last few bits of my assignment and this is the current block I've ran into



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source