When using apply in R, is there some way to have it skip over vector elements that are NULL
, such that when f(x2,y2)
is undefined apply(x,1,f,y)
returns
c(f(x1,y1),f(x1,y2),f(x2,y2))
rather thanc(f(x1,y1),f(x1,y2),NULL,f(x2,y2))
?
When using apply in R, is there some way to have it skip over vector elements that are NULL
, such that when f(x2,y2)
is undefined apply(x,1,f,y)
returns
c(f(x1,y1),f(x1,y2),f(x2,y2))
rather thanc(f(x1,y1),f(x1,y2),NULL,f(x2,y2))
?