Learn R Programming

name (version 0.0.2)

repl_phrase: Replace Phrase

Description

Replace Phrase

Usage

repl_phrase(x, phrase, repl)

Value

character

Arguments

x

character; string to change

phrase

character; phrase to replace

repl

character; phrase to replace with

Examples

Run this code
x <- c('pop', 'pop_2020_est', 'pop_white_2020', 'pop_black_2020')
repl_phrase(x, '_2020', '_20')

Run the code above in your browser using DataLab