0

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

With NA's

Without NA's (what we want for OUR values

Connor Oey
  • 13
  • 3
  • 3
    use lapply(your_list,na.omit) – jeetkamal Jul 22 '20 at 02:21
  • 1
    Please 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 Answers1

0

You can use :

new_list <- lapply(list.tdf, function(x) x[!is.na(x)])
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213