Displaying 2 results from an estimated 2 matches for "tradevector".
Did you mean:
tradevectors
2006 Jun 28
2
hopefully my last question on lapply
Marc and many other people ( whose names escape me ) have been
very helpful in explaining the use of lapply to me.
In his last response, Marc explained that if tradevectors is a list
of vectors of different lengths ( excuse my terminology ) then
lapply(tradevectors,function(x) G[x]*B[x] )
will go through each component of the list as if it was a vector
and apply the element by element multiplication of G and B,
( G and B are vectors ) Then, it again returns a list...
2006 Jun 27
1
related to my previous sapply question]
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 ( eleme...