벡터를 반환하는 함수와 함께 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()