nullToNA: Replace NULL values with NA.

Description Usage Arguments Details Value Examples

View source: R/utility_functions.R

Description

nullToNA is used to convert any NULL values to NA in a list.

Usage

1

Arguments

x

A list.

Details

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.

Value

x with all NULL at the top level of the list replaced by NA.

Examples

1
## Not run: nullToNA(list(1,5,'a', NULL, NA, 4))

Example output

No methods found in "RSQLite" for requests: dbGetQuery
toxboot 0.1.1
MongoDB settings (?toxbootConf):
  TOXBOOT_HOST: NA
  TOXBOOT_DBNS: NA
  TOXBOOT_USER: NA
  TOXBOOT_DB: NA
MySQL settings:
  Host: Not Configured
  Database: Not Configured
  User: Not Configured

toxboot documentation built on Nov. 26, 2018, 1:04 a.m.