I am trying to run the code below on RStudio and keep getting errors consistently. I have tried to research on it and have changed the code so many times but could not get it to work. Please review the code below and shed some light on where the error is? I would like to thank you before hand
//CODE
//COMPILER ERROR
EDIT.
The code posted by the OP in comments is:
mydata <- read.csv("stats.idre.ucla.edu/stat/data/binary.csv")
head(mydata)
columns <- c("gre", "gpa", "rank")
mysummary <- function(col, data) {
c( mean = mean(data$col),
sd = sd(data$col),
quantile(data$col, c(0.25, 0.75)),
median = median(data$col)
)
}
sapply(columns, mysummary, mydata)
dput(head(mydata, 20))
dput(head(mydata, 20))
structure(list(admit = c(0L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 1L,
0L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 1L), gre = c(380L, 660L,
800L, 640L, 520L, 760L, 560L, 400L, 540L, 700L, 800L, 440L, 760L,
700L, 700L, 480L, 780L, 360L, 800L, 540L), gpa = c(3.61, 3.67,
4, 3.19, 2.93, 3, 2.98, 3.08, 3.39, 3.92, 4, 3.22, 4, 3.08, 4,
3.44, 3.87, 2.56, 3.75, 3.81), rank = c(3L, 3L, 1L, 4L, 4L, 2L,
1L, 2L, 3L, 2L, 4L, 1L, 1L, 2L, 1L, 3L, 4L, 3L, 2L, 1L)), row.names = c(NA,
20L), class = "data.frame")