Skip to content

Commit

Permalink
Make README.md the home index of the pkgdown site + fix unintended ch…
Browse files Browse the repository at this point in the history
…ange in `tabyl()` (#554)

* Fix `tabyl()` for missing values.
Add a test for a case in README that was broken in a previous PR.

* Merge the contents of index.Rmd into README.Rmd

* Delete index file

* Trim down test

* Add myself as ctb
  • Loading branch information
olivroy committed Sep 6, 2023
1 parent df24347 commit bb23615
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 532 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Authors@R: c(
person("Chris", "Haid", , "[email protected]", role = "ctb"),
person("Ryan", "Knight", , "[email protected]", role = "ctb"),
person("Malte", "Grosser", , "[email protected]", role = "ctb"),
person("Jonathan", "Zadra", , "[email protected]", role = "ctb")
person("Jonathan", "Zadra", , "[email protected]", role = "ctb"),
person("Olivier", "Roy", role = "ctb")
)
Description: The main janitor functions can: perfectly format data.frame
column names; provide quick counts of variable combinations (i.e.,
Expand Down
1 change: 1 addition & 0 deletions R/tabyl.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ tabyl_2way <- function(dat, var1, var2, show_na = TRUE, show_missing_levels = TR
names_from = !!var2,
values_from = "tabyl_2way_n",
values_fn = ~ dplyr::coalesce(.x, 0L),
values_fill = 0L,
names_sort = TRUE
)
if ("emptystring_" %in% names(result)) {
Expand Down
32 changes: 18 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ knitr::opts_chunk$set(
options(width = 110)
```

# janitor <img src="man/figures/logo_small.png" align="right" />


> Data scientists, according to interviews and expert estimates, spend from 50 percent to 80 percent of their time mired in this more mundane labor of collecting and preparing unruly digital data, before it can be explored for useful nuggets.
>
> -- ["For Big-Data Scientists, 'Janitor Work' Is Key Hurdle to Insight"](https://www.nytimes.com/2014/08/18/technology/for-big-data-scientists-hurdle-to-insights-is-janitor-work.html) *(New York Times, 2014)*
# janitor <img src="man/figures/logo_small.png" align="right" />

***********************

Expand All @@ -41,25 +43,27 @@ The main janitor functions:

The tabulate-and-report functions approximate popular features of SPSS and Microsoft Excel.

janitor is a [#tidyverse]( https://CRAN.R-project.org/package=tidyverse/vignettes/manifesto.html)-oriented package. Specifically, it plays nicely with the `%>%` pipe and is optimized for cleaning data brought in with the [readr](https://github.com/tidyverse/readr) and [readxl](https://github.com/tidyverse/readxl) packages.
janitor is a [#tidyverse]( https://cran.r-project.org/package=tidyverse/vignettes/manifesto.html)-oriented package. Specifically, it plays nicely with the `%>%` pipe and is optimized for cleaning data brought in with the [readr](https://github.com/tidyverse/readr) and [readxl](https://github.com/tidyverse/readxl) packages.


### Installation
## <i class="fa fa-cog" aria-hidden="true"></i> Installation

You can install:

* the most recent officially-released version from CRAN with

```R
install.packages("janitor")
````
```r
install.packages("janitor")
```

* the latest development version from GitHub with

```R
install.packages("devtools")
devtools::install_github("sfirke/janitor")
```
```R
# install.packages("remotes")
remotes::install_github("sfirke/janitor")
# or from r-universe
install.packages("janitor", repos = c("https://sfirke.r-universe.dev", "https://cloud.r-project.org"))
```

## Using janitor

Expand Down Expand Up @@ -143,11 +147,11 @@ Yes, some teachers appear twice. We ought to address this before counting emplo
A variable (or combinations of two or three variables) can be tabulated with `tabyl()`. The resulting data.frame can be tweaked and formatted
with the suite of `adorn_` functions for quick analysis and printing of pretty results in a report. `adorn_` functions can be helpful with non-tabyls, too.

#### tabyl()
#### `tabyl()`

Like `table()`, but pipe-able, data.frame-based, and fully featured.

`tabyl` can be called two ways:
`tabyl()` can be called two ways:

* On a vector, when tabulating a single variable: `tabyl(roster$subject)`
* On a data.frame, specifying 1, 2, or 3 variable names to tabulate: `roster %>% tabyl(subject, employee_status)`.
Expand All @@ -172,7 +176,7 @@ roster %>%
tabyl(full_time, subject, employee_status, show_missing_levels = FALSE)
```

##### Adorning tabyls
#### Adorning tabyls
The `adorn_` functions dress up the results of these tabulation calls for fast, basic reporting. Here are some of the functions that augment a summary table for reporting:

```{r}
Expand All @@ -189,7 +193,7 @@ Pipe that right into `knitr::kable()` in your RMarkdown report.

These modular adornments can be layered to reduce R's deficit against Excel and SPSS when it comes to quick, informative counts. Learn more about `tabyl()` and the `adorn_` functions from the [tabyls vignette](https://sfirke.github.io/janitor/articles/tabyls.html).

## Contact me
## <i class="fa fa-bullhorn" aria-hidden="true"></i> Contact me

You are welcome to:

Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# janitor <img src="man/figures/logo_small.png" align="right" />

> Data scientists, according to interviews and expert estimates, spend
> from 50 percent to 80 percent of their time mired in this more mundane
> labor of collecting and preparing unruly digital data, before it can
Expand All @@ -10,8 +12,6 @@
> Insight”](https://www.nytimes.com/2014/08/18/technology/for-big-data-scientists-hurdle-to-insights-is-janitor-work.html)
> *(New York Times, 2014)*
# janitor <img src="man/figures/logo_small.png" align="right" />

------------------------------------------------------------------------

<!-- badges: start -->
Expand Down Expand Up @@ -42,28 +42,30 @@ The tabulate-and-report functions approximate popular features of SPSS
and Microsoft Excel.

janitor is a
[\#tidyverse](https://CRAN.R-project.org/package=tidyverse/vignettes/manifesto.html)-oriented
[\#tidyverse](https://cran.r-project.org/package=tidyverse/vignettes/manifesto.html)-oriented
package. Specifically, it plays nicely with the `%>%` pipe and is
optimized for cleaning data brought in with the
[readr](https://github.com/tidyverse/readr) and
[readxl](https://github.com/tidyverse/readxl) packages.

### Installation
## <i class="fa fa-cog" aria-hidden="true"></i> Installation

You can install:

- the most recent officially-released version from CRAN with

``` r
install.packages("janitor")
```
``` r
install.packages("janitor")
```

- the latest development version from GitHub with

``` r
install.packages("devtools")
devtools::install_github("sfirke/janitor")
```
``` r
# install.packages("remotes")
remotes::install_github("sfirke/janitor")
# or from r-universe
install.packages("janitor", repos = c("https://sfirke.r-universe.dev", "https://cloud.r-project.org"))
```

## Using janitor

Expand Down Expand Up @@ -216,11 +218,11 @@ with the suite of `adorn_` functions for quick analysis and printing of
pretty results in a report. `adorn_` functions can be helpful with
non-tabyls, too.

#### tabyl()
#### `tabyl()`

Like `table()`, but pipe-able, data.frame-based, and fully featured.

`tabyl` can be called two ways:
`tabyl()` can be called two ways:

- On a vector, when tabulating a single variable:
`tabyl(roster$subject)`
Expand Down Expand Up @@ -278,7 +280,7 @@ roster %>%
#> Yes 1 1 0 1 1 1 0 1
```

##### Adorning tabyls
#### Adorning tabyls

The `adorn_` functions dress up the results of these tabulation calls
for fast, basic reporting. Here are some of the functions that augment a
Expand Down Expand Up @@ -306,7 +308,7 @@ Excel and SPSS when it comes to quick, informative counts. Learn more
about `tabyl()` and the `adorn_` functions from the [tabyls
vignette](https://sfirke.github.io/janitor/articles/tabyls.html).

## Contact me
## <i class="fa fa-bullhorn" aria-hidden="true"></i> Contact me

You are welcome to:

Expand Down
194 changes: 0 additions & 194 deletions index.Rmd

This file was deleted.

Loading

0 comments on commit bb23615

Please sign in to comment.