Re: [R] Converting data from weekly interval to daily interval

2021-06-08 Thread Greg Minshall
Bhaskar, not your main question, but ... given that you have column names, you might think of : df2[inc,"date"] <- df1[i,"date"]/7 or : df2[inc,]$date <- df1[i,]$date/7 i.e., using your column names instead of numeric indices. then, also, instead of a for loop, possibly you can use R's

Re: [R] Converting data from weekly interval to daily interval

2021-06-08 Thread Jim Lemon
Hi Bhaskar, Perhaps you are looking for this: approx(c(3,6,7),n=21) $x [1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 [20] 2.9 3.0 $y [1] 3.0 3.3 3.6 3.9 4.2 4.5 4.8 5.1 5.4 5.7 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 [20] 6.9 7.0 This assumes that you are taking ea

[R] Converting data from weekly interval to daily interval

2021-06-08 Thread Bhaskar Mitra
Hello Everyone, I have data at weekly intervals. The data structure is something like this. df1 <- datea 1/7/2020 3 1/14/2020 6 1/21/2021 7 I would like to convert the data from the weekly interval to the daily interval. Something like this. datea 1/7/20200.5