funprog (Higher Order Functions)

Published by onesixx on

http://www.johnmyleswhite.com/notebook/2010/09/23/higher-order-functions-in-r/
https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html

다른 Function을 argument로 사용하는 Function을 higher order function이라고 한다.

  1. Reduce
  2. Filter
  3. Map
  4. Find
  5. Position
  6. Negate

Reduce

Negate

List에서 NULL인 원소 제거하기

LL <- list( "sixx", NULL, NULL, c(21,32,11), TRUE, 16)
names(LL) <- seq_along(LL)

Filter(Negate(is.null), LL)

LL[sapply(LL, is.null)] <- NULL
Categories: R Reshaping

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x