I have a list (np) with 152 dataframes (named elements which are stations), and each having two columns (Discharge and Sediment)
I want to fill the missing values using Kalman Arima function, but how to pass these columns as arguments to the function? I have tried a lot of ,[] and np[,] subsetting options, kindly help
List
np
$ Adityapur
Year Discharge Sediment
$ Alladupalli
Year Discharge Sediment
the code below replaces the missing values individually for a single station in the list np.
np$Alladupalli$Sediment<-na_kalman(np$Alladupalli$Sediment, model = "StructTS", smooth = TRUE, maxgap = Inf)
Here is an example where I act on a given column of every data frame stored in a list. I just did a simple multiplication but using na_kalman should be very similar. Just write