I have a timeseries data with NA values in few specific column fields. I am getting an error while trying to replace NAs in column fields with interpolated values. Below is a sample code that I am trying to execute with the error message below. The first row has a value of 17.58 (temperature) and the next value is only at row 30 (2 minute time step) with a value of 16.58. This pattern of NAs and data availability extends for rest of the data.
library(zoo)
my_data[, 42] <- na.approx(my_data[, 42])
Error in [<-.data.frame(*tmp*, , 42, value = c(17.58, 17.5466666666667, :
replacement has 120726 rows, data has 132373