回傳向量的函式搭配 sapply
本練習屬於課程
R 中級
練習說明
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# temp is already available in the workspace
# Create a function that returns min and max of a vector: extremes
extremes <- function(x) {
c(min = min(x), ___ = ___)
}
# Apply extremes() over temp with sapply()
# Apply extremes() over temp with lapply()