nfkc_all | R Documentation |
This is a dplyr-dependent preprocessing function
nfkc_all(
.data,
remove_space_colnames = FALSE,
remove_space_contents = FALSE,
coln_spc = "[:blank:]",
cont_spc = "[:blank:]"
)
.data |
data.frame-like object ( |
remove_space_colnames |
If TRUE, remove all white spaces from all column names. Default: FALSE. |
remove_space_contents |
If TRUE, remove all white spaces from all contents. Default: FALSE. |
coln_spc |
Space character to be removed in colnames. |
cont_spc |
Space character to be removed in contents. |
object of the same class as .data
# data.frame
df <- data.frame(`列1(トン)` = 1, `列2 (kg) ` = 2)
nfkc_all(df)
# data.table
require(data.table)
dt <- data.table(`列1(トン)` = 1.1, `列2 (kg) ` = 2.1)
nfkc_all(dt)
# tibble
require(tibble)
tbl <- tibble(`列1(トン)` = "1.2\r\nトン", `列2 (kg) ` = " 2.2\n kg")
nfkc_all(tbl)
# remove white-spaces (blanks) from all column names
nfkc_all(tbl, remove_space_colnames = TRUE)
# remove white-spaces (blanks) from all contents
nfkc_all(tbl, remove_space_contents = TRUE)
# remove all white-spaces (blanks) from .data
nfkc_all(tbl, remove_space_colnames = TRUE, remove_space_contents = TRUE)
# remove all spaces (including new line characters) from all contents
nfkc_all(tbl, remove_space_contents = TRUE, cont_spc = "[:space:]")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.