null2na | R Documentation |
This function searches for NULL elements in a vector containing lists and converts them to the appropriate type of NA. It is useful for transforming columns containing lists of NULL values from Go.Data, as these columns cannot be un-nested until the NULL values are converted to NA.
null2na(dtcol)
dtcol |
vector containing lists with NULL slots to convert |
the vector with NULLs converted to NAs
Amy Mikhail, amy.mikhail@gmail.com
## Not run:
# Loop through a data.table to convert all NULLs to NAs:
cases[, names(cases) := lapply(.SD, null2na)]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.