Learn R Programming

forstringr (version 1.0.0)

str_rm_whitespace_df: Remove extra spaces in a data frame

Description

str_rm_whitespace_df() removes all leading, trailing, and collapses multiple consecutive white spaces in non-numerical variables in a data frame.

Usage

str_rm_whitespace_df(df)

Value

A clean data frame with no leading or trailing spaces.

Arguments

df

A data frame or data frame extension (e.g. a tibble) with leading or trailing spaces.

Examples

Run this code
richest_in_nigeria

str_rm_whitespace_df(richest_in_nigeria)

Run the code above in your browser using DataLab