What I'm trying to do: Multiply an object in a list by another object in a different list? I need to multiply a vector of 1000 values in List A times a vector of 1000 values in List B.
For instance:
Vector in List_A:
1
2
3
Vector in List_B:
4
5
6
Output vector I want, List_A*B:
4
10
18
I found something called multiply.list() in the {lgcp} package but apparently not all the dependencies exist anymore so I can't use it...I tried using lapply(doesn't work, Error in x * l1 : non-numeric argument to binary operator) and mapply(which creates a matrix and doesn't just straight multiply the values).
I'm doing all of this within a loop, but cinput.data and l1 are both specified sections of a list.
#l2<-lapply(cinput.data, function(x) x*l1)
#l2<-mapply('*',cinput.data, l1)