[R] Spliting a huge vector

David Barron mothsailor at googlemail.com
Thu Sep 21 00:22:04 CEST 2006


It's been a long day, so my brain isn't working too well!  How about this:

cut.values <- c(1, 30, 50, 100, 109, 300, 601, 803, length(a.vector))
vec.nms <- paste("vec",1:length(cut.values+1),sep="")
for (i in 1:(length(cut.values)-1))
assign(vec.nms[i],a.vector[cut.values[i]:cut.values[i+1]])

One of the real experts, or just someone more wide awake, can probably
come up with something better!
-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP



More information about the R-help mailing list