Learn R Programming

fixr (version 0.2.0)

fix_special_characters_in_data: Remove Non-Alphanumeric Characters from Data Frame

Description

This function removes non-alphanumeric characters from all non-numeric columns in a data frame. The columns are modified in-place.

Usage

fix_special_characters_in_data(df)

Value

A modified data frame where all non-numeric columns have had non-alphanumeric characters removed.

Arguments

df

A data frame.

Examples

Run this code
df <- data.frame(a = c("A*B", "C&D"), b = c("1.2", "3.4"))
fix_special_characters_in_data(df)
# Output:
#   a    b
# 1 AB  1.2
# 2 CD  3.4

Run the code above in your browser using DataLab