diff --git a/vignettes/janitor.Rmd b/vignettes/janitor.Rmd index 5e64c70d..f50a20b6 100644 --- a/vignettes/janitor.Rmd +++ b/vignettes/janitor.Rmd @@ -6,7 +6,7 @@ output: toc: true toc_depth: 3 vignette: > - %\VignetteIndexEntry{janitor} + %\VignetteIndexEntry{Overview of janitor functions} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -15,7 +15,7 @@ vignette: > knitr::opts_chunk$set(collapse = TRUE, comment = "#>") library(janitor) ``` -The janitor functions expedite the initial data exploration and cleaning that comes with any new data set. This catalog describes the usage for each function. +The janitor functions expedite the initial data exploration and cleaning that comes with any new data set. This catalog describes the usage for each function. # Major functions Functions for everyday use. @@ -212,6 +212,17 @@ For instance, here a vector with a date and an Excel datetime sees both values s convert_to_date(c("2020-02-29", "40000.1")) ``` +### Coerce different strings together. + +`paste_skip_na()` can be used to skip `NA` values when coercing multiple columns together. +This is useful since `paste()` just pastes `"NA"` instead of ignoring it. + +```{r} +paste("x", NA, "y") + +paste_skip_na("x", NA, "y") +``` + ### Elevate column names stored in a data.frame row If a data.frame has the intended variable names stored in one of its rows, `row_to_names()` will elevate the specified row to become the names of the data.frame and optionally (by default) remove the row in which names were stored and/or the rows above it.