Problem:
I am trying to combine the columns of two vectors with different lengths and starting dates (think stock prices) and want to cut off the excess from the longest while matching the length of the shortest. Any help would be appreciated!
What I have tried so far:
combinedcolumns<-cbind(A$Col,B$Col[(length(B$Col)-length(A$Col)):length(B$Col)])
Results:
I am able to bind the two columns and get correct values for A, but I get the same value for B across the entire length of combinedcolumns.
Thanks in advance!