part2_function <- function(x){
<- ifelse(is.numeric(x),x,"Error: must be a numeric vector") #to make sure a string gives an error. not sure what to put in front of the vector
c (length(x), sum( is.na(x)), mean(x), median(x), max(x), min(x), sd(x))
}
currently my code.
I need my results to come out like this
c(n=33, numberNA=5, mean=5, median=4, max=10, min=1, stdev=3)