Skip to content

Commit

Permalink
Merge develop into master
Browse files Browse the repository at this point in the history
Standing PR from develop to master
  • Loading branch information
elinw committed Feb 25, 2019
2 parents f344bf0 + 657158c commit cb7c34a
Show file tree
Hide file tree
Showing 19 changed files with 174 additions and 134 deletions.
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: skimr
Title: Compact and Flexible Summaries of Data
Version: 1.0.4
Version: 1.0.5
Authors@R: c(
person("Amelia", "McNamara", email="amcnamara@smith.edu", role = "aut"),
person("Eduardo", "Arino de la Rubia", email="earino@gmail.com", role = "aut"),
Expand All @@ -17,9 +17,10 @@ Authors@R: c(
person("Scott", "Brenstuhl", email="brenstsr@miamioh.edu", role = 'ctb'),
person("Patrick", "Schratz", email="patrick.schratz@gmail.com", role = 'ctb'),
person("lbusett", "", email="lbusett@gmail.com", role='ctb'),
person("Mikko","Korpela", email="mvkorpel@iki.fi", role='ctb'),
person("Jennifer","Thompson", email="thompson.jennifer@gmail.com", role='ctb'),
person("Harris","McGehee", email="mcgehee.harris@gmail.com", role='ctb')
person("Mikko", "Korpela", email="mvkorpel@iki.fi", role='ctb'),
person("Jennifer", "Thompson", email="thompson.jennifer@gmail.com", role='ctb'),
person("Harris", "McGehee", email="mcgehee.harris@gmail.com", role='ctb'),
person("Patrick", "Kennedy", email="pkqstr@protonmail.com", role='ctb')
)
Description: A simple to use summary function that can be used with pipes
and displays nicely in the console. The default summary statistics may be
Expand Down Expand Up @@ -57,7 +58,7 @@ URL: https://github.com/ropenscilabs/skimr
BugReports: https://github.com/ropenscilabs/skimr/issues
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
Collate:
'dplyr.r'
'skimr-package.R'
Expand Down
16 changes: 11 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Generated by roxygen2: do not edit by hand

S3method(arrange,skim_df)
S3method(filter,skim_df)
S3method(kable,data.frame)
S3method(kable,skim_df)
S3method(kable,summary_skim_df)
S3method(mutate,skim_df)
S3method(print,skim_df)
S3method(print,skim_vector)
S3method(print,spark)
S3method(print,summary_skim_df)
S3method(select,skim_df)
S3method(skim,data.frame)
S3method(skim,default)
S3method(skim,grouped_df)
S3method(slice,skim_df)
S3method(summary,skim_df)
export("%>%")
export(arrange.skim_df)
export(contains)
export(ends_with)
export(everything)
export(filter.skim_df)
export(filter)
export(fix_windows_histograms)
export(get_skimmers)
export(inline_hist)
Expand All @@ -30,7 +34,6 @@ export(list_min_length)
export(matches)
export(max_char)
export(min_char)
export(mutate.skim_df)
export(n_complete)
export(n_empty)
export(n_missing)
Expand All @@ -40,7 +43,6 @@ export(one_of)
export(pander)
export(pander.skim_df)
export(pander.summary_skim_df)
export(select.skim_df)
export(show_formats)
export(show_skimmers)
export(skim)
Expand All @@ -51,11 +53,15 @@ export(skim_to_list)
export(skim_to_wide)
export(skim_with)
export(skim_with_defaults)
export(slice.skim_df)
export(sorted_count)
export(starts_with)
export(ts_end)
export(ts_start)
importFrom(dplyr,arrange)
importFrom(dplyr,filter)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(dplyr,slice)
importFrom(magrittr,"%>%")
importFrom(tidyselect,contains)
importFrom(tidyselect,ends_with)
Expand Down
14 changes: 13 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
skimr 1.0.4 (2018-01-12)

skimr 1.0.5 (2019-01-05)
========================
This is likely to be the last release of skimr version 1. Version 2
has major changes to the API. Users should review and prepare for
those changes now.

### BUG FIXES
* Fix issue where multibyte characters were causing an error.
* Fix problem in which purrr cannot find mean.default.

skimr 1.0.4 (2019-01-12)
========================

This is likely to be the last release of skimr version 1. Version 2
has major changes to the API. Users should review and prepare for
those changes now.

### BUG FIXES
* Fix failures in handling dplyr verbs related to upcoming release
of dplyr 0.8.0.
Expand Down
28 changes: 22 additions & 6 deletions R/dplyr.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#' Use dplyr verb filter on skim_df objects.
#'
#' @seealso [`dplyr::filter()`]
#' @inheritParams dplyr::filter
#' @param .data A skim object
#' @param ... Logical predicates defined in terms of the variables in .data.
#' @param .preserve When FALSE (the default) the grouping structuree is recalculated
#' based on the resulting data.
#' @return skim_df object coerced to a data frame.
#' @export
filter.skim_df <-function (.data, ..., .preserve = FALSE) {
Expand All @@ -14,7 +17,8 @@ filter.skim_df <-function (.data, ..., .preserve = FALSE) {
#' Use dplyr verb select on skim_df objects.
#'
#' @seealso [`dplyr::select()`]
#' @inheritParams dplyr::select
#' @param .data A skim object
#' @param ... One or more unquoted expressions separated by commas.
#' @return skim_df object coerced to a data frame.
#' @export
select.skim_df <-function (.data, ...) {
Expand All @@ -27,7 +31,10 @@ select.skim_df <-function (.data, ...) {
#' Use dplyr verb mutate on skim_df objects.
#'
#' @seealso [`dplyr::mutate()`]
#' @inheritParams dplyr::mutate
#' @param .data A skim object
#' @param ... Name-value pairs of expressions. The name of each argument will
#' be the name of a new variable, and the value will be its
#' corresponding value.
#' @return skim_df object coerced to a data frame.
#' @export
mutate.skim_df <-function (.data, ...) {
Expand All @@ -40,10 +47,14 @@ mutate.skim_df <-function (.data, ...) {
#' Use dplyr verb arrange on skim_df objects.
#'
#' @seealso [`dplyr::arrange()`]
#' @inheritParams dplyr::arrange
#' @param .data A skim object
#' @param ... Comma separated list of unquoted variable names, or expressions
#' involving variable names.
#' @param .by_group If TRUE, will sort first by grouping variable.
#' Applies to grouped data frames only.
#' @return skim_df object coerced to a data frame.
#' @export
arrange.skim_df <-function (.data, ...) {
arrange.skim_df <-function (.data, ..., .by_group = FALSE) {
.data <- as.data.frame(.data)
.data <- dplyr::arrange(.data, ...)
class(.data) <- c("tbl_df", "tbl", "data.frame")
Expand All @@ -53,7 +64,12 @@ arrange.skim_df <-function (.data, ...) {
#' Use dplyr verb slice on skim_df objects.
#'
#' @seealso [`dplyr::slice()`]
#' @inheritParams dplyr::filter
#' @param .data A skim object
#' @param ... Integer row calues. Provide either positive values to keep or
#' negative values to drop.
#' @param .preserve when FALSE (the default), the grouping structure is
#' recalculated based on the resulting data, otherwise
#' it is kept as is.
#' @return skim_df object coerced to a data frame.
#' @export
slice.skim_df <-function (.data, ..., .preserve = FALSE) {
Expand Down
6 changes: 3 additions & 3 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ numeric_funs <- list(
missing = n_missing,
complete = n_complete,
n = length,
mean = purrr::partial(mean, na.rm = TRUE),
mean = purrr::partial(mean.default, na.rm = TRUE),
sd = purrr::partial(sd, na.rm = TRUE),
p0 = purrr::partial(quantile, probs = 0, na.rm = TRUE, names = FALSE),
p25 = purrr::partial(quantile, probs = .25, na.rm = TRUE, names = FALSE),
Expand Down Expand Up @@ -187,7 +187,7 @@ logical_funs <- list(
missing = n_missing,
complete = n_complete,
n = length,
mean = purrr::partial(mean, na.rm = TRUE),
mean = purrr::partial(mean.default, na.rm = TRUE),
count = sorted_count
)

Expand Down Expand Up @@ -217,7 +217,7 @@ ts_funs <- list(
end = ts_end,
frequency = stats::frequency,
deltat = stats::deltat,
mean = purrr::partial(mean, na.rm = TRUE),
mean = purrr::partial(mean.default, na.rm = TRUE),
sd = purrr::partial(sd, na.rm = TRUE),
min = purrr::partial(min, na.rm = TRUE),
max = purrr::partial(max, na.rm = TRUE),
Expand Down
16 changes: 16 additions & 0 deletions R/skimr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,19 @@ tidyselect::one_of
#' @importFrom tidyselect starts_with
#' @export
tidyselect::starts_with

#' @importFrom dplyr select
dplyr::select

#' @importFrom dplyr arrange
dplyr::arrange

#' @importFrom dplyr filter
#' @export
dplyr::filter

#' @importFrom dplyr mutate
dplyr::mutate

#' @importFrom dplyr slice
dplyr::slice
4 changes: 2 additions & 2 deletions R/stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ n_empty <- function(x) {
#' @export

min_char <- function(x) {
characters <- nchar(x)
characters <- nchar(x, allowNA = TRUE)
min(characters, na.rm = TRUE)
}

Expand All @@ -145,7 +145,7 @@ min_char <- function(x) {
#' @export

max_char <- function(x) {
characters <- nchar(x)
characters <- nchar(x, allowNA = TRUE)
max(characters, na.rm = TRUE)
}

Expand Down
20 changes: 10 additions & 10 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ options(width = 120)
[![codecov](https://codecov.io/gh/ropensci/skimr/branch/master/graph/badge.svg)](https://codecov.io/gh/ropenscilabs/skimr)
[![](https://badges.ropensci.org/175_status.svg)](https://github.com/ropensci/onboarding/issues/175)

`skimr` provides a frictionless approach to summary statistics which conforms
<cite>skimr</cite> provides a frictionless approach to summary statistics which conforms
to the [principle of least surprise](https://en.wikipedia.org/wiki/Principle_of_least_astonishment),
displaying summary statistics the user can skim quickly to understand their
data. It handles different data types and returns a `skim_df` object which can
be included in a pipeline or displayed nicely for the human reader.

## Installation

The current released version of `skimr` can be installed from CRAN. If you wish
The current released version of <cite>skimr</cite> can be installed from CRAN. If you wish
to install the current build of the next release you can do so using the
following:

Expand All @@ -47,7 +47,7 @@ Do not rely on APIs from the develop branch.

## Skim statistics in the console

`skimr`:
<cite>skimr</cite>:

- Provides a larger set of statistics than `summary()`, including missing,
complete, n, and sd.
Expand Down Expand Up @@ -147,7 +147,7 @@ skim(mtcars) %>% dplyr::filter(stat=="hist")

## Customizing skimr

Although skimr provides opinionated defaults, it is highly customizable.
Although <cite>skimr</cite> provides opinionated defaults, it is highly customizable.
Users can specify their own statistics, change the formatting of results,
create statistics for new classes and develop skimmers for data structures
that are not data frames.
Expand All @@ -174,9 +174,9 @@ skim_with_defaults()

### Change formatting

Skimr provides a set of default formats that allow decimals in columns to
<cite>skimr</cite> provides a set of default formats that allow decimals in columns to
be aligned, a reasonable number of decimal places for numeric data, and a
representation of dates. Users can view thes with `show_formats()` and
representation of dates. Users can view these with `show_formats()` and
modify them with `skim_format()`.

### Skimming other objects
Expand All @@ -198,11 +198,11 @@ the low-level code](http://r.789695.n4.nabble.com/Unicode-display-problem-with-d
While some cases have been addressed, there are, for example, reports of this
issue in Emacs ESS.

This means that while `skimr` can render the histograms to the console and in
This means that while <cite>skimr</cite> can render the histograms to the console and in
`kable()`, it cannot in other circumstances. This includes:

* rendering a `skimr` data frame within `pander()`
* converting a `skimr` data frame to a vanilla R data frame, but tibbles render
* rendering a <cite>skimr</cite> data frame within `pander()`
* converting a <cite>skimr</cite> data frame to a vanilla R data frame, but tibbles render
correctly

One workaround for showing these characters in Windows is to set the CTYPE part
Expand All @@ -229,7 +229,7 @@ Microsoft Word and Libre Office Write.

We welcome issue reports and pull requests, including potentially adding
support for commonly used variable classes. However, in general, we encourage
users to take advantage of skimr's flexibility to add their own customized
users to take advantage of <cite>skimr</cite>'s flexibility to add their own customized
classes. Please see the [contributing](CONTRIBUTING.md) and
[conduct](CONDUCT.md) documents.

Expand Down
Loading

0 comments on commit cb7c34a

Please sign in to comment.