Skip to content

Commit

Permalink
add example. #540
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Jan 2, 2025
1 parent c63fd7b commit e86c99f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions vignettes/janitor.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ output:
toc: true
toc_depth: 3
vignette: >
%\VignetteIndexEntry{janitor}
%\VignetteIndexEntry{Overview of janitor functions}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit e86c99f

Please sign in to comment.