I would like to compare the elements of a matrix column with the corresponding vector column.
So for example
>ret TLT VTI 1995-01-20 -0.005649718 -0.004461441 1995-01-23 -0.002840909 0.002560820 1995-01-24 0.000000000 0.000000000 1995-01-25 0.005698006 0.003831418 1995-01-26 0.000000000 0.001908397 >compare.vec [1] -0.001 -0.002
I want to compare each returned item in column 1 ret to -0.001 and find which one is less than -0.001. And vice versa, for the second column, comparing it with -0.002 and we find elements in the VTI volumn that are smaller than this.
I tried a subset, but it doesn't seem to be for a vector, but for a number. Do I need a column to loop for a column?
Thanks,
source share