Displaying 1 result from an estimated 1 matches for "generizising".
Did you mean:
generalising
2011 Oct 05
1
Vector-subsetting with ZERO - Is behavior changeable?
Dear All,
I have trouble generizising some code.
> index <- 0
> sapply(list(c(1,2,3),c(1,2),c(1)),function(x){x[max(length(x)-index,0)]})
Will yield a wished for vector like so:
[1] 3 2 1
But in this case (trying to select te second to last element in each vector
of the list)
> index <- 1
> sapply(list(c(1,2,3),c(1...