### Generation of artificial longData
data <- gald(percentOfMissing=0.3)
part <- partition(rep(1:4,each=50),4)
plot(data,part)
### Two methods of imputation
par(mfrow=c(1,2))
data1 <- imputation(data,method="linearInterpolation",partition=part)
plot(data1,part,legend=FALSE)
data2 <- imputation(data,method="LOCF")
plot(data2,part,legend=FALSE)
Run the code above in your browser using DataLab