in my previous post in which i asked about creating sequences
from two vectors of numbers,  all suggestions worked.

tradevectors<-mapply(seq,from=tempa,to=tempb)

or 

tradevectors<-sapply(1:length(tempa),function(x) seq(tempa[x],tempb[x])

>both return a list with 3 components.

the problem is that i want to take these 3 sequences and

use them as the indices of two other vectors, X and Y and mutiply them  ( 
element by element )


>so, i tried 
>
>temp<-sapply(1:length(tradevectors),function(i)X[tradevectors[[i]]]*Y[tradevectors[[i]]]


basically, the sequence output from the previous command are
indices to two vectors that i want to multiply ( element
by element ).

but, the message i get is that i cannot coerce list object to double. 

i looked up the info on unlist, but that just
makes long vector. i need 3 vectors.

                                   thanks

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to