Interpolate NA values

后端 未结 3 1940
不思量自难忘°
不思量自难忘° 2020-11-27 19:37

I have two set of samples that are time independent. I would like to merge them and calculate the missing values for the times where I do not have values of both. Simplified

3条回答
  •  旧巷少年郎
    2020-11-27 20:13

    Using the zoo package:

    library(zoo)
    Cz <- zoo(C)
    index(Cz) <- Cz[,1]
    Cz_approx <- na.approx(Cz)
    

提交回复
热议问题