Description Usage Arguments Details Value Examples
View source: R/utility_functions.R
nullToNA
is used to convert any NULL values to NA in a list.
1 | nullToNA(x)
|
x |
A list. |
This function is used when reading vectors from mongoDB. If the original vector had a value of NA, rmongodb converts to NULL before writing to the database. When rmongodb performs a find, these NULL values are left as NULL, and when unlisted will shorten the vector. Before unlisting the vector, this function is run to convert the NULL values to NA so that the vector remains the correct length and that NAs are in the correct positions.
x with all NULL at the top level of the list replaced by NA.
1 | ## Not run: nullToNA(list(1,5,'a', NULL, NA, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.