na_2dash: Replace NAs with '-'

View source: R/na_2dash.R

na_2dashR Documentation

Replace NAs with '-'

Description

Replace NAs with '-'

Usage

na_2dash(x)

Arguments

x

Vector

Value

'x' coerced to character vector with all NAs replaced with '-'

Examples

x = 1:10
x[c(2,4,7)] = NA
na_2dash(x)

#install.packages(tidyverse)
library(tidyverse)

set.seed(271828)
dat = iris[1,30]
na_ind = sample(1:nrow(dat), size = 10)
dat$Species[na_ind] = NA

dat %>% mutate_at(vars(Species), na_2dash) %>% View

Ajfrick/ajfhelpR documentation built on June 30, 2023, 12:56 a.m.