set_na_type: Set all values in a vector or dataframe to NA, but preserve...

Description Usage Arguments Value Examples

View source: R/short_generic.R

Description

Set all values in a vector or dataframe to NA, but preserve NA types

Usage

1

Arguments

x

a vector of any type

Value

A vector x where all values are NA but original data types are retained

Examples

1
2
3
4
5
fish_empty = tibble::tibble(fish_day = c("Mon", "Tue", "Wed"),
                            fish_kept = c(TRUE, TRUE, FALSE),
                            fish_count = c(4L, 9L, 5L),
                            water_temp = c(5.4, 6.2, 4.1))
fish_empty[] = lapply(fish_empty, set_na_type)

arestrom/remisc documentation built on July 16, 2020, 8:48 a.m.