I know how to reduce a single-session caphist :
- Code: Select all
bear08_reduce<-reduce(bear2008,newocc=list(1:2, 3:4))
But, I can't quite figure out how to reduce a multi-session caphist where the structure of the reduce is session-specific.
For example, I can reduce a large multi-session caphist in this way, but all sessions get reduced in the same way;
- Code: Select all
test<-lapply(bearCH, function(x) reduce(x,newocc=list(1:2, 3:4)))
I've been trying head this route, but can't seem to figure it out:
- Code: Select all
test<-mapply(reduce, bearCH_F,
reduce=lapply(bearCH_F, function(x) reduce(x,newocc=list(1:2, 3:4))),
MoreArgs = list(Session = 1:5)
)
I have 9 years of data, 2006-2014
I want to reduce 2006-2010 in this fashion:
- Code: Select all
bear_reduce<-reduce(bear,newocc=list(1:2, 3:4))
2011-2012,2014 I don't want to do anything to,
and I want to do this to 2013:
- Code: Select all
bear_reduce<-reduce(bear,newocc=list(1:2, 3, 4 ))
thoughts?