Sorry, I had a statement out of order in my previous reply
DECIMATE <- list(24:28, 64:70)
DECIMATEB <- list(29:34, 71:80)
how.many <- rev(rev(DECIMATEB)[[1]])[1]
temp <- sample(how.many)
fun.AB <- function(x, DA, DB) {
c(DA[[x]], DB[[x]])
}
DECIMATEC <- lapply(1:length(DECIMATE), fun.AB, DA=DECIMATE, DB=DECIMATEB)
list1 <- numeric(how.many)
list1[length(DECIMATE[[1]]) + (1:length(DECIMATEB[[1]]))] <-
temp[DECIMATEB[[1]]]
list2 <- numeric(how.many)
list2[length(DECIMATE[[2]]) + (1:length(DECIMATEB[[2]]))] <-
temp[DECIMATEB[[2]]]
fun.ABt <- function(x, DA, DB, temp) {
how.many <- rev(rev(DB)[[1]])[1]
result <- numeric(how.many)
result[length(DA[[x]]) + (1:length(DB[[x]]))] <- temp[DB[[x]]]
result
}
result <- sapply(1:length(DECIMATE), fun.ABt, DA=DECIMATE, DB=DECIMATEB, temp)
|