I am looking for a method to divide a nrow(x) in a combined for loop and llply in to chunks of 20 until the internal loop reaches the max length of nrow.
Below is the code I am using to do this but fail to add the code to divide nrow into bulks of 20.
The UD_spek13 is a list of UDs from the move
pakage.
Maybe my code can be written in a more memory-friendly way?
How would I re-write the code?
for (i in 3:length(UD_spek13)) {
llply(unlist(UD_spek13[i]), function(x) move.contour(x, range.subset=**code to devide nrow into bulks of 20**,ts=1,ras=10,lev=c(50,95), le=20,
crs=crs, name=paste(x@DBMvar@idData$trackId, "", sep ="_"),
path="C:/Users/Winmac/Documents/article3"))
}
This is what I want to acgieve (code is not working)
for (i in 3:length(UD_spek13)) {
llply(unlist(UD_spek13[i]), function(x) move.contour(x, range.subset=**seq(4, nrow(x), by = 20)**,ts=1,ras=20,lev=c(50,95), le=20,
crs=crs, name=paste(x@DBMvar@idData$trackId, "", sep ="_"),
path="C:/Users/Winmac/Documents/article3test"))
}
range.subset=seq(4, nrow(x), by = 20)