Answers for "remove null element from list r"

R
1

remove null element from list r

require(tidyverse)

# this works
compact(mylist)

# or this
mylist %>% discard(is.null)

# or this
# pipe "my_list" data object into function "keep()", make lambda function inside "keep()" to return TRUE FALSE.
mylist %>% keep( ~ !is.null(.) )
Posted by: Guest on September-13-2021
-2

how to remove null values in r

df1_complete <- na.omit(df1) # Method 1 - Remove NA
df1_complete
Posted by: Guest on November-05-2020

Code answers related to "remove null element from list r"

Browse Popular Code Answers by Language