I have two arrays with different lengths
value <- c(1,1,1,4,4,4,1,1,1)
time <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
How to resize an array valueto make it the same length as the array time, preserving its approximate values?
approx() indicates the length is different.
I want to get an array valuelike
value <- c(1,1,1,1,1,4,4,4,4,4,4,1,1,1,1)
time <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
therefore the lengths are equal
UPD
Well, the main goal is to calculate the correlation of v1 from v2, where v1 is inside data.frame v1, t1 and v2 is inside data.frame v2, t2.
the data frames v1, t1 and v2, t2 have different lengths, but , we know that t1 and t2 are equal to the time period, so we can superimpose them.
for t1 we have 1,3,5,7,9, and for t2 we have 1,2,3,4,5,6,7,8,9,10.
, , , , . , v1 v2.
v1 t2.
, , , .