Skip to content

Commit

Permalink
Merge pull request #311 from njtierney/prepare-for-1-0-0-release-310
Browse files Browse the repository at this point in the history
Prepare for 1.0.0 release
  • Loading branch information
njtierney authored Feb 2, 2023
2 parents dcd327f + 2b61452 commit 97fd69d
Show file tree
Hide file tree
Showing 40 changed files with 220 additions and 344 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: naniar
Type: Package
Title: Data Structures, Summaries, and Visualisations for Missing Data
Version: 0.6.1.9000
Version: 1.0.0
Authors@R: c(
person("Nicholas", "Tierney",
role = c("aut", "cre"),
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ S3method(miss_var_summary,default)
S3method(miss_var_summary,grouped_df)
S3method(miss_var_table,default)
S3method(miss_var_table,grouped_df)
S3method(recode_shadow,data.frame)
S3method(recode_shadow,grouped_df)
S3method(replace_with_na,data.frame)
S3method(shadow_shift,"NULL")
S3method(shadow_shift,character)
Expand Down Expand Up @@ -139,7 +141,6 @@ export(shade)
export(shadow_long)
export(shadow_shift)
export(stat_miss_point)
export(to_basic.GeomMissPoint)
export(unbind_data)
export(unbind_shadow)
export(vis_miss)
Expand Down
12 changes: 11 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# naniar 0.6.1.9000
# naniar 1.0.0

Version 1.0.0 of naniar is to signify that this release is associated with
the publication of the associated JSS paper, <doi:10.18637/jss.v105.i07>.
There are also a few small changes that have been implemented in this release,
which are described below.

There is still a lot to do in naniar, and this release does not signify that
there are no changes upcoming, more so to establish that this is a stable
release, and that any changes upcoming will go through a more formal deprecation
process and so on.

## New

Expand Down
2 changes: 2 additions & 0 deletions R/add-cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ add_label_missings <- function(data,
#' @param complete character character a label for when values are complete - defaults to "Not Missing"
#'
#' @return "Missing" or "Not Missing"
#' @keywords internal
#' @noRd
#'
label_shadow <- function(data,
...,
Expand Down
4 changes: 2 additions & 2 deletions R/data-pedestrian.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' Melbourne: Birrarung Marr, Bourke Street Mall, Flagstaff station, and
#' Spencer St-Collins St (south), recorded from January 1st 2016 at 00:00:00
#' to December 31st 2016 at 23:00:00. The data is made free and publicly
#' available from \url{https://data.melbourne.vic.gov.au/Transport-Movement/Pedestrian-volume-updated-monthly-/b2ak-trbp}
#' available from \url{https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-monthly-counts-per-hour/information/}
#'
#' @format A tibble with 37,700 rows and 9 variables:
#' \describe{
Expand All @@ -24,7 +24,7 @@
#' @name pedestrian
#' @docType data
#' @usage data(pedestrian)
#' @source \url{https://data.melbourne.vic.gov.au/Transport-Movement/Pedestrian-volume-updated-monthly-/b2ak-trbp}
#' @source \url{https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-monthly-counts-per-hour/information/}
#' @keywords datasets
#'
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion R/geom2plotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @param p a ggplot2 object (the conversion may depend on scales, for
#' instance).
#' @param ... currently ignored
#' @export
#' @keywords internal
to_basic.GeomMissPoint <- function(data,
prestats_data,
layout,
Expand Down
4 changes: 2 additions & 2 deletions R/mcar-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#' 1198--1202. \doi{10.1080/01621459.1988.10478722}.
#'
#' @note Code is adapted from LittleMCAR() in the now-orphaned {BaylorEdPsych}
#' package: https://rdrr.io/cran/BaylorEdPsych/man/LittleMCAR.html. Some of
#' code is adapted from Eric Stemmler - <https://web.archive.org/web/20201120030409/https://stats-bayes.com/post/2020/08/14/r-function-for-little-s-test-for-data-missing-completely-at-random/>
#' package: \url{https://rdrr.io/cran/BaylorEdPsych/man/LittleMCAR.html}. Some of
#' code is adapted from Eric Stemmler: \url{https://web.archive.org/web/20201120030409/https://stats-bayes.com/post/2020/08/14/r-function-for-little-s-test-for-data-missing-completely-at-random/}
#' using Maximum likelihood estimation from {norm}.
#'
#' @author Andrew Heiss, \email{[email protected]}
Expand Down
2 changes: 2 additions & 0 deletions R/shade.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#' @param extra_levels the extra levels to give to `shade` objects, such as "broken_machine" and so on, which get converted into "NA_broken_machine".
#'
#' @return a new shade, which is built upon a factor
#' @keywords internal
#' @noRd
new_shade <- function(x, extra_levels = NULL){

if (!is.factor(x)) {
Expand Down
18 changes: 17 additions & 1 deletion R/shadow-recode.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#'
#' # test that this breaks
#' # shadow_expand_relevel(airquality, "weee")
#' @keywords internal
#' @noRd
shadow_expand_relevel <- function(.var, suffix){

# create level
Expand Down Expand Up @@ -78,7 +80,8 @@ shadow_expand_relevel <- function(.var, suffix){
#'# update_shadow(dfs, "weee")
#'# update_shadow(dfs, "weee") %>% what_levels()
#' }
#'
#'@keywords internal
#'@noRd
update_shadow <- function(data, suffix) {

class_of_cols <- purrr::map(data,class)
Expand Down Expand Up @@ -152,6 +155,7 @@ update_shadow <- function(data, suffix) {
#'
#' @return a dataframe with altered shadows
#' @export
#' @rdname recode_shadow
#'
#' @examples
#'
Expand All @@ -176,6 +180,12 @@ recode_shadow <- function(data, ...){

test_if_null(data)
test_if_any_shade(data)
UseMethod("recode_shadow")
}

#' @name recode_shadow
#' @export
recode_shadow.data.frame <- function(data, ...){

formulas <- rlang::dots_list(...)

Expand Down Expand Up @@ -234,3 +244,9 @@ recode_shadow <- function(data, ...){

shadow_recoded
}

#' @name recode_shadow
#' @export
recode_shadow.grouped_df <- function(data, ...){
group_by_fun(data, .fun = recode_shadow, ...)
}
11 changes: 10 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ rlang::are_na
#' @param ... additional arguments to be passed to map
#'
#' @return a dataframe with the function applied to each group
#'
#' @keywords internal
#' @noRd
#' @examples
#'
#' \dontrun{
Expand Down Expand Up @@ -52,6 +53,8 @@ group_by_fun <- function(data,.fun, ...){
#' my_test <- NULL
#' test_if_null(my_test)
#' }
#' @keywords internal
#' @noRd
test_if_null <- function(x){

# test for null
Expand All @@ -74,6 +77,8 @@ test_if_null <- function(x){
#' #fail
#' test_if_missing()
#' }
#' @keywords internal
#' @noRd
test_if_missing <- function(x){

# test for null
Expand All @@ -97,6 +102,8 @@ test_if_missing <- function(x){
#' test_if_dataframe(my_test)
#' }
#'
#' @keywords internal
#' @noRd
test_if_dataframe <- function(x){
# test for dataframe
if (!inherits(x, "data.frame")) {
Expand Down Expand Up @@ -152,6 +159,8 @@ add_span_counter <- function(data, span_size) {
#' @param x data.frame, usually
#'
#' @return a list containing the levels of everything
#' @keywords internal
#' @noRd
what_levels <- function(x) purrr::map(x, levels)

quo_to_shade <- function(...){
Expand Down
Loading

0 comments on commit 97fd69d

Please sign in to comment.