R matrix vector comparison -
i compare column elements of matrix corresponding vector column.
so 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 what want compare each return element in column 1 of ret -0.001 , find 1 smaller -0.001. vice versa second column, comparing -0.002 , finding elements in vti volumn less that.
i tried subset, seems not vector number. need loop column column?
thanks,
all have is:
t(t(ret) < compare.vec) edit based on comment arun.
Comments
Post a Comment