Skip to content
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
48 changes: 0 additions & 48 deletions .github/workflows/pkgdown.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/test-rotemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
push:
pull_request:

name: Test-docs

jobs:
Test-docs:
runs-on: ubuntu-latest
steps:
- uses: ropensci-org/rotemplate@main
74 changes: 54 additions & 20 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,60 @@ Package: visdat
Title: Preliminary Visualisation of Data
Version: 0.6.0.9000
Authors@R: c(
person("Nicholas", "Tierney", role = c("aut", "cre"),
email = "nicholas.tierney@gmail.com",
comment = c(ORCID = "https://orcid.org/0000-0003-1460-8722")),
person("Sean", "Hughes", role = "rev",
comment =c(ORCID = "https://orcid.org/0000-0002-9409-9405",
"Sean Hughes reviewed the package for rOpenSci,
see https://github.com/ropensci/onboarding/issues/87")),
person("Mara", "Averick", role = "rev",
comment = "Mara Averick reviewed the package for rOpenSci, see
https://github.com/ropensci/onboarding/issues/87"),
person("Stuart", "Lee", role = c("ctb")),
person("Earo", "Wang", role = c("ctb")),
person("Nic", "Crane", role = c("ctb")),
person("Christophe", "Regouby", role=c("ctb")),
person("Jordi", "Rosell", role=c("ctb"))
)
person(
given = "Nicholas",
family = "Tierney",
role = c("aut", "cre"),
email = "nicholas.tierney@gmail.com",
comment = c(ORCID = "0000-0003-1460-8722")
),
person(
given = "Sean",
family = "Hughes",
role = "rev",
comment = c(
ORCID = "0000-0002-9409-9405",
"Sean Hughes reviewed the package for rOpenSci, see
https://github.com/ropensci/onboarding/issues/87"
)
),
person(
given = "Mara",
family = "Averick",
role = "rev",
comment = "Mara Averick reviewed the package for rOpenSci, see
https://github.com/ropensci/onboarding/issues/87"
),
person(
given = "Stuart",
family = "Lee",
role = c("ctb")
),
person(
given = "Earo",
family = "Wang",
role = c("ctb")
),
person(
given = "Nic",
family ="Crane",
role = c("ctb")
),
person(
given = "Christophe",
family = "Regouby",
role=c("ctb")
),
person(
given = "Jordi",
family ="Rosell",
role=c("ctb")
)
)
Description: Create preliminary exploratory data visualisations of an entire
dataset to identify problems or unexpected features using 'ggplot2'.
Depends:
R (>= 3.2.2)
R (>= 4.2.0)
License: MIT + file LICENSE
LazyData: true
Imports:
Expand All @@ -30,13 +64,13 @@ Imports:
dplyr,
purrr,
readr,
magrittr,
stats,
tibble,
glue,
forcats,
cli,
scales
scales,
rlang
URL: https://docs.ropensci.org/visdat/, https://github.com/ropensci/visdat
BugReports: https://github.com/ropensci/visdat/issues
Suggests:
Expand All @@ -51,6 +85,6 @@ Suggests:
VignetteBuilder: knitr
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Language: en-US
Language: en-GB
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ S3method(data_vis_dat,grouped_df)
S3method(data_vis_miss,data.frame)
S3method(data_vis_miss,default)
S3method(data_vis_miss,grouped_df)
export("%>%")
export(abbreviate_vars)
export(data_vis_cor)
export(data_vis_dat)
Expand All @@ -23,6 +22,5 @@ export(vis_guess)
export(vis_histogram)
export(vis_miss)
export(vis_value)
importFrom(magrittr,"%>%")
importFrom(stats,cor)
importFrom(stats,setNames)
11 changes: 8 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

* Resolved issue where text on axis was floating up higher - #171 (PR #174).

## Misc

* Remove magrittr; Use `|>` internally over `%>%`
* Depend on R 4.2.0

# visdat 0.6.0 (2023/02/01) "Superman, Lazlo Bane"

## New Feature
Expand All @@ -27,7 +32,7 @@
* resolve bug where `vis_value()` displayed constant values as NA values (#128) - these constant values are now shown as 1.
* removed use of the now deprecated "aes_string" from ggplot2
* output of plot in `vis_expect` would reorder columns ([#133](https://github.com/ropensci/visdat/issues/133)), fixed in [#143](https://github.com/ropensci/visdat/pull/134) by [@muschellij2](https://github.com/muschellij2).
* `vis_miss()` displayed missing percentages between 0.1% and 0.5% as 0% due to rounding. Now it dislpays "<1%" by @zeehio at https://github.com/ropensci/visdat/pull/162.
* `vis_miss()` displayed missing percentages between 0.1% and 0.5% as 0% due to rounding. Now it displays "<1%" by @zeehio at https://github.com/ropensci/visdat/pull/162.

## Misc

Expand All @@ -52,8 +57,8 @@

## Bug Fix

* [Jim Hester](https://github.com/jimhester) fixed recent changes in readr 1.2.0 in PR [#103](https://github.com/ropensci/visdat/pull/103), which changes the default behavior of the `guess_parser`, to not
guess integer types by default. To opt-into the current behavior you
* [Jim Hester](https://github.com/jimhester) fixed recent changes in readr 1.2.0 in PR [#103](https://github.com/ropensci/visdat/pull/103), which changes the default behaviour of the `guess_parser`, to not
guess integer types by default. To opt-into the current behaviour you
need to pass `guess_integer = TRUE.`

# visdat 0.5.1 (2018/07/02) "The Northern Lights Moonwalker"
Expand Down
4 changes: 2 additions & 2 deletions R/abbreviate.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#' )
#'
#' vis_miss(long_data)
#' long_data %>% abbreviate_vars() %>% vis_miss()
#' long_data |> abbreviate_vars() |> vis_miss()
#' @export
abbreviate_vars <- function(data, min_length = 10) {
test_if_dataframe(data)

dplyr::rename_with(
data,
.fn = ~ abbreviate(.x, minlength = min_length, method = "both"),
.fn = \(x) abbreviate(x, minlength = min_length, method = "both"),
# this didn't work with ncar_over for some reason?
.cols = dplyr::everything()
)
Expand Down
9 changes: 5 additions & 4 deletions R/data-typical-data-large.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' \item{Employment}{employee status}
#' \item{Eye}{eye colour}
#' \item{Grade}{percent grades}
#' \item{Grade_Level}{favorite school grade}
#' \item{Grade_Level}{favourite school grade}
#' \item{Group}{control or treatment}
#' \item{hair}{hair colours - "brown", "black", "blonde", or "red"}
#' \item{Height}{height in cm}
Expand All @@ -35,12 +35,13 @@
#' \item{Level}{levels between 1 and 4}
#' \item{Likert}{likert response - "strongly agree", "agree", and so on}
#' \item{Lorem_Ipsum}{lorem ipsum text}
#' \item{Marital}{marital status- "married", "divorced", "widowed", "separated", etc}
#' \item{Marital}{marital status- "married", "divorced", "widowed",
#' "separated", etc}
#' \item{Military}{miliary branch they are in}
#' \item{Month}{their favorite month}
#' \item{Month}{their favourite month}
#' \item{Name}{their name}
#' \item{Normal}{a random normal number}
#' \item{Political}{their favorite political party}
#' \item{Political}{their favourite political party}
#' \item{Race}{their race}
#' \item{Religion}{their religion}
#' \item{SAT}{their SAT score}
Expand Down
12 changes: 6 additions & 6 deletions R/data-vis-cor.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' \dontrun{
#' #return vis_dat data for each group
#' library(dplyr)
#' airquality %>%
#' group_by(Month) %>%
#' airquality |>
#' group_by(Month) |>
#' data_vis_cor()
#' }
data_vis_cor <- function(x, ...) {
Expand Down Expand Up @@ -52,14 +52,14 @@ data_vis_cor.data.frame <- function(
na_action = "pairwise.complete.obs",
...
) {
stats::cor(x, method = cor_method, use = na_action) %>%
as.data.frame() %>%
tibble::rownames_to_column() %>%
stats::cor(x, method = cor_method, use = na_action) |>
as.data.frame() |>
tibble::rownames_to_column() |>
tidyr::pivot_longer(
cols = -rowname,
names_to = "key",
values_to = "value"
) %>%
) |>
purrr::set_names(c("row_1", "row_2", "value"))
}

Expand Down
10 changes: 5 additions & 5 deletions R/data-vis-dat.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' \dontrun{
#' #return vis_dat data for each group
#' library(dplyr)
#' airquality %>%
#' group_by(Month) %>%
#' airquality |>
#' group_by(Month) |>
#' data_vis_dat()
#' }
data_vis_dat <- function(x, ...) {
Expand All @@ -30,9 +30,9 @@ data_vis_dat.default <- function(x, ...) {
#' @rdname data-vis-dat
#' @export
data_vis_dat.data.frame <- function(x, ...) {
x %>%
fingerprint_df() %>%
vis_gather_() %>%
x |>
fingerprint_df() |>
vis_gather_() |>
# get the values here so plotly can make them visible
dplyr::mutate(value = vis_extract_value_(x))
}
Expand Down
19 changes: 9 additions & 10 deletions R/data-vis-miss.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' \dontrun{
#' #return vis_dat data for each group
#' library(dplyr)
#' airquality %>%
#' group_by(Month) %>%
#' airquality |>
#' group_by(Month) |>
#' data_vis_miss()
#' }
data_vis_miss <- function(x, ...) {
Expand All @@ -40,16 +40,15 @@ data_vis_miss.default <- function(x, ...) {
#' @rdname data-vis-miss
#' @export
data_vis_miss.data.frame <- function(x, cluster = FALSE, ...) {
x.na <- x %>%
purrr::map_df(~ fingerprint(.x) %>% is.na)
x.na <- x |>
purrr::map_df(\(x) fingerprint(x) |> is.na())

# switch for creating the missing clustering
if (cluster) {
# this retrieves a row order of the clustered missingness
row_order_index <-
stats::dist(x.na * 1) %>%
stats::hclust(method = "mcquitty") %>%
stats::as.dendrogram() %>%
row_order_index <- stats::dist(x.na * 1) |>
stats::hclust(method = "mcquitty") |>
stats::as.dendrogram() |>
stats::order.dendrogram()
} else {
row_order_index <- seq_len(nrow(x))
Expand All @@ -63,8 +62,8 @@ data_vis_miss.data.frame <- function(x, cluster = FALSE, ...) {
# then the contents of that variable (value)
vis_miss_data <- as.data.frame(x.na[row_order_index, ])

vis_miss_data %>%
vis_gather_() %>%
vis_miss_data |>
vis_gather_() |>
# add info for plotly mousover
dplyr::mutate(value = vis_extract_value_(vis_miss_data))
}
Expand Down
Loading
Loading