2
Rのデフォルト[1]の代わりに、出力に "mean ="をどのように追加しますか?Rのデフォルト[1]ではなく、 "mean ="を出力にどのように追加しますか?
Test_scores <- c(50,75,80,90,99,93,65,85,95,87) #created matrix
Hours_studied <- c(.1,.5,.6,1,3,3.5,.5,1,2,2.5)
grade_study <- cbind(Test_scores,Hours_studied) #combined into one matrix
return(grade_study)
summarystat <- function(x) { #make a function to output the mean, median, sd with the output labeled (ex: mean=)
print(mean(x)),
print (median(x))
print(sd(x))
}