na_2dash: Replace NAs with '-'

Description Usage Arguments Value Examples

Description

Replace NAs with '-'

Usage

1

Arguments

x

Vector

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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/AVRCHelp documentation built on May 28, 2019, 1:34 a.m.