Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop to master #650

Merged
merged 3 commits into from
Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/skim_print.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ print.one_skim_df <- function(x,
variable_type <- paste("Variable type:", attr(x, "skim_type"))
top_line <- cli::rule(line = 1, left = variable_type, width = .rule_width)
out <- format(x, ..., n = n, width = .width, n_extra = n_extra)
if (is.null(strip_metadata)) {strip_metadata <- TRUE}
if (strip_metadata) {
metadata <- -1 * grab_tibble_metadata(out)
} else {
Expand Down
7 changes: 4 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ will automatically generate names from the provided values.

By default, functions in the `sfl` call are appended to the default skimmers.

```{r}
```{}
my_skim <- skim_with(numeric = sfl(mad))
my_skim(iris, Sepal.Length)
```
Expand All @@ -159,7 +159,7 @@ But you can also use the dummy argument pattern from `dplyr::funs` to set
particular function arguments. Setting the `append = FALSE` argument uses only
those functions that you've provided.

```{r}
```{}
my_skim <- skim_with(
numeric = sfl(iqr = IQR, p99 = list(~ quantile(., probs = .99))), append = FALSE
)
Expand All @@ -168,7 +168,7 @@ my_skim(iris, Sepal.Length)

And you can remove default skimmers by setting them to `NULL`.

```{r}
```{}
my_skim <- skim_with(numeric = sfl(hist = NULL))
my_skim(iris, Sepal.Length)
```
Expand Down Expand Up @@ -260,6 +260,7 @@ So, by default, we disable removing metadata on windows. You can turn this
feature on with an option. Either set it when calling print or globally.

```{r, eval = FALSE}
skimmed <- skim(chickwts)
print(skimmed, strip_metadata = TRUE)
options(skimr_strip_metadata = TRUE)
```
Expand Down
220 changes: 4 additions & 216 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ align="right" height="139" /></a>

[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/)
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/)
[![R build
status](https://github.com/ropensci/skimr/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/skimr/actions?workflow=R-CMD-check)
[![codecov](https://codecov.io/gh/ropensci/skimr/branch/master/graph/badge.svg)](https://codecov.io/gh/ropensci/skimr/)
Expand Down Expand Up @@ -368,233 +368,20 @@ skimmers.
my_skim <- skim_with(numeric = sfl(mad))
my_skim(iris, Sepal.Length)

<table>
<caption>Data summary</caption>
<tbody>
<tr class="odd">
<td style="text-align: left;">Name</td>
<td style="text-align: left;">iris</td>
</tr>
<tr class="even">
<td style="text-align: left;">Number of rows</td>
<td style="text-align: left;">150</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Number of columns</td>
<td style="text-align: left;">5</td>
</tr>
<tr class="even">
<td style="text-align: left;">_______________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Column type frequency:</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">numeric</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">________________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">Group variables</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>

Data summary

**Variable type: numeric**

<table>
<thead>
<tr class="header">
<th style="text-align: left;">skim_variable</th>
<th style="text-align: right;">n_missing</th>
<th style="text-align: right;">complete_rate</th>
<th style="text-align: right;">mean</th>
<th style="text-align: right;">sd</th>
<th style="text-align: right;">p0</th>
<th style="text-align: right;">p25</th>
<th style="text-align: right;">p50</th>
<th style="text-align: right;">p75</th>
<th style="text-align: right;">p100</th>
<th style="text-align: left;">hist</th>
<th style="text-align: right;">mad</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Sepal.Length</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">5.84</td>
<td style="text-align: right;">0.83</td>
<td style="text-align: right;">4.3</td>
<td style="text-align: right;">5.1</td>
<td style="text-align: right;">5.8</td>
<td style="text-align: right;">6.4</td>
<td style="text-align: right;">7.9</td>
<td style="text-align: left;">▆▇▇▅▂</td>
<td style="text-align: right;">1.04</td>
</tr>
</tbody>
</table>

But you can also use the dummy argument pattern from `dplyr::funs` to
set particular function arguments. Setting the `append = FALSE` argument
uses only those functions that you’ve provided.

my_skim <- skim_with(
numeric = sfl(iqr = IQR, p99 = ~ quantile(., probs = .99)), append = FALSE
numeric = sfl(iqr = IQR, p99 = list(~ quantile(., probs = .99))), append = FALSE
)
my_skim(iris, Sepal.Length)

<table>
<caption>Data summary</caption>
<tbody>
<tr class="odd">
<td style="text-align: left;">Name</td>
<td style="text-align: left;">iris</td>
</tr>
<tr class="even">
<td style="text-align: left;">Number of rows</td>
<td style="text-align: left;">150</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Number of columns</td>
<td style="text-align: left;">5</td>
</tr>
<tr class="even">
<td style="text-align: left;">_______________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Column type frequency:</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">numeric</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">________________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">Group variables</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>

Data summary

**Variable type: numeric**

<table>
<thead>
<tr class="header">
<th style="text-align: left;">skim_variable</th>
<th style="text-align: right;">n_missing</th>
<th style="text-align: right;">complete_rate</th>
<th style="text-align: right;">iqr</th>
<th style="text-align: right;">p99</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Sepal.Length</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">1.3</td>
<td style="text-align: right;">7.7</td>
</tr>
</tbody>
</table>

And you can default skimmers by setting them to `NULL`.
And you can remove default skimmers by setting them to `NULL`.

my_skim <- skim_with(numeric = sfl(hist = NULL))
my_skim(iris, Sepal.Length)

<table>
<caption>Data summary</caption>
<tbody>
<tr class="odd">
<td style="text-align: left;">Name</td>
<td style="text-align: left;">iris</td>
</tr>
<tr class="even">
<td style="text-align: left;">Number of rows</td>
<td style="text-align: left;">150</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Number of columns</td>
<td style="text-align: left;">5</td>
</tr>
<tr class="even">
<td style="text-align: left;">_______________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Column type frequency:</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">numeric</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">________________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">Group variables</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>

Data summary

**Variable type: numeric**

<table>
<thead>
<tr class="header">
<th style="text-align: left;">skim_variable</th>
<th style="text-align: right;">n_missing</th>
<th style="text-align: right;">complete_rate</th>
<th style="text-align: right;">mean</th>
<th style="text-align: right;">sd</th>
<th style="text-align: right;">p0</th>
<th style="text-align: right;">p25</th>
<th style="text-align: right;">p50</th>
<th style="text-align: right;">p75</th>
<th style="text-align: right;">p100</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Sepal.Length</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">5.84</td>
<td style="text-align: right;">0.83</td>
<td style="text-align: right;">4.3</td>
<td style="text-align: right;">5.1</td>
<td style="text-align: right;">5.8</td>
<td style="text-align: right;">6.4</td>
<td style="text-align: right;">7.9</td>
</tr>
</tbody>
</table>

### Skimming other objects

`skimr` has summary functions for the following types of data by
Expand Down Expand Up @@ -684,6 +471,7 @@ So, by default, we disable removing metadata on windows. You can turn
this feature on with an option. Either set it when calling print or
globally.

skimmed <- skim(chickwts)
print(skimmed, strip_metadata = TRUE)
options(skimr_strip_metadata = TRUE)

Expand Down
2 changes: 1 addition & 1 deletion vignettes/skimr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ the variable.
### Skimming data frames

By design, the main focus of `skimr` is on data frames; it is intended to fit
well within a data [pipeline](http://r4ds.had.co.nz/pipes.html) and relies
well within a data [pipeline](https://r4ds.had.co.nz/pipes.html) and relies
extensively on [tidyverse](https://www.tidyverse.org/) vocabulary, which
focuses on data frames.

Expand Down