返回 NULL 的函数与 sapply
本练习是课程的一部分
R 中级
练习说明
交互式实操练习
通过完成这段示例代码来试试这个练习。
# temp is already available in the workspace
# Definition of print_info()
print_info <- function(x) {
cat("The average temperature is", mean(x), "\n")
}
# Apply print_info() over temp using sapply()
# Apply print_info() over temp using lapply()