Learn R Programming

usethat (version 0.3.0)

use_na: Use NA of different classes in your project

Description

R has several built-in NA values that correspond to the atomic data types, such as NA (logical), NA_integer_ and NA_character_. Calling use_na() allows the programmer to have NA values of any class. In addition, use_na() provides several useful NA values such as NA_list_, NA_Date_ and NA_POSIXct_.

Usage

use_na(path = "R", export = TRUE)

Arguments

path

(character) A path pointing at where to copy the file.

export

If TRUE, the file content is exported to NAMESPACE.

Value

No return value, called for side effects.

Details

The function copies a file with several NA values to 'path/utils-na.R'.

Examples

Run this code
# NOT RUN {
path <- tempfile()
use_na(path)
print(readLines(file.path(path, "utils-na.R")))

# }

Run the code above in your browser using DataLab