[R] Create vectors from a vector
gamitor at gmail.com
Sun Mar 14 13:11:18 CET 2010
I would like to create a number of vectors which contain the the first n
elements of an existing vector.
For example I have the vectors vnk (200x1) and vro(200x1) and I want to
create 200 vectors that contain the 1st till the n_th element of the vectors
and thus be able to create a vector s with 200 elements which are the
product of all these vectors:
i.e s1<-vnk%*%vro +p^(length(vp+1))
s<-[s1 s2 ......s200]
In the code I created I can calculate only the 200th element
if lapply wouldn't need functions but vector arguments it would do the job
perfectly but I don't know the respective command for vectors. If you know
please tell me.
Any help would be highly appreciated
Thanks a lot
View this message in context: http://n4.nabble.com/Create-vectors-from-a-vector-tp1592334p1592334.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help