Permalink
Browse files

CHANGE NAME TO NANIAR, AGAIN

  • Loading branch information...
njtierney committed Jul 25, 2017
1 parent becfc8b commit c8040a9cb9ea9527b7258cd8ce8f6f0d92800660
Showing with 5,107 additions and 840 deletions.
  1. +8 −8 DESCRIPTION
  2. +2 −2 NEWS.md
  3. +1 −1 R/geom-missing-point.R
  4. +1 −1 R/legend-draw.R
  5. +6 −0 R/naniar-ggproto.R
  6. +3 −3 R/{narnia-package.R → naniar-package.R}
  7. +0 −6 R/narnia-ggproto.R
  8. +1 −1 R/plotting.R
  9. +1 −1 R/shadow-shifters.R
  10. +1 −1 R/stat-missing-point.R
  11. +2 −2 R/tidiers_time_series.R
  12. +5 −3 R/tidy-miss-family.R
  13. +3 −3 R/utils.R
  14. BIN README-figs/README-bind-shadow-density-1.png
  15. BIN README-figs/README-facet-add-theme-1.png
  16. BIN README-figs/README-facet-by-month-1.png
  17. BIN README-figs/README-geom-missing-point-1.png
  18. BIN README-figs/README-geom-missing-point-alpha-1.png
  19. BIN README-figs/README-unnamed-chunk-3-1.png
  20. BIN README-figs/README-unnamed-chunk-3-2.png
  21. BIN README-figs/README-unnamed-chunk-4-1.png
  22. BIN README-figs/README-unnamed-chunk-5-1.png
  23. BIN README-figs/README-viss-miss-1.png
  24. +12 −12 README.Rmd
  25. +47 −35 README.md
  26. +1 −1 _pkgdown.yml
  27. +1 −1 data-raw/create-data-oceanbuoys.R
  28. +1 −1 data-raw/create-data-riskfactors.R
  29. +1 −1 docs/CNAME
  30. +20 −5 docs/LICENSE.html
  31. BIN docs/README-figs/README-bind-shadow-density-1.png
  32. BIN docs/README-figs/README-facet-add-theme-1.png
  33. BIN docs/README-figs/README-facet-by-month-1.png
  34. BIN docs/README-figs/README-geom-missing-point-1.png
  35. BIN docs/README-figs/README-geom-missing-point-alpha-1.png
  36. BIN docs/README-figs/README-unnamed-chunk-3-1.png
  37. BIN docs/README-figs/README-unnamed-chunk-3-2.png
  38. BIN docs/README-figs/README-unnamed-chunk-4-1.png
  39. BIN docs/README-figs/README-unnamed-chunk-5-1.png
  40. BIN docs/README-figs/README-viss-miss-1.png
  41. +530 −0 docs/articles/getting-started-w-naniar.html
  42. BIN docs/articles/getting-started-w-naniar_files/figure-html/ggmissing-facet-1.png
  43. BIN docs/articles/getting-started-w-naniar_files/figure-html/ggmissing-theme-1.png
  44. BIN docs/articles/getting-started-w-naniar_files/figure-html/rpart-miss-1.png
  45. BIN docs/articles/getting-started-w-naniar_files/figure-html/shadow-plot-1.png
  46. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-1-1.png
  47. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-2-1.png
  48. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-2-2.png
  49. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-3-1.png
  50. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-4-1.png
  51. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-4-2.png
  52. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-8-1.png
  53. BIN docs/articles/getting-started-w-naniar_files/figure-html/unnamed-chunk-9-1.png
  54. BIN docs/articles/getting-started-w-naniar_files/figure-html/vis-dat-1.png
  55. BIN docs/articles/getting-started-w-naniar_files/figure-html/vis-miss-cluster-vanilla-1.png
  56. +78 −58 docs/articles/getting-started-w-narnia.html
  57. BIN docs/articles/getting-started-w-narnia_files/figure-html/ggmissing-facet-1.png
  58. BIN docs/articles/getting-started-w-narnia_files/figure-html/ggmissing-theme-1.png
  59. BIN docs/articles/getting-started-w-narnia_files/figure-html/shadow-plot-1.png
  60. BIN docs/articles/getting-started-w-narnia_files/figure-html/unnamed-chunk-2-2.png
  61. BIN docs/articles/getting-started-w-narnia_files/figure-html/unnamed-chunk-4-1.png
  62. BIN docs/articles/getting-started-w-narnia_files/figure-html/unnamed-chunk-4-2.png
  63. BIN docs/articles/getting-started-w-narnia_files/figure-html/unnamed-chunk-8-1.png
  64. BIN docs/articles/getting-started-w-narnia_files/figure-html/unnamed-chunk-9-1.png
  65. BIN docs/articles/getting-started-w-narnia_files/figure-html/vis-dat-1.png
  66. BIN docs/articles/getting-started-w-narnia_files/figure-html/vis-miss-cluster-vanilla-1.png
  67. +22 −7 docs/articles/index.html
  68. BIN docs/articles/missingness-data-structures.png
  69. +20 −5 docs/authors.html
  70. +88 −67 docs/index.html
  71. +417 −0 docs/news/index.html
  72. +6 −1 docs/pkgdown.css
  73. +37 −0 docs/pkgdown.js
  74. +54 −21 docs/reference/add_any_miss.html
  75. +34 −149 docs/reference/add_label_missings.html
  76. +167 −0 docs/reference/add_label_shadow.html
  77. +74 −26 docs/reference/add_n_miss.html
  78. BIN docs/reference/add_prop_miss-1.png
  79. BIN docs/reference/add_prop_miss-2.png
  80. +88 −50 docs/reference/add_prop_miss.html
  81. +38 −9 docs/reference/add_shadow.html
  82. +31 −14 docs/reference/add_shadow_shift.html
  83. +23 −8 docs/reference/add_span_counter.html
  84. +20 −5 docs/reference/all_row_complete.html
  85. +20 −5 docs/reference/all_row_miss.html
  86. +20 −5 docs/reference/any_row_miss.html
  87. +20 −5 docs/reference/as_shadow.data.frame.html
  88. +20 −5 docs/reference/as_shadow.html
  89. BIN docs/reference/bind_shadow-1.png
  90. BIN docs/reference/bind_shadow-2.png
  91. +21 −6 docs/reference/bind_shadow.html
  92. +53 −10 docs/reference/cast_shadow.html
  93. +45 −14 docs/reference/cast_shadow_shift.html
  94. +183 −0 docs/reference/cast_shadow_shift_label.html
  95. +21 −6 docs/reference/draw_key.html
  96. +20 −5 docs/reference/gather_shadow.html
  97. BIN docs/reference/geom_miss_point-1.png
  98. BIN docs/reference/geom_miss_point-2.png
  99. BIN docs/reference/geom_miss_point-3.png
  100. BIN docs/reference/geom_miss_point-4.png
  101. +218 −0 docs/reference/geom_miss_point.html
  102. BIN docs/reference/gg_miss_case-1.png
  103. BIN docs/reference/gg_miss_case-2.png
  104. BIN docs/reference/gg_miss_case-3.png
  105. BIN docs/reference/gg_miss_case-4.png
  106. BIN docs/reference/gg_miss_case-5.png
  107. BIN docs/reference/gg_miss_case-6.png
  108. +155 −0 docs/reference/gg_miss_case.html
  109. BIN docs/reference/gg_miss_fct-1.png
  110. BIN docs/reference/gg_miss_fct-2.png
  111. BIN docs/reference/gg_miss_fct-3.png
  112. BIN docs/reference/gg_miss_fct-4.png
  113. BIN docs/reference/gg_miss_fct-5.png
  114. BIN docs/reference/gg_miss_fct-6.png
  115. +160 −0 docs/reference/gg_miss_fct.html
  116. BIN docs/reference/gg_miss_span-1.png
  117. BIN docs/reference/gg_miss_span-2.png
  118. BIN docs/reference/gg_miss_span-3.png
  119. BIN docs/reference/gg_miss_span-4.png
  120. BIN docs/reference/gg_miss_span-5.png
  121. BIN docs/reference/gg_miss_span-6.png
  122. +47 −13 docs/reference/gg_miss_span.html
  123. BIN docs/reference/gg_miss_var-1.png
  124. BIN docs/reference/gg_miss_var-2.png
  125. BIN docs/reference/gg_miss_var-3.png
  126. BIN docs/reference/gg_miss_var-4.png
  127. BIN docs/reference/gg_miss_var-5.png
  128. BIN docs/reference/gg_miss_var-6.png
  129. +155 −0 docs/reference/gg_miss_var.html
  130. BIN docs/reference/gg_miss_which-1.png
  131. BIN docs/reference/gg_miss_which-2.png
  132. +156 −0 docs/reference/gg_miss_which.html
  133. +46 −19 docs/reference/index.html
  134. +20 −5 docs/reference/label_missing_1d.html
  135. +20 −5 docs/reference/label_missing_2d.html
  136. +29 −8 docs/reference/label_missings.html
  137. +20 −5 docs/reference/label_na.html
  138. +147 −0 docs/reference/label_shadow.html
  139. +20 −5 docs/reference/miss_case_pct.html
  140. +20 −5 docs/reference/miss_case_summary.html
  141. +20 −5 docs/reference/miss_case_table.html
  142. +21 −7 docs/reference/miss_df_pct.html
  143. +23 −8 docs/reference/miss_prop_summary.html
  144. +21 −6 docs/reference/miss_summary.html
  145. +20 −5 docs/reference/miss_var_pct.html
  146. BIN docs/reference/miss_var_run-1.png
  147. BIN docs/reference/miss_var_run-2.png
  148. BIN docs/reference/miss_var_run-3.png
  149. BIN docs/reference/miss_var_run-4.png
  150. +24 −9 docs/reference/miss_var_run.html
  151. +20 −5 docs/reference/miss_var_span.html
  152. +25 −6 docs/reference/miss_var_summary.html
  153. +20 −5 docs/reference/miss_var_table.html
  154. +21 −6 docs/reference/n_complete.html
  155. +21 −6 docs/reference/n_miss.html
  156. +136 −0 docs/reference/naniar-ggproto.html
  157. +131 −0 docs/reference/naniar.html
  158. +176 −0 docs/reference/oceanbuoys.html
  159. +20 −5 docs/reference/pedestrian.html
  160. +23 −8 docs/reference/prop_complete.html
  161. +23 −8 docs/reference/prop_miss.html
  162. +20 −5 docs/reference/reexports.html
  163. +214 −0 docs/reference/replace_to_na.html
  164. +288 −0 docs/reference/riskfactors.html
  165. +77 −58 docs/reference/shadow_shift.html
  166. +197 −0 docs/reference/stat_miss_point.html
  167. +23 −8 docs/reference/where_na.html
  168. +22 −7 docs/reference/which_na.html
  169. +7 −7 inst/development-notes.Rmd
  170. +4 −4 inst/shadow-mechanics.Rmd
  171. +1 −1 man/draw_key.Rd
  172. +1 −1 man/miss_summary.Rd
  173. +3 −1 man/miss_var_summary.Rd
  174. +4 −4 man/{narnia-ggproto.Rd → naniar-ggproto.Rd}
  175. +6 −6 man/{narnia.Rd → naniar.Rd}
  176. +1 −1 man/where_na.Rd
  177. +1 −1 man/which_na.Rd
  178. 0 narnia.Rproj → naniar.Rproj
  179. +2 −2 tests/testthat.R
  180. +1 −1 tests/testthat/test-plots.R
  181. +10 −10 vignettes/{getting-started-w-narnia.Rmd → getting-started-w-naniar.Rmd}
@@ -1,17 +1,17 @@
Package: narnia
Package: naniar
Type: Package
Title: Data Structures, Summaries, and Visualisations for Missing Data
Version: 0.0.9.9300
Version: 0.0.9.9400
Author: Nicholas Tierney, Miles McBain, Di Cook,
Authors@R: c(
person("Nicholas", "Tierney", , "nicholas.tierney@gmail.com", c("aut", "cre")),
person("Di", "Cook", , "dicook@monash.edu", role = "aut"),
person("Miles", "McBain", , "miles.mcbain@gmail.com", role = "aut")
)
Description: Missing values are ubiquitous in data and need to be explored and
handled in the initial stages of analysis. 'narnia' provides helpers for
handled in the initial stages of analysis. 'naniar' provides helpers for
exploring missing data dependencies with minimal deviation from the common
workflow of 'ggplot2' and tidy data. 'narnia' builds data structures and
workflow of 'ggplot2' and tidy data. 'naniar' builds data structures and
functions that facilitate plotting of missing values and examination of
imputations.
License: MIT + file LICENSE
@@ -53,8 +53,8 @@ Collate:
'data-riskfactors.R'
'legend-draw.R'
'geom-missing-point.R'
'narnia-ggproto.R'
'narnia-package.R'
'naniar-ggproto.R'
'naniar-package.R'
'plotting.R'
'replace_to_na.R'
'shadow-shifters.R'
@@ -66,5 +66,5 @@ Collate:
'tidy-miss-label.R'
'tidy-miss-scalars.R'
'utils.R'
URL: https://github.com/njtierney/narnia
BugReports: https://github.com/njtierney/narnia/issues
URL: https://github.com/njtierney/naniar
BugReports: https://github.com/njtierney/naniar/issues
@@ -1,4 +1,4 @@
# narnia 0.0.9.4000 (2017/07/24)
# narnia 0.0.9.9400 (2017/07/24)

## new features

@@ -7,7 +7,7 @@ value from a variable to NA.

## breaking changes

- changed `geom_missing_point()` to `geom_miss_point()`.
- changed `geom_missing_point()` to `geom_miss_point()`, to keep consistent with the rest of the functions in `naniar`.

# narnia 0.0.9.9201 (2017/07/12)

@@ -87,7 +87,7 @@

}

#' @rdname narnia-ggproto
#' @rdname naniar-ggproto
#' @format NULL
#' @usage NULL
#' @export
@@ -1,7 +1,7 @@
#' Key drawing functions
#'
#' Each Geom has an associated function that draws the key when the geom needs
#' to be displayed in a legend. These are the options built into narnia.
#' to be displayed in a legend. These are the options built into naniar.
#'
#' @return A grid grob.
#' @param data A single row data frame containing the scaled aesthetics to
@@ -0,0 +1,6 @@
#' @name naniar-ggproto
#' @title naniar-ggroto
#'
#' @description These are the stat and geom overrides using ggproto from ggplot2 that make naniar work.
#'
NULL
@@ -1,10 +1,10 @@
#' narnia
#' naniar
#'
#' narnia is a package to make it easier to summarise and handle missing values
#' naniar is a package to make it easier to summarise and handle missing values
#' in R. It strives to do this in a way that is as consistent with tidyverse
#' principles as possible.
#'
#' @name narnia
#' @name naniar
#' @docType package
#' @import ggplot2
#' @import rlang

This file was deleted.

Oops, something went wrong.
@@ -1,4 +1,4 @@
# plotting functions for narnia
# plotting functions for naniar


#' @importFrom visdat vis_miss
@@ -93,7 +93,7 @@ shadow_shift.character <- function(x, ...){
false = x)
}
#
# library(narnia)
# library(naniar)
#
# riskfactors %>%
# add_shadow_shift(vars = c("drink_average", "smoke_stop")) %>%
@@ -64,7 +64,7 @@ stat_miss_point <- function(mapping = NULL,

}

#' @rdname narnia-ggproto
#' @rdname naniar-ggproto
#' @export
StatMissPoint <- ggproto("StatMissPoint", Stat,
required_aes = c("x", "y"),
@@ -107,7 +107,7 @@ miss_var_run <- function(data, var){
true = "missing",
false = "complete"))
# also look into `label_na`
# narnia::is_na(TRUE)
# naniar::is_na(TRUE)

}

@@ -141,7 +141,7 @@ miss_var_run <- function(data, var){
# weekday) %>%
# # miss_ts_summary(time_index = Date_Time,
# # variable = Hourly_Counts
# # narnia:::add_period_counter(period_length = ) %>%
# # naniar:::add_period_counter(period_length = ) %>%
# # dplyr::group_by(period_counter) %>%
# dplyr::tally(is.na(Hourly_Counts))
# dplyr::rename(n_miss = n) %>%
@@ -81,7 +81,7 @@ miss_case_pct <- function(data){
# which rows are complete?
stats::complete.cases() %>%
mean()

# Return 100 if temp is 1
# Prevent error when all the rows contain a NA and then mean is 1
# so (1 -1)*100 = 0, whereas function should return 100.
@@ -209,6 +209,7 @@ miss_var_table <- function(data){
#' Provide a data_frame containing the variable names, the number of missing values, in each variable, and the percent of missing values in each variable.
#'
#' @param data a dataframe
#' @param ... extra arguments
#'
#' @return a data_frame of the percent of missing data in each variable
#' @export
@@ -217,7 +218,8 @@ miss_var_table <- function(data){
#'
#' miss_var_summary(airquality)
#'
miss_var_summary <- function(data){
#' @export
miss_var_summary <- function(data, ...){

if(is.null(data)){
stop("Input must not be NULL", call. = FALSE)
@@ -269,7 +271,7 @@ miss_case_summary <- function(data){
} else stop("Input must inherit from data.frame", call. = FALSE)
}

#' Collate summary measures from narnia into one tibble
#' Collate summary measures from naniar into one tibble
#'
#' \code{summarise_missingness} performs all of the missing data helper summaries and puts them into a list. Perhaps in the future this can all be some sort of nested dataframe?
#'
@@ -16,7 +16,7 @@ magrittr::`%>%`
#'
#' @examples
#'
#' narnia:::where_na(airquality)
#' naniar:::where_na(airquality)
#'
where_na <- function(x){
which(is.na(x), arr.ind = TRUE)
@@ -36,14 +36,14 @@ where_na <- function(x){
#'
#' @examples
#'
#' narnia:::which_na(airquality)
#' naniar:::which_na(airquality)
#'
which_na <- function(x){
which(is.na(x))
}

# note:
# it would be cool for the missing data mechanisms if these were also treated as regular missing values in the other parts of narnia.
# it would be cool for the missing data mechanisms if these were also treated as regular missing values in the other parts of naniar.
# on that thought, they should just be regular missing values, but the addition of something like the `as_shadow` argument allows for them to be missing with specified structure.
# so, I guess what I'm saying is that there should be a way for the proposed missing mechanisms to be treated differently, if desired, otherwise, treated as regular missings, so they are treated the same by the rest of the R universe.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,12 +12,12 @@ knitr::opts_chunk$set(
)
```

# narnia
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/njtierney/narnia?branch=master&svg=true)](https://ci.appveyor.com/project/njtierney/narnia)
[![Travis-CI Build Status](https://travis-ci.org/njtierney/narnia.svg?branch=master)](https://travis-ci.org/njtierney/narnia)
[![Coverage Status](https://img.shields.io/codecov/c/github/njtierney/narnia/master.svg)](https://codecov.io/github/njtierney/narnia?branch=master)
# naniar
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/njtierney/naniar?branch=master&svg=true)](https://ci.appveyor.com/project/njtierney/naniar)
[![Travis-CI Build Status](https://travis-ci.org/njtierney/naniar.svg?branch=master)](https://travis-ci.org/njtierney/naniar)
[![Coverage Status](https://img.shields.io/codecov/c/github/njtierney/naniar/master.svg)](https://codecov.io/github/njtierney/naniar?branch=master)

`narnia` aims to make it easy to summarise, visualise, and manipulate missing data with minimal deviations from the workflows in ggplot2 and tidy data.
`naniar` aims to make it easy to summarise, visualise, and manipulate missing data with minimal deviations from the workflows in ggplot2 and tidy data.

Currently it provides:

@@ -42,15 +42,15 @@ Currently it provides:
+ `miss_var_table()`
+ `miss_df_pct()`

For details on how to use each of these functions, and their usage, you can read the vignette ["Getting Started with Narnia"](http://www.njtierney.com/narnia/articles/getting-started-w-narnia.html).
For details on how to use each of these functions, and their usage, you can read the vignette ["Getting Started with naniar"](http://www.njtierney.com/naniar/articles/getting-started-w-naniar.html).

**Why `narnia`?**
**Why `naniar`?**

`narnia` was previously named `ggmissing` and initially provided a ggplot geom and some visual summaries. It was changed to `narnia` to reflect the fact that this package is going to be bigger in scope, and is not just related to ggplot2. Specifically, the package is designed to provide a suite of tools for generating visualisations of missing values and imputations, manipulate, and summarise missing data.
`naniar` was previously named `ggmissing` and initially provided a ggplot geom and some visual summaries. It was changed to `naniar` to reflect the fact that this package is going to be bigger in scope, and is not just related to ggplot2. Specifically, the package is designed to provide a suite of tools for generating visualisations of missing values and imputations, manipulate, and summarise missing data.

> ...But _why_ `narnia`?
> ...But _why_ `naniar`?
Well, I think it is useful to think of missing values in data being like this other dimension, perhaps like [C.S. Lewis's Narnia](https://en.wikipedia.org/wiki/The_Chronicles_of_Narnia) - a different world, hidden away. You go inside, and sometimes it seems like you've spent no time in there but time has passed very quickly, or the opposite. Also, `NA`rnia = na in r, and if you so desire, narnia may sound like "noneoya" in an nz/aussie accent. Full credit to @MilesMcbain for the name.
Well, I think it is useful to think of missing values in data being like this other dimension, perhaps like [C.S. Lewis's naniar](https://en.wikipedia.org/wiki/The_Chronicles_of_naniar) - a different world, hidden away. You go inside, and sometimes it seems like you've spent no time in there but time has passed very quickly, or the opposite. Also, `NA`rnia = na in r, and if you so desire, naniar may sound like "noneoya" in an nz/aussie accent. Full credit to @MilesMcbain for the name.

Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.

@@ -86,7 +86,7 @@ We can instead use the `geom_miss_point()` to display the missing data

```{r geom-missing-point}
library(narnia)
library(naniar)
ggplot(data = airquality,
aes(x = Ozone,
@@ -194,7 +194,7 @@ gridExtra::grid.arrange(p1, p2, ncol = 2)

# Numerical summaries for missing data

`narnia` provides numerical summaries of missing data. For variables, cases, and dataframes there are the function families `miss_var_*`, `miss_case_*`, and `miss_df_*`. To find the percent missng variables, cases, and dataframes:
`naniar` provides numerical summaries of missing data. For variables, cases, and dataframes there are the function families `miss_var_*`, `miss_case_*`, and `miss_df_*`. To find the percent missng variables, cases, and dataframes:

```{r numerical-percent-missing}
Oops, something went wrong.

2 comments on commit c8040a9

@ColinFay

This comment has been minimized.

Copy link
Contributor

ColinFay replied Jul 27, 2017

Can I still call it "the realm" anyway? :)

@njtierney

This comment has been minimized.

Copy link
Owner

njtierney replied Jul 28, 2017

Absolutely! 😄 ALSO, I'm getting to your pull request later today

Please sign in to comment.