replace_spaces: Replace spaces in all elements of a character vector with...

Description Usage Arguments Value Author(s) Examples

View source: R/utils.R

Description

Replace spaces in all elements of a character vector with underscores

Usage

1
replace_spaces(x, new_char = "_")

Arguments

x

a character vector

new_char

the character to replace spaces (default: _)

Value

character vector with all spaces replaced with new_char

Author(s)

Kelly Sovacool, sovacool@umich.edu

Examples

1
2
3
4
5
6
dat <- data.frame(
  dx = c("outcome 1", "outcome 2", "outcome 1"),
  a = 1:3, b = c(5, 7, 1)
)
dat$dx <- replace_spaces(dat$dx)
dat

SchlossLab/mikropml documentation built on Nov. 25, 2021, 1:13 p.m.