I am wanting to drop the individual NA values from this list so I can apply DTW Hierarchical clustering. Please see attached photos for what we want vs what we have. Most of the literature I have looked at omits the entire row/column with NA values e.g. na.omit. Thanks
Asked
Active
Viewed 42 times
0
-
3use lapply(your_list,na.omit) – jeetkamal Jul 22 '20 at 02:21
-
1Please add data using `dput` and not as images. Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). – Ronak Shah Jul 22 '20 at 02:22
1 Answers
0
You can use :
new_list <- lapply(list.tdf, function(x) x[!is.na(x)])

Ronak Shah
- 377,200
- 20
- 156
- 213