The proper way to codify Na in a list in R I am trying to impute missing timeseries present in different dimentions, row by row, on the whole date set. I showed the type of return of na.kalman() and it happens to be a tribble, I am not so keen on R, so I thought converting it to a plain vector will do it, something like array(as.data.frame(imputed_slice))

library("imputeTS")
library(readr)

slice &lt;- read_csv("slice.csv")
little_slice &lt;- slice[c(750: 850)]
for (row in 1:nrow(little_slice)) {
  ts &lt;- little_slice[row,]
  if(any(is.na(ts)))
     {
       imputed_ts &lt;- na.kalman(ts, model = "auto.arima")
       little_slice[row,] &lt;- array(imputed_ts)
  }
}

#529, 811, 812 missings


Looking for warning, I see something like:


  imputeTS: No imputation performed for column 64 because of this Error
  in na.kalman(data[, i], model, smooth, nit, ...): Input data needs at
  least 3 non-NA data point for applying na.kalman


For every row, so I tried to force other columns to be NA

Like this:

slice$`811` &lt;- NA
slice$`812` &lt;- NA
slice$`822` &lt;- NA
slice$`832` &lt;- NA


To sum up, why na.kalman() not recognizing my NAs?
I made it work by coercing the timeserie to numerics 

little_slice &lt;- slice[c(750: 850)]
for (row in 1:nrow(little_slice)) {
  ts &lt;- as.numeric(little_slice[row,])
  if(any(is.na(ts)))
     {
       imputed_ts &lt;- na.kalman(ts, model = "auto.arima")
       little_slice[row,] &lt;- imputed_ts
  }
}