Using the zoo
package:
library(zoo)
Cz <- zoo(C)
index(Cz) <- Cz[,1]
Cz_approx <- na.approx(Cz)
More Related Contents:
- Interpolate NA values in a data frame with na.approx
- get x-value given y-value: general root finding for linear / non-linear interpolation function
- How can the facet function in ggplot be used to create a histogram in order to visualize distributions for all variables in a dataset?
- How can I find compound words, removing spaces between them and replace them in my corpus?
- Faster ways to calculate frequencies and cast from long to wide
- How can I remove all duplicates so that NONE are left in a data frame?
- strptime, as.POSIXct and as.Date return unexpected NA
- How to delete a row by reference in data.table?
- Measuring function execution time in R
- R – Concatenate two dataframes?
- Error in plot.new() : figure margins too large in R
- Generate a repeating sequence based on vector
- anova test fails on lme fits created with pasted formula
- How can we make xkcd style graphs?
- lib unspecified & Error in loadNamespace
- First entry from string split
- How to call a function using the character string of the function name in R?
- Sort a data.table fast by Ascending/Descending order
- Join R data.tables where key values are not exactly equal–combine rows with closest times
- Reasons that ggplot2 legend does not appear [duplicate]
- set ggplot plots to have same x-axis width and same space between dot plot rows
- lapply-ing with the “$” function
- How to change the first row to be the header in R?
- Insert a logo in upper right corner of R markdown pdf document
- How to replace NA (missing values) in a data frame with neighbouring values
- How do I draw gridlines using abline() that are behind the data?
- How to get geom_vline to honor facet_wrap?
- r random forest error – type of predictors in new data do not match
- R ggplot ordering bars within groups
- ggplot for loop outputs all the same graph