From 3340cf626f77d70d659bd1eae62abadb7d7cab0e Mon Sep 17 00:00:00 2001 From: njtierney Date: Thu, 7 Mar 2024 06:28:06 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20njtierne?= =?UTF-8?q?y/naniar@4f8d7e557350e6bf57a6869af815b5f247805bf8=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/exploring-imputed-values.html | 94 +++++++++++++------------- pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 48 insertions(+), 50 deletions(-) diff --git a/articles/exploring-imputed-values.html b/articles/exploring-imputed-values.html index 44e014dc..7aca404b 100644 --- a/articles/exploring-imputed-values.html +++ b/articles/exploring-imputed-values.html @@ -327,54 +327,52 @@

Hmisc aregImpute -

-library(Hmisc)
-#> 
-#> Attaching package: 'Hmisc'
-#> The following object is masked from 'package:simputation':
-#> 
-#>     impute
-#> The following objects are masked from 'package:dplyr':
-#> 
-#>     src, summarize
-#> The following objects are masked from 'package:base':
-#> 
-#>     format.pval, units
-
-aq_imp <- aregImpute(~Ozone + Temp + Wind + Solar.R,
-                     n.impute = 1,
-                     type = "pmm",
-                     data = airquality)
-#> Iteration 1 
-Iteration 2 
-Iteration 3 
-Iteration 4 
-
-aq_imp
-#> 
-#> Multiple Imputation using Bootstrap and PMM
-#> 
-#> aregImpute(formula = ~Ozone + Temp + Wind + Solar.R, data = airquality, 
-#>     n.impute = 1, type = "pmm")
-#> 
-#> n: 153   p: 4    Imputations: 1      nk: 3 
-#> 
-#> Number of NAs:
-#>   Ozone    Temp    Wind Solar.R 
-#>      37       0       0       7 
-#> 
-#>         type d.f.
-#> Ozone      s    2
-#> Temp       s    2
-#> Wind       s    2
-#> Solar.R    s    1
-#> 
-#> Transformation of Target Variables Forced to be Linear
-#> 
-#> R-squares for Predicting Non-Missing Values for Each Variable
-#> Using Last Imputations of Predictors
-#>   Ozone Solar.R 
-#>   0.667   0.224
+
+
+library(Hmisc)
+#> 
+#> Attaching package: 'Hmisc'
+#> The following object is masked from 'package:simputation':
+#> 
+#>     impute
+#> The following objects are masked from 'package:dplyr':
+#> 
+#>     src, summarize
+#> The following objects are masked from 'package:base':
+#> 
+#>     format.pval, units
+
+aq_imp <- aregImpute(~Ozone + Temp + Wind + Solar.R,
+                     n.impute = 1,
+                     type = "pmm",
+                     data = airquality)
+#> Iteration 1 Iteration 2 Iteration 3 Iteration 4 
+
+aq_imp
+#> 
+#> Multiple Imputation using Bootstrap and PMM
+#> 
+#> aregImpute(formula = ~Ozone + Temp + Wind + Solar.R, data = airquality, 
+#>     n.impute = 1, type = "pmm")
+#> 
+#> n: 153   p: 4    Imputations: 1      nk: 3 
+#> 
+#> Number of NAs:
+#>   Ozone    Temp    Wind Solar.R 
+#>      37       0       0       7 
+#> 
+#>         type d.f.
+#> Ozone      s    2
+#> Temp       s    2
+#> Wind       s    2
+#> Solar.R    s    1
+#> 
+#> Transformation of Target Variables Forced to be Linear
+#> 
+#> R-squares for Predicting Non-Missing Values for Each Variable
+#> Using Last Imputations of Predictors
+#>   Ozone Solar.R 
+#>   0.667   0.224

We are now going to get our data into nabular form, and then insert the imputed values:

diff --git a/pkgdown.yml b/pkgdown.yml
index 47540ed0..c8e8ec97 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -7,7 +7,7 @@ articles:
   naniar-visualisation: naniar-visualisation.html
   replace-with-na: replace-with-na.html
   special-missing-values: special-missing-values.html
-last_built: 2024-03-07T03:16Z
+last_built: 2024-03-07T06:26Z
 urls:
   reference: http://naniar.njtierney.com/reference
   article: http://naniar.njtierney.com/articles
diff --git a/search.json b/search.json
index 19083b52..bbfeb881 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"http://naniar.njtierney.com/CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available http://contributor-covenant.org/version/1/0/0/","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"please-contribute","dir":"","previous_headings":"","what":"Please contribute!","title":"CONTRIBUTING","text":"love collaboration.","code":""},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"bugs","dir":"","previous_headings":"","what":"Bugs?","title":"CONTRIBUTING","text":"Submit issue Issues page","code":""},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"code-contributions","dir":"","previous_headings":"","what":"Code contributions","title":"CONTRIBUTING","text":"Fork repo Github account Clone version account machine account, e.g,. git clone https://github.com//{repo}.git Make sure track progress upstream (.e., version {repo} {owner}/{repo}) git remote add upstream https://github.com/{owner}/{repo}.git. making changes make sure pull changes upstream either git fetch upstream merge later git pull upstream fetch merge one step Make changes (bonus points making changes new feature branch) Push account Submit pull request home base (likely master branch, check make sure) {owner}/{repo}","code":""},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"prefer-to-email","dir":"","previous_headings":"","what":"Prefer to Email?","title":"CONTRIBUTING","text":"able better help post issue otherwise, can find contact details DESCRIPTION file repo.","code":""},{"path":[]},{"path":[]},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"using-impute_below","dir":"Articles","previous_headings":"","what":"Using impute_below","title":"Exploring Imputed Values","text":"impute_below imputes values minimum data, noise reduce overplotting. amount data imputed , amount jitter, can changed changing arguments prop_below jitter.","code":"library(dplyr) #>  #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #>  #>     filter, lag #> The following objects are masked from 'package:base': #>  #>     intersect, setdiff, setequal, union library(naniar)  airquality %>%   impute_below_at(vars(Ozone)) %>%   select(Ozone, Solar.R) %>%   head() #>       Ozone Solar.R #> 1  41.00000     190 #> 2  36.00000     118 #> 3  12.00000     149 #> 4  18.00000     313 #> 5 -19.72321      NA #> 6  28.00000      NA"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"using-impute_mean","dir":"Articles","previous_headings":"","what":"Using impute_mean","title":"Exploring Imputed Values","text":"mean can imputed using impute_mean, useful explore structure missingness, recommended use analysis. Similar simputation, impute_ function returns data values imputed. Imputation functions naniar implement “scoped variants” imputation: _all, _at _if. means: _all operates columns _at operates specific columns, _if operates columns meet condition (.numeric .character). impute_ functions used -- e.g., impute_mean, work single vector, data.frame. examples impute_mean now given: impute data like , identify imputed values - need track . can track imputed values using nabular format data.","code":"impute_mean(oceanbuoys$air_temp_c) %>% head() #> [1] 27.15 27.02 27.00 26.93 26.84 26.94  impute_mean_at(oceanbuoys, .vars = vars(air_temp_c)) %>% head() #> # A tibble: 6 × 8 #>    year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                   #> 1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #> 2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #> 3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #> 4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #> 5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #> 6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60  impute_mean_if(oceanbuoys, .predicate = is.integer) %>% head() #> # A tibble: 6 × 8 #>    year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                   #> 1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #> 2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #> 3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #> 4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #> 5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #> 6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60  impute_mean_all(oceanbuoys) %>% head() #> # A tibble: 6 × 8 #>    year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                   #> 1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #> 2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #> 3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #> 4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #> 5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #> 6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"track-imputed-values-using-nabular-data","dir":"Articles","previous_headings":"Using impute_mean","what":"Track imputed values using nabular data","title":"Exploring Imputed Values","text":"can track missing values combining verbs bind_shadow, impute_, add_label_shadow. can refer missing values shadow variable, _NA. add_label_shadow function adds additional column called any_missing, tells us observation missing value.","code":""},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"imputing-values-using-simputation","dir":"Articles","previous_headings":"Using impute_mean > Track imputed values using nabular data","what":"Imputing values using simputation","title":"Exploring Imputed Values","text":"can impute data using easy--use simputation package, track missingness using bind_shadow add_label_shadow: can show previously missing (now imputed!) data scatterplot ggplot2 setting color aesthetic ggplot any_missing:  , want look one variable, can look density plot one variable, using fill = any_missing  can also compare imputed values complete cases grouping any_missing, summarising.","code":"library(simputation) #>  #> Attaching package: 'simputation' #> The following object is masked from 'package:naniar': #>  #>     impute_median ocean_imp <- oceanbuoys %>%   bind_shadow() %>%   impute_lm(air_temp_c ~ wind_ew + wind_ns) %>%   impute_lm(humidity ~  wind_ew + wind_ns) %>%   impute_lm(sea_temp_c ~  wind_ew + wind_ns) %>%   add_label_shadow() library(ggplot2) ggplot(ocean_imp,        aes(x = air_temp_c,            y = humidity,            color = any_missing)) +    geom_point() +   scale_color_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\") ggplot(ocean_imp,        aes(x = air_temp_c,            fill = any_missing)) +    geom_density(alpha = 0.3) +    scale_fill_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\")  ggplot(ocean_imp,        aes(x = humidity,            fill = any_missing)) +    geom_density(alpha = 0.3) +    scale_fill_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\") ocean_imp %>%   group_by(any_missing) %>%   summarise_at(.vars = vars(air_temp_c),                .funs = list(                  min = ~ min(.x, na.rm = TRUE),                   mean = ~ mean(.x, na.rm = TRUE),                   median = ~ median(.x, na.rm = TRUE),                   max = ~ max(.x, na.rm = TRUE)               )) #> # A tibble: 2 × 5 #>   any_missing   min  mean median   max #>               #> 1 Missing      21.4  23.9   24.4  25.2 #> 2 Not Missing  22.1  25.3   25.8  28.5"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"improving-imputations","dir":"Articles","previous_headings":"","what":"Improving imputations","title":"Exploring Imputed Values","text":"One thing notice imputations aren’t good - can improve upon imputation including variables year latitude longitude:","code":"ocean_imp_yr <- oceanbuoys %>%   bind_shadow() %>%   impute_lm(air_temp_c ~ wind_ew + wind_ns + year + longitude + latitude) %>%   impute_lm(humidity ~  wind_ew + wind_ns + year + longitude + latitude) %>%   impute_lm(sea_temp_c ~  wind_ew + wind_ns + year + longitude + latitude) %>%   add_label_shadow() ggplot(ocean_imp_yr,        aes(x = air_temp_c,            y = humidity,            color = any_missing)) +    geom_point() +   scale_color_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\")"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"other-imputation-approaches","dir":"Articles","previous_headings":"","what":"Other imputation approaches","title":"Exploring Imputed Values","text":"imputation packages return data tidy","code":""},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"hmisc-aregimpute","dir":"Articles","previous_headings":"Other imputation approaches","what":"Hmisc aregImpute","title":"Exploring Imputed Values","text":"can explore using single imputation Hmisc::aregImpute(), allows multiple imputation bootstrapping, additive regression, predictive mean matching. going explore predicting mean matching, single imputation. now going get data nabular form, insert imputed values: future concise way insert imputed values data, moment method recommend single imputation. can explore imputed values like :","code":"library(Hmisc) #>  #> Attaching package: 'Hmisc' #> The following object is masked from 'package:simputation': #>  #>     impute #> The following objects are masked from 'package:dplyr': #>  #>     src, summarize #> The following objects are masked from 'package:base': #>  #>     format.pval, units  aq_imp <- aregImpute(~Ozone + Temp + Wind + Solar.R,                      n.impute = 1,                      type = \"pmm\",                      data = airquality) #> Iteration 1  Iteration 2  Iteration 3  Iteration 4   aq_imp #>  #> Multiple Imputation using Bootstrap and PMM #>  #> aregImpute(formula = ~Ozone + Temp + Wind + Solar.R, data = airquality,  #>     n.impute = 1, type = \"pmm\") #>  #> n: 153   p: 4    Imputations: 1      nk: 3  #>  #> Number of NAs: #>   Ozone    Temp    Wind Solar.R  #>      37       0       0       7  #>  #>         type d.f. #> Ozone      s    2 #> Temp       s    2 #> Wind       s    2 #> Solar.R    s    1 #>  #> Transformation of Target Variables Forced to be Linear #>  #> R-squares for Predicting Non-Missing Values for Each Variable #> Using Last Imputations of Predictors #>   Ozone Solar.R  #>   0.667   0.224 # nabular form! aq_nab <- nabular(airquality) %>%  add_label_shadow()  # insert imputed values aq_nab$Ozone[is.na(aq_nab$Ozone)] <- aq_imp$imputed$Ozone aq_nab$Solar.R[is.na(aq_nab$Solar.R)] <- aq_imp$imputed$Solar.R ggplot(aq_nab,        aes(x = Ozone,            y = Solar.R,            colour = any_missing)) +    geom_point()"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Getting Started with naniar","text":"Missing values ubiquitous data need carefully explored handled initial stages analysis. vignette describe tools package naniar exploring missing data structures minimal deviation common workflows ggplot tidy data (Wickham, 2014, Wickham, 2009). Sometimes researchers analysts introduce describe mechanism missingness. example, might explain data weather station might malfunction extreme weather events, record temperature data gusts speeds high. seems like nice simple, logical explanation. However, like good explanations, one simple, process get probably , likely involved time liked developing exploratory data analyses models. someone presents really nice plot nice sensible explanation, initial thought might : worked quickly, easy! problem easy solve, accidentally solve - couldn’t solve . However, think manage get first go, like turning around throwing rock lake landing cup boat. Unlikely. thought mind, vignette aims work following three questions, using tools developed naniar another package, visdat. Namely, : Start looking missing data? Explore missingness mechanisms? Model missingness?","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"how-do-we-start-looking-at-missing-data","dir":"Articles","previous_headings":"","what":"How do we start looking at missing data?","title":"Getting Started with naniar","text":"start dataset, might something look general summary, using functions : summary() str() skimr::skim, dplyr::glimpse() works really well ’ve got small amount data, data, generally limited much can read. start looking missing data, ’ll need look data, even mean? package visdat helps get handle . visdat provides visualisation entire data frame , heavily inspired csv-fingerprint, functions like missmap, Amelia. two main functions visdat package: vis_dat, vis_miss","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"vis_dat","dir":"Articles","previous_headings":"How do we start looking at missing data?","what":"vis_dat","title":"Getting Started with naniar","text":"vis_dat visualises whole dataframe , provides information class data input R, well whether data missing .","code":"library(visdat) vis_dat(airquality)"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"vis_miss","dir":"Articles","previous_headings":"How do we start looking at missing data? > vis_dat","what":"vis_miss","title":"Getting Started with naniar","text":"function vis_miss provides summary whether data missing . also provides amount missings columns.  , Ozone Solar.R missing data, Ozone 24.2% missing data Solar.R 4.6%. variables missing data. read functions available visdat see vignette “Using visdat”","code":"vis_miss(airquality)"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"exploring-missingness-relationships","dir":"Articles","previous_headings":"","what":"Exploring missingness relationships","title":"Getting Started with naniar","text":"can identify key variables missing using vis_miss, exploration, need explore relationship amongst variables data: Ozone, Solar.R Wind Temp Month Day Typically, exploring data, might want explore variables Solar.R Ozone, plot scatterplot solar radiation ozone, something like :  problem ggplot handle missings default, removes missing values. makes hard explore. also presents strange question “visualise something ?”. One approach visualising missing data comes ggobi MANET, replace “NA” values values 10% lower minimum value variable. process performed visualised geom_miss_point() ggplot2 geom. , illustrate exploring relationship Ozone Solar radiation airquality dataset.  proper ggplot geom, supports standard features ggplot2, facets,  different themes","code":"library(ggplot2) ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_point() ## Warning: Removed 42 rows containing missing values or values outside the scale range ## (`geom_point()`). ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_point() ## Warning: Removed 42 rows containing missing values or values outside the scale range ## (`geom_point()`). library(naniar)  ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_miss_point() ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_miss_point() +    facet_wrap(~Month) ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_miss_point() +    facet_wrap(~Month) +    theme_dark()"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"visualising-missings-in-variables","dir":"Articles","previous_headings":"Exploring missingness relationships","what":"Visualising missings in variables","title":"Getting Started with naniar","text":"Another approach visualising missings dataset use gg_miss_var plot:  plots created gg_miss family basic theme, can customise , add arguments like :   add facets plots, can use facet argument:  visualisations available naniar (starting gg_miss_) - can see “Gallery Missing Data Visualisations” vignette.. important note every visualisation missing data naniar, accompanying function get dataframe plot . important plot return dataframe - also need make data available use user isn’t locked plot. can find summary plots , miss_var_summary providing dataframe gg_miss_var() based .","code":"gg_miss_var(airquality) gg_miss_var(airquality) + theme_bw() gg_miss_var(airquality) + labs(y = \"Look at all the missing ones\") gg_miss_var(airquality, facet = Month)"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"replacing-existing-values-with-na","dir":"Articles","previous_headings":"","what":"Replacing existing values with NA","title":"Getting Started with naniar","text":"dealing missing values, might want replace values missing values (NA). useful cases know origin data can certain values missing. example, might know values “N/”, “N ”, “Available”, -99, -1 supposed missing. naniar provides functions specifically work type problem using function replace_with_na. function compliment tidyr::replace_na, replaces NA value specified value, whereas naniar::replace_with_na replaces value NA: tidyr::replace_na: Missing values turns value (NA –> -99) naniar::replace_with_na: Value becomes missing value (-99 –> NA) can read vignette “Replacing values NA”","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"tidy-missing-data-the-shadow-matrix","dir":"Articles","previous_headings":"","what":"Tidy Missing Data: The Shadow Matrix","title":"Getting Started with naniar","text":"Representing missing data structure tidy format achieved using shadow matrix, introduced Swayne Buja. shadow matrix dimension data, consists binary indicators missingness data values, missing represented “NA”, missing represented “!NA”. Although may represented 1 0, respectively. representation can seen figure , adding suffix “_NA” variables. structure can also extended allow additional factor levels created. example 0 indicates data presence, 1 indicates missing values, 2 indicates imputed value, 3 might indicate particular type class missingness, reasons missingness might known inferred. data matrix can also augmented include shadow matrix, facilitates visualisation univariate bivariate missing data visualisations. Another format display long form, facilitates heatmap style visualisations. approach can helpful giving overview variables contain missingness. Methods can also applied rearrange rows columns find clusters, identify interesting features data may previously hidden unclear.  Illustration data structures facilitating visualisation missings missings shadow functions provide way keep track missing values. as_shadow function creates dataframe set columns, column names added suffix _NA bind_shadow attaches shadow current dataframe, format call “nabular”, portmanteau NA tabular. can also use nabular thing: provides consistent syntax referring variables missing values. Nabular data provides useful pattern explore missing values, grouping missing/complete one variable looking mean summary values. show mean, sd, variance, min max values Solar.R Ozone present, missing. , can plot distribution Temperature, plotting values temperature Ozone missing, missing.  can also explore value air temperature humidity based missingness .   Binding shadow also great benefits combined imputation.","code":"as_shadow(airquality) ## # A tibble: 153 × 6 ##    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA ##                          ##  1 !NA      !NA        !NA     !NA     !NA      !NA    ##  2 !NA      !NA        !NA     !NA     !NA      !NA    ##  3 !NA      !NA        !NA     !NA     !NA      !NA    ##  4 !NA      !NA        !NA     !NA     !NA      !NA    ##  5 NA       NA         !NA     !NA     !NA      !NA    ##  6 !NA      NA         !NA     !NA     !NA      !NA    ##  7 !NA      !NA        !NA     !NA     !NA      !NA    ##  8 !NA      !NA        !NA     !NA     !NA      !NA    ##  9 !NA      !NA        !NA     !NA     !NA      !NA    ## 10 NA       !NA        !NA     !NA     !NA      !NA    ## # ℹ 143 more rows aq_shadow <- bind_shadow(airquality) aq_nab <- nabular(airquality)  library(dplyr) ##  ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ##  ##     filter, lag ## The following objects are masked from 'package:base': ##  ##     intersect, setdiff, setequal, union glimpse(aq_shadow) ## Rows: 153 ## Columns: 12 ## $ Ozone       41, 36, 12, 18, NA, 28, 23, 19, 8, NA, 7, 16, 11, 14, 18, 1… ## $ Solar.R     190, 118, 149, 313, NA, NA, 299, 99, 19, 194, NA, 256, 290,… ## $ Wind        7.4, 8.0, 12.6, 11.5, 14.3, 14.9, 8.6, 13.8, 20.1, 8.6, 6.9… ## $ Temp        67, 72, 74, 62, 56, 66, 65, 59, 61, 69, 74, 69, 66, 68, 58,… ## $ Month       5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,… ## $ Day         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, … ## $ Ozone_NA    !NA, !NA, !NA, !NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !NA, !… ## $ Solar.R_NA  !NA, !NA, !NA, !NA, NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !N… ## $ Wind_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Temp_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Month_NA    !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Day_NA      !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… glimpse(aq_nab) ## Rows: 153 ## Columns: 12 ## $ Ozone       41, 36, 12, 18, NA, 28, 23, 19, 8, NA, 7, 16, 11, 14, 18, 1… ## $ Solar.R     190, 118, 149, 313, NA, NA, 299, 99, 19, 194, NA, 256, 290,… ## $ Wind        7.4, 8.0, 12.6, 11.5, 14.3, 14.9, 8.6, 13.8, 20.1, 8.6, 6.9… ## $ Temp        67, 72, 74, 62, 56, 66, 65, 59, 61, 69, 74, 69, 66, 68, 58,… ## $ Month       5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,… ## $ Day         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, … ## $ Ozone_NA    !NA, !NA, !NA, !NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !NA, !… ## $ Solar.R_NA  !NA, !NA, !NA, !NA, NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !N… ## $ Wind_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Temp_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Month_NA    !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Day_NA      !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… all.equal(aq_shadow, aq_nab) ## [1] TRUE airquality %>%   bind_shadow() %>%   group_by(Ozone_NA) %>%   summarise_at(.vars = \"Solar.R\",                .funs = c(\"mean\", \"sd\", \"var\", \"min\", \"max\"),                na.rm = TRUE) ## # A tibble: 2 × 6 ##   Ozone_NA  mean    sd   var   min   max ##            ## 1 !NA       185.  91.2 8309.     7   334 ## 2 NA        190.  87.7 7690.    31   332 ggplot(aq_shadow,        aes(x = Temp,            colour = Ozone_NA)) +    geom_density() # what if we explore the value of air temperature and humidity based on # the missingness of each   oceanbuoys %>%     bind_shadow() %>%     ggplot(aes(x = air_temp_c,                fill = humidity_NA)) +         geom_histogram() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. ## Warning: Removed 81 rows containing non-finite outside the scale range ## (`stat_bin()`). oceanbuoys %>%     bind_shadow() %>%     ggplot(aes(x = humidity,                fill = air_temp_c_NA)) +         geom_histogram() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. ## Warning: Removed 93 rows containing non-finite outside the scale range ## (`stat_bin()`)."},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"visualising-imputed-values","dir":"Articles","previous_headings":"","what":"Visualising imputed values","title":"Getting Started with naniar","text":"easy--use simputation package, impute values Ozone, visualise data:  Note longer get errors regarding missing observations - imputed! comes cost: also longer information imputations - now sort invisible. Using shadow matrix keep track missings , can actually keep track imputations, colouring previously missing Ozone.","code":"library(simputation) ##  ## Attaching package: 'simputation' ## The following object is masked from 'package:naniar': ##  ##     impute_median library(dplyr)  airquality %>%   impute_lm(Ozone ~ Temp + Wind) %>%   ggplot(aes(x = Temp,              y = Ozone)) +    geom_point() aq_shadow %>%   as.data.frame() %>%    impute_lm(Ozone ~ Temp + Wind) %>%   ggplot(aes(x = Temp,              y = Ozone,              colour = Ozone_NA)) +    geom_point()"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"numerical-summaries-of-missing-values","dir":"Articles","previous_headings":"Visualising imputed values","what":"Numerical summaries of missing values","title":"Getting Started with naniar","text":"naniar also provide numerical summaries missing data. Two convenient counters complete values missings n_miss() n_complete(). work dataframes vectors, similar dplyr::n_distinct() syntax numerical sumamries naniar miss_, case, var refer cases variables. summary, table, run, span, cumsum options explore missing data. prop_miss_case pct_miss_case return numeric value describing proportion percent missing values dataframe. miss_case_summary() returns numeric value describes number missings given case (aka row), percent missings row. miss_case_table() tabulates number missing values case / row. , shows number missings case: 111 cases 0 missings, comprises 72% data. 40 cases 1 missing, make 26% data. 2 cases 2 missing - make 1% data. Similar pct_miss_case(), prop_miss_case(), pct_miss_var() prop_miss_var() returns percent proportion variables contain missing value. miss_var_summary() returns number missing values variable, percent missing variable. Finally, miss_var_table(). describes number missings variable. 4 variables 0 missings, comprising 66.67% variables dataset. 1 variable 7 missings 1 variable 37 missings also summary functions exploring missings occur particular span period dataset, number missings single run: miss_var_run(), miss_var_span() miss_var_run() can particularly useful time series data, allows provide summaries number missings complete values single run. function miss_var_run() provides data.frame run length missings complete values. explore function use built-dataset, pedestrian, contains hourly counts pedestrians four locations around Melbourne, Australia, 2016. use miss_var_run(), specify variable want explore runs missingness , case, hourly_counts: miss_var_span() used determine number missings specified repeating span rows variable dataframe. Similar miss_var_run(), specify variable wish explore, also specify size span span_every argument.","code":"dplyr::n_distinct(airquality) ## [1] 153 dplyr::n_distinct(airquality$Ozone) ## [1] 68 n_miss(airquality) ## [1] 44 n_miss(airquality$Ozone) ## [1] 37 n_complete(airquality) ## [1] 874 n_complete(airquality$Ozone) ## [1] 116 prop_miss_case(airquality) ## [1] 0.2745098 pct_miss_case(airquality) ## [1] 27.45098 miss_case_summary(airquality) ## # A tibble: 153 × 3 ##     case n_miss pct_miss ##           ##  1     5      2     33.3 ##  2    27      2     33.3 ##  3     6      1     16.7 ##  4    10      1     16.7 ##  5    11      1     16.7 ##  6    25      1     16.7 ##  7    26      1     16.7 ##  8    32      1     16.7 ##  9    33      1     16.7 ## 10    34      1     16.7 ## # ℹ 143 more rows miss_case_table(airquality) ## # A tibble: 3 × 3 ##   n_miss_in_case n_cases pct_cases ##                     ## 1              0     111     72.5  ## 2              1      40     26.1  ## 3              2       2      1.31 prop_miss_var(airquality) ## [1] 0.3333333 pct_miss_var(airquality) ## [1] 33.33333 miss_var_summary(airquality) ## # A tibble: 6 × 3 ##   variable n_miss pct_miss ##             ## 1 Ozone        37    24.2  ## 2 Solar.R       7     4.58 ## 3 Wind          0     0    ## 4 Temp          0     0    ## 5 Month         0     0    ## 6 Day           0     0 miss_var_table(airquality) ## # A tibble: 3 × 3 ##   n_miss_in_var n_vars pct_vars ##                  ## 1             0      4     66.7 ## 2             7      1     16.7 ## 3            37      1     16.7 miss_var_run(pedestrian,              hourly_counts) ## # A tibble: 35 × 2 ##    run_length is_na    ##              ##  1       6628 complete ##  2          1 missing  ##  3       5250 complete ##  4        624 missing  ##  5       3652 complete ##  6          1 missing  ##  7       1290 complete ##  8        744 missing  ##  9       7420 complete ## 10          1 missing  ## # ℹ 25 more rows miss_var_span(pedestrian,               hourly_counts,               span_every = 100) ## # A tibble: 377 × 6 ##    span_counter n_miss n_complete prop_miss prop_complete n_in_span ##                                       ##  1            1      0        100         0             1       100 ##  2            2      0        100         0             1       100 ##  3            3      0        100         0             1       100 ##  4            4      0        100         0             1       100 ##  5            5      0        100         0             1       100 ##  6            6      0        100         0             1       100 ##  7            7      0        100         0             1       100 ##  8            8      0        100         0             1       100 ##  9            9      0        100         0             1       100 ## 10           10      0        100         0             1       100 ## # ℹ 367 more rows"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"using-group_by-with-naniar","dir":"Articles","previous_headings":"","what":"Using group_by with naniar","title":"Getting Started with naniar","text":"Every miss_* summary function returns dataframe can used dplyr group_by(). example, like look number missing values variables pedestrian data. see hourly_counts. can explore month, filder variable hourly_counts, since one missing values.","code":"pedestrian %>% miss_var_summary() ## # A tibble: 9 × 3 ##   variable      n_miss pct_miss ##                  ## 1 hourly_counts   2548     6.76 ## 2 date_time          0     0    ## 3 year               0     0    ## 4 month              0     0    ## 5 month_day          0     0    ## 6 week_day           0     0    ## 7 hour               0     0    ## 8 sensor_id          0     0    ## 9 sensor_name        0     0 pedestrian %>%  group_by(month) %>%  miss_var_summary() %>%  filter(variable == \"hourly_counts\") ## # A tibble: 12 × 4 ## # Groups:   month [12] ##    month     variable      n_miss pct_miss ##                        ##  1 January   hourly_counts      0     0    ##  2 February  hourly_counts      0     0    ##  3 March     hourly_counts      0     0    ##  4 April     hourly_counts    552    19.2  ##  5 May       hourly_counts     72     2.42 ##  6 June      hourly_counts      0     0    ##  7 July      hourly_counts      0     0    ##  8 August    hourly_counts    408    13.7  ##  9 September hourly_counts      0     0    ## 10 October   hourly_counts    412     7.44 ## 11 November  hourly_counts    888    30.8  ## 12 December  hourly_counts    216     7.26"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"modelling-missingness","dir":"Articles","previous_headings":"","what":"Modelling missingness","title":"Getting Started with naniar","text":"final question proposed vignette : Can model missingness? Sometimes can impractical explore variables missing data. One approach, however, model missing data using methods Tierney et el. (2015). , approach predict proportion missingness given case, using variables. little helper function add column proportion cases rows missing - add_prop_miss(). created column named “prop_miss”, proportion missing values row. can use model like decision trees predict variables values important predicting proportion missingness:  can see produces quite complex tree - can pruned back depth decision tree controlled.","code":"airquality %>%   add_prop_miss() %>%   head() ##   Ozone Solar.R Wind Temp Month Day prop_miss_all ## 1    41     190  7.4   67     5   1     0.0000000 ## 2    36     118  8.0   72     5   2     0.0000000 ## 3    12     149 12.6   74     5   3     0.0000000 ## 4    18     313 11.5   62     5   4     0.0000000 ## 5    NA      NA 14.3   56     5   5     0.3333333 ## 6    28      NA 14.9   66     5   6     0.1666667 library(rpart) library(rpart.plot)  airquality %>%   add_prop_miss() %>%   rpart(prop_miss_all ~ ., data = .) %>%   prp(type = 4, extra = 101, prefix = \"Prop. Miss = \") ## Warning: Cannot retrieve the data used to build the model (so cannot determine roundint and is.binary for the variables). ## To silence this warning: ##     Call prp with roundint=FALSE, ##     or rebuild the rpart model with model=TRUE."},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"summary","dir":"Articles","previous_headings":"","what":"Summary","title":"Getting Started with naniar","text":"tools naniar help us identify missingness , maintaining tidy workflow. care mechanisms patterns can help us understand potential mechanisms, equipment failures, identify possible solutions based upon evidence.","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"future-development","dir":"Articles","previous_headings":"","what":"Future development","title":"Getting Started with naniar","text":"Make naniar work big data tools like sparklyr, sparklingwater. develop methods handling visualising imputations, multiple imputation. plans extend geom_miss_ family include: Categorical variables Bivariate plots: scatterplots, density overlays Provide tools assessing goodness fit classical approaches MCAR, MAR, MNAR (graphical inference nullabor package)","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"thank-you","dir":"Articles","previous_headings":"","what":"Thank you","title":"Getting Started with naniar","text":"Firstly, thanks Di Cook giving initial inspiration package laying rich theory literature work naniar built upon. Naming credit (!) goes Miles McBain. Among various things, Miles also worked overload missing data make work geom. Thanks also Colin Fay helping understand tidy evaluation features replace_with_na, miss_*_cumsum, .","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Getting Started with naniar","text":"MANET: https://www.rosuda.org/MANET/ ggobi: https://en.wikipedia.org/wiki/GGobi visdat: https://github.com/ropensci/visdat Tierney NJ, Harden FA, Harden MJ, Mengersen, KA, Using decision trees understand structure missing data BMJ Open 2015;5:e007450. doi: 10.1136/bmjopen-2014-007450","code":""},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"Gallery of Missing Data Visualisations","text":"One first plots recommend start first exploring missing data, vis_miss() plot, re-exported visdat.  plot provides specific visualiation amount missing data, showing black location missing values, also providing information overall percentage missing values overall (legend), variable.","code":"library(naniar)  vis_miss(airquality)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"exploring-patterns-with-upsetr","dir":"Articles","previous_headings":"Getting started","what":"Exploring patterns with UpSetR","title":"Gallery of Missing Data Visualisations","text":"upset plot UpSetR package can used visualise patterns missingness, rather combinations missingness across cases. see combinations missingness intersections missingness amongst variables, use gg_miss_upset function:  tells us: Ozone Solar.R missing values Ozone missing values 2 cases Solar.R Ozone missing values together can explore complex data, riskfactors:  default option gg_miss_upset taken UpSetR::upset - use 5 sets 40 interactions. , setting nsets = 5 means look 5 variables combinations. number combinations rather intersections controlled nintersects. , example look number missing variables using n_var_miss:  40 intersections, 40 combinations variables explored. number sets intersections can changed passing arguments nsets = 10 look 10 sets variables, nintersects = 50 look 50 intersections.  Setting nintersects NA plot sets intersections.","code":"gg_miss_upset(airquality) gg_miss_upset(riskfactors) # how many missings? n_var_miss(riskfactors) ## [1] 24 gg_miss_upset(riskfactors, nsets = n_var_miss(riskfactors)) gg_miss_upset(riskfactors,                nsets = 10,               nintersects = 50) gg_miss_upset(riskfactors,                nsets = 10,               nintersects = NA)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"exploring-missingness-mechanisms","dir":"Articles","previous_headings":"","what":"Exploring Missingness Mechanisms","title":"Gallery of Missing Data Visualisations","text":"different ways explore different missing data mechanisms relationships. One way incorporates method shifting missing values can visualised axes regular values, colours missing missing points. implemented geom_miss_point().","code":""},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"geom_miss_point","dir":"Articles","previous_headings":"Exploring Missingness Mechanisms","what":"geom_miss_point","title":"Gallery of Missing Data Visualisations","text":"","code":"library(ggplot2) # using regular geom_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) + geom_point() ## Warning: Removed 42 rows containing missing values or values outside the scale range ## (`geom_point()`). library(naniar)  # using  geom_miss_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() # Facets! ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() +   facet_wrap(~Month) # Themes ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() +   theme_dark()"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"general-visual-summaries-of-missing-data","dir":"Articles","previous_headings":"","what":"General visual summaries of missing data","title":"Gallery of Missing Data Visualisations","text":"function provide quick summaries missingness data, start gg_miss_ - easy remember tab-complete.","code":""},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-in-variables-with-gg_miss_var","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness in variables with gg_miss_var","title":"Gallery of Missing Data Visualisations","text":"plot shows number missing values variable dataset. powered miss_var_summary() function.   wish, can also change whether show % missing instead show_pct = TRUE.  can also plot number missings variable grouped another variable using facet argument.","code":"gg_miss_var(airquality) library(ggplot2) gg_miss_var(airquality) + labs(y = \"Look at all the missing ones\") gg_miss_var(airquality, show_pct = TRUE) gg_miss_var(airquality,             facet = Month)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-in-cases-with-gg_miss_case","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness in cases with gg_miss_case","title":"Gallery of Missing Data Visualisations","text":"plot shows number missing values case. powered miss_case_summary() function.   can also order number cases using order_cases = TRUE  can also explore missingness cases variable using facet = Month","code":"gg_miss_case(airquality) gg_miss_case(airquality) + labs(x = \"Number of Cases\") gg_miss_case(airquality, order_cases = TRUE) gg_miss_case(airquality, facet = Month)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-across-factors-with-gg_miss_fct","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness across factors with gg_miss_fct","title":"Gallery of Missing Data Visualisations","text":"plot shows number missings column, broken categorical variable dataset. powered dplyr::group_by statement followed miss_var_summary().   gg_miss_fct can also used explore missingness along time, like :   (Thanks Maria Paula Caldas inspiration visualisation, discussed )","code":"gg_miss_fct(x = riskfactors, fct = marital) library(ggplot2) gg_miss_fct(x = riskfactors, fct = marital) + labs(title = \"NA in Risk Factors and Marital status\") # using group_by library(dplyr) ##  ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ##  ##     filter, lag ## The following objects are masked from 'package:base': ##  ##     intersect, setdiff, setequal, union riskfactors %>%   group_by(marital) %>%   miss_var_summary() ## # A tibble: 231 × 4 ## # Groups:   marital [7] ##    marital variable      n_miss pct_miss ##                      ##  1 Married smoke_stop       120    91.6  ##  2 Married pregnant         117    89.3  ##  3 Married smoke_last        84    64.1  ##  4 Married smoke_days        73    55.7  ##  5 Married drink_average     68    51.9  ##  6 Married health_poor       67    51.1  ##  7 Married drink_days        67    51.1  ##  8 Married weight_lbs         6     4.58 ##  9 Married bmi                6     4.58 ## 10 Married diet_fruit         4     3.05 ## # ℹ 221 more rows gg_miss_fct(oceanbuoys, year) # to load who data library(tidyr) gg_miss_fct(who, year)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-along-a-repeating-span-with-gg_miss_span","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness along a repeating span with gg_miss_span","title":"Gallery of Missing Data Visualisations","text":"plot shows number missings given span, breaksize, single selected variable. case look span hourly_counts pedestrian dataset. powered miss_var_span function    can also explore miss_var_span group facet argument.","code":"# data method  miss_var_span(pedestrian, hourly_counts, span_every = 3000) ## # A tibble: 13 × 6 ##    span_counter n_miss n_complete prop_miss prop_complete n_in_span ##                                       ##  1            1      0       3000  0                1          3000 ##  2            2      0       3000  0                1          3000 ##  3            3      1       2999  0.000333         1.00       3000 ##  4            4    121       2879  0.0403           0.960      3000 ##  5            5    503       2497  0.168            0.832      3000 ##  6            6    555       2445  0.185            0.815      3000 ##  7            7    190       2810  0.0633           0.937      3000 ##  8            8      0       3000  0                1          3000 ##  9            9      1       2999  0.000333         1.00       3000 ## 10           10      0       3000  0                1          3000 ## 11           11      0       3000  0                1          3000 ## 12           12    745       2255  0.248            0.752      3000 ## 13           13    432       1268  0.254            0.746      1700 gg_miss_span(pedestrian, hourly_counts, span_every = 3000) # works with the rest of ggplot gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + labs(x = \"custom\") gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + theme_dark() gg_miss_span(pedestrian,               hourly_counts,               span_every = 3000,               facet = sensor_name)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"gg_miss_case_cumsum","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"gg_miss_case_cumsum","title":"Gallery of Missing Data Visualisations","text":"plot shows cumulative sum missing values, reading rows dataset top bottom. powered miss_case_cumsum() function.","code":"gg_miss_case_cumsum(airquality) library(ggplot2) gg_miss_case_cumsum(riskfactors, breaks = 50) + theme_bw()"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"gg_miss_var_cumsum","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"gg_miss_var_cumsum","title":"Gallery of Missing Data Visualisations","text":"plot shows cumulative sum missing values, reading columns left right dataframe. powered miss_var_cumsum() function.","code":"gg_miss_var_cumsum(airquality)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"gg_miss_which","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"gg_miss_which","title":"Gallery of Missing Data Visualisations","text":"plot shows set rectangles indicate whether missing element column .","code":"gg_miss_which(airquality)"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"example-data","dir":"Articles","previous_headings":"","what":"Example data","title":"Replacing values with NA","text":"First, introduce small fictional dataset, df, contains common features dataset sorts missing values might encounter. includes multiple specifications missing values, “N/”, “N ”, “Available”. also common numeric codes, like -98, -99, -1.","code":"df <- tibble::tribble(   ~name,           ~x,  ~y,              ~z,     \"N/A\",           1,   \"N/A\",           -100,    \"N A\",           3,   \"NOt available\", -99,   \"N / A\",         NA,  \"29\",              -98,   \"Not Available\", -99, \"25\",              -101,   \"John Smith\",    -98, \"28\",              -1)"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"using-replace_with_na","dir":"Articles","previous_headings":"Example data","what":"Using replace_with_na","title":"Replacing values with NA","text":"want replace value -99 x column missing value? First, let’s load naniar: Now, specify fact want replace -99 missing value. use replace argument, specify named list, contains names variable value take replace NA. say want replace -98 well? want replace -99 -98 numeric columns, x z? Using replace_with_na() works well know exact value replaced, variables want replace, providing many variables. ’ve got many variables want observe?","code":"library(naniar) df %>% replace_with_na(replace = list(x = -99)) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available   -99 #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1 df %>%   replace_with_na(replace = list(x = c(-99, -98))) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available   -99 #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith       NA 28               -1 df %>%   replace_with_na(replace = list(x = c(-99,-98),                              z = c(-99, -98))) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29               NA #> 4 Not Available    NA 25             -101 #> 5 John Smith       NA 28               -1"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"extending-replace_with_na","dir":"Articles","previous_headings":"Example data","what":"Extending replace_with_na","title":"Replacing values with NA","text":"Sometimes many value want replace. example, -99 -98 , also variants “NA”, “N/”, “N / ”, “Available”. might also certain variables want affected rules, might complex rules, like, “affect variables numeric, character, rule”. account cases borrowed dplyr’s scoped variants created functions: replace_with_na_all() Replaces NA variables. replace_with_na_at() Replaces NA subset variables specified character quotes (e.g., c(“var1”, “var2”)). replace_with_na_if() Replaces NA based applying operation subset variables predicate function (.numeric, .character, etc) returns TRUE. now consider simple examples use functions, can better understand use .","code":""},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"using-replace_with_na_all","dir":"Articles","previous_headings":"Example data","what":"Using replace_with_na_all","title":"Replacing values with NA","text":"Use replace_with_na_all() want replace values meet condition across entire dataset. syntax little different, follows rules rlang’s expression simple functions. means function starts ~, referencing variable, use .x. example, want replace cases -99 dataset, write: Likewise, set (annoying) repeating strings like various spellings “NA”, suggest first lay offending cases: write ~.x %% na_strings - reads “value occur list NA strings”. can also use built-strings numbers naniar: common_na_numbers common_na_strings can replace values matching strings numbers like :","code":"df %>% replace_with_na_all(condition = ~.x == -99) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1 # write out all the offending strings na_strings <- c(\"NA\", \"N A\", \"N / A\", \"N/A\", \"N/ A\", \"Not Available\", \"NOt available\") df %>%   replace_with_na_all(condition = ~.x %in% na_strings) #> # A tibble: 5 × 4 #>   name           x y         z #>            #> 1 NA             1 NA     -100 #> 2 NA             3 NA      -99 #> 3 NA            NA 29      -98 #> 4 NA           -99 25     -101 #> 5 John Smith   -98 28       -1 common_na_numbers #> [1]    -9   -99  -999 -9999  9999    66    77    88 common_na_strings #>  [1] \"missing\" \"NA\"      \"N A\"     \"N/A\"     \"#N/A\"    \"NA \"     \" NA\"     #>  [8] \"N /A\"    \"N / A\"   \" N / A\"  \"N / A \"  \"na\"      \"n a\"     \"n/a\"     #> [15] \"na \"     \" na\"     \"n /a\"    \"n / a\"   \" a / a\"  \"n / a \"  \"NULL\"    #> [22] \"null\"    \"\"        \"\\\\?\"     \"\\\\*\"     \"\\\\.\" df %>%   replace_with_na_all(condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 NA                1 NA             -100 #> 2 NA                3 NOt available   -99 #> 3 NA               NA 29              -98 #> 4 Not Available   -99 25             -101 #> 5 John Smith      -98 28               -1"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"replace_with_na_at","dir":"Articles","previous_headings":"Example data > Using replace_with_na_all","what":"replace_with_na_at","title":"Replacing values with NA","text":"similar _all, instead case can specify variables want affected rule state. useful cases want specify rule affects selected number variables. Although can achieve regular replace_with_na(), concise use, replace_with_na_at(). Additionally, can specify rules function, example, make value NA exponent number less 1:","code":"df %>%    replace_with_na_at(.vars = c(\"x\",\"z\"),                      condition = ~.x == -99) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1 df %>%    replace_with_na_at(.vars = c(\"x\",\"z\"),                      condition = ~ exp(.x) < 1) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A              NA #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29               NA #> 4 Not Available    NA 25               NA #> 5 John Smith       NA 28               NA"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"replace_with_na_if","dir":"Articles","previous_headings":"Example data > Using replace_with_na_all","what":"replace_with_na_if","title":"Replacing values with NA","text":"may cases can identify variables based test - .character() - character variables? .numeric() - numeric double? given value inside type data. example, means able apply rule many variables meet pre-specified condition. can particular use many variables don’t want list , also know particular problem variables particular class.","code":"df %>%   replace_with_na_if(.predicate = is.character,                      condition = ~.x %in% (\"N/A\")) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 NA                1 NA             -100 #> 2 N A               3 NOt available   -99 #> 3 N / A            NA 29              -98 #> 4 Not Available   -99 25             -101 #> 5 John Smith      -98 28               -1  # or df %>%   replace_with_na_if(.predicate = is.character,                      condition = ~.x %in% (na_strings)) #> # A tibble: 5 × 4 #>   name           x y         z #>            #> 1 NA             1 NA     -100 #> 2 NA             3 NA      -99 #> 3 NA            NA 29      -98 #> 4 NA           -99 25     -101 #> 5 John Smith   -98 28       -1"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"notes-on-alternative-ways-to-handle-replacing-with-nas","dir":"Articles","previous_headings":"","what":"Notes on alternative ways to handle replacing with NAs","title":"Replacing values with NA","text":"alternative ways handle replacing values NA tidyverse, na_if using readr. ultimately expressive replace_with_na() functions, useful one kind value replace missing, know missing values upon reading data. dplyr::na_if function allows replace exact values - similar replace_with_na(), one single column data frame. use examples. Note, however, na_if() can take arguments length one. means capture statements like also handle complex equations, want refer values columns, values less greater another value. catch NAs readr reading data, can use na argument inside readr replace certain values NA. example: convert values na_strings missing values. useful use happen know NA types upon reading data. However, always practical data analysis pipeline.","code":"# instead of: df_1 <- df %>% replace_with_na_all(condition = ~.x == -99) df_1 #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1  df_2 <- df %>% dplyr::mutate(   x = dplyr::na_if(x, -99),   y = dplyr::na_if(z, -99) ) df_2 #> # A tibble: 5 × 4 #>   name              x     y     z #>               #> 1 N/A               1  -100  -100 #> 2 N A               3    NA   -99 #> 3 N / A            NA   -98   -98 #> 4 Not Available    NA  -101  -101 #> 5 John Smith      -98    -1    -1  # are they the same? all.equal(df_1, df_2) #> [1] \"Component \\\"y\\\": Modes: character, numeric\"                        #> [2] \"Component \\\"y\\\": target is character, current is numeric\"          #> [3] \"Component \\\"z\\\": 'is.NA' value mismatch: 0 in current 1 in target\" na_strings <- c(\"NA\", \"N A\", \"N / A\", \"N/A\", \"N/ A\", \"Not Available\", \"NOt available\") df_3 <- df %>% replace_with_na_all(condition = ~.x %in% na_strings) # Not run: df_4 <- df %>% dplyr::na_if(x = ., y = na_strings) # Error in check_length(y, x, fmt_args(\"y\"), glue(\"same as {fmt_args(~x)}\")) :    # argument \"y\" is missing, with no default # not run dat_raw <- readr::read_csv(\"original.csv\", na = na_strings)"},{"path":"http://naniar.njtierney.com/articles/special-missing-values.html","id":"terminology","dir":"Articles","previous_headings":"","what":"Terminology","title":"Special Missing Values","text":"Missing data can represented binary matrix “missing” “missing”, naniar call “shadow matrix”, term borrowed Swayne Buja, 1998. shadow matrix three key features facilitate analysis Coordinated names: Variables shadow matrix gain name data, suffix “_NA”. Special missing values: Values shadow matrix can “special” missing values, indicated NA_suffix, “suffix” short message type missings. Cohesiveness: Binding shadow matrix column-wise original data creates cohesive “nabular” data form, useful visualization summaries. create nabular data binding shadow data: keeps data values tied missingness, great benefits exploring missing imputed values data. See vignettes Getting Started naniar Exploring Imputations naniar details.","code":"library(naniar) as_shadow(oceanbuoys) #> # A tibble: 736 × 8 #>    year_NA latitude_NA longitude_NA sea_temp_c_NA air_temp_c_NA humidity_NA #>                                               #>  1 !NA     !NA         !NA          !NA           !NA           !NA         #>  2 !NA     !NA         !NA          !NA           !NA           !NA         #>  3 !NA     !NA         !NA          !NA           !NA           !NA         #>  4 !NA     !NA         !NA          !NA           !NA           !NA         #>  5 !NA     !NA         !NA          !NA           !NA           !NA         #>  6 !NA     !NA         !NA          !NA           !NA           !NA         #>  7 !NA     !NA         !NA          !NA           !NA           !NA         #>  8 !NA     !NA         !NA          !NA           !NA           !NA         #>  9 !NA     !NA         !NA          !NA           !NA           !NA         #> 10 !NA     !NA         !NA          !NA           !NA           !NA         #> # ℹ 726 more rows #> # ℹ 2 more variables: wind_ew_NA , wind_ns_NA  bind_shadow(oceanbuoys) #> # A tibble: 736 × 16 #>     year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                    #>  1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #>  2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #>  3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #>  4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #>  5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #>  6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60 #>  7  1997        0      -110       28.0       27.0     76.5   -2       3.5  #>  8  1997        0      -110       28.0       27.1     78.3   -3.70    4.5  #>  9  1997        0      -110       28.0       27.2     78.6   -4.20    5    #> 10  1997        0      -110       28.0       27.2     76.9   -3.60    3.5  #> # ℹ 726 more rows #> # ℹ 8 more variables: year_NA , latitude_NA , longitude_NA , #> #   sea_temp_c_NA , air_temp_c_NA , humidity_NA , #> #   wind_ew_NA , wind_ns_NA "},{"path":"http://naniar.njtierney.com/articles/special-missing-values.html","id":"recoding-missing-values","dir":"Articles","previous_headings":"","what":"Recoding missing values","title":"Special Missing Values","text":"demonstrate recoding missing values, use toy dataset, dat: recode value -99 missing value “broken_machine”, first create nabular data bind_shadow: Special types missingness encoded shadow part nabular data, using recode_shadow function, can recode missing values like : reads “recode shadow wind wind equal -99, give label”broken_machine”. .function used help make intent clearer, reads much like dplyr::case_when() function, takes care encoding extra factor levels missing data. extra types missingness recoded shadow part nabular data additional factor levels: additional types missingness recorded across shadow variables, even variables don’t contain special missing value. ensures flavours missingness known. summarise, use recode_shadow, user provides following information: variable want effect (recode_shadow(var = ...)) condition want implement (.(condition ~ ...)) suffix new type missing value (.(condition ~ suffix)) hood, special missing value recoded new factor level shadow matrix, every column aware possible new values missingness. examples using recode_shadow workflow discussed detail near future, moment, recommended workflow: Use recode_shadow() actual data Replacing previous actual values using replace_with_na() (see vignette replacing values NA) Explore missings special cases considered Explore imputed values, looking special cases","code":"df <- tibble::tribble( ~wind, ~temp, -99,    45, 68,    NA, 72,    25 )  df #> # A tibble: 3 × 2 #>    wind  temp #>     #> 1   -99    45 #> 2    68    NA #> 3    72    25 dfs <- bind_shadow(df)  dfs #> # A tibble: 3 × 4 #>    wind  temp wind_NA temp_NA #>           #> 1   -99    45 !NA     !NA     #> 2    68    NA !NA     NA      #> 3    72    25 !NA     !NA dfs_recode <- dfs %>%    recode_shadow(wind = .where(wind == -99 ~ \"broken_machine\")) levels(dfs_recode$wind_NA) #> [1] \"!NA\"               \"NA\"                \"NA_broken_machine\" levels(dfs_recode$temp_NA) #> [1] \"!NA\"               \"NA\"                \"NA_broken_machine\""},{"path":"http://naniar.njtierney.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nicholas Tierney. Author, maintainer. Di Cook. Author. Miles McBain. Author. Colin Fay. Author. Mitchell O'Hara-Wild. Contributor. Jim Hester. Contributor. Luke Smith. Contributor. Andrew Heiss. Contributor.","code":""},{"path":"http://naniar.njtierney.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tierney N, Cook D (2023). “Expanding Tidy Data Principles Facilitate Missing Data Exploration, Visualization Assessment Imputations.” Journal Statistical Software, 105(7), 1–31. doi:10.18637/jss.v105.i07.","code":"@Article{,   title = {Expanding Tidy Data Principles to Facilitate Missing Data Exploration, Visualization and Assessment of Imputations},   author = {Nicholas Tierney and Dianne Cook},   journal = {Journal of Statistical Software},   year = {2023},   volume = {105},   number = {7},   pages = {1--31},   doi = {10.18637/jss.v105.i07}, }"},{"path":"http://naniar.njtierney.com/index.html","id":"naniar-","dir":"","previous_headings":"","what":"Data Structures, Summaries, and Visualisations for Missing Data","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides principled, tidy ways summarise, visualise, manipulate missing data minimal deviations workflows ggplot2 tidy data. providing: bind_shadow() nabular() n_miss() n_complete() pct_miss()pct_complete() miss_var_summary() miss_var_table() miss_case_summary(), miss_case_table() mcar_test() Little’s (1988) missing completely random (MCAR) test geom_miss_point() gg_miss_var() gg_miss_case() gg_miss_fct() details workflow theory underpinning naniar, read vignette Getting started naniar. short primer data visualisation available naniar, read vignette Gallery Missing Data Visualisations. full details package, including","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"can install naniar CRAN: can install development version github using remotes:","code":"install.packages(\"naniar\") # install.packages(\"remotes\") remotes::install_github(\"njtierney/naniar\")"},{"path":"http://naniar.njtierney.com/index.html","id":"a-short-overview-of-naniar","dir":"","previous_headings":"","what":"A short overview of naniar","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Visualising missing data might sound little strange - visualise something ? One approach visualising missing data comes ggobi manet, replaces NA values values 10% lower minimum value variable. visualisation provided geom_miss_point() ggplot2 geom, illustrate exploring relationship Ozone Solar radiation airquality dataset.  ggplot2 handle missing values, get warning message missing values. can instead use geom_miss_point() display missing data  geom_miss_point() shifted missing values now 10% minimum value. missing values different colour missingness becomes pre-attentive. ggplot2 geom, supports features like faceting ggplot features.","code":"library(ggplot2)  ggplot(data = airquality,        aes(x = Ozone,            y = Solar.R)) +   geom_point() #> Warning: Removed 42 rows containing missing values or values outside the scale range #> (`geom_point()`). library(naniar)  ggplot(data = airquality,        aes(x = Ozone,            y = Solar.R)) +   geom_miss_point() p1 <- ggplot(data = airquality,        aes(x = Ozone,            y = Solar.R)) +    geom_miss_point() +    facet_wrap(~Month, ncol = 2) +    theme(legend.position = \"bottom\")  p1"},{"path":"http://naniar.njtierney.com/index.html","id":"data-structures","dir":"","previous_headings":"","what":"Data Structures","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides data structure working missing data, shadow matrix (Swayne Buja, 1998). shadow matrix dimension data, consists binary indicators missingness data values, missing represented “NA”, missing represented “!NA”, variable names kep , added suffix “_NA” variables. Binding shadow data data help keep better track missing values. format called “nabular”, portmanteau NA tabular. can bind shadow data using bind_shadow nabular: Using nabular format helps manage missing values dataset make easy visualisations split missingness:  even visualise imputations  perform upset plot - plot combinations missingness across cases, using gg_miss_upset function  naniar following consistent principles easy read, thanks tools tidyverse. naniar also provides handy visualations variable:  number missings given variable repeating span  can read visualisations naniar vignette Gallery missing data visualisations using naniar. naniar also provides handy helpers calculating number, proportion, percentage missing complete observations:","code":"head(airquality) #>   Ozone Solar.R Wind Temp Month Day #> 1    41     190  7.4   67     5   1 #> 2    36     118  8.0   72     5   2 #> 3    12     149 12.6   74     5   3 #> 4    18     313 11.5   62     5   4 #> 5    NA      NA 14.3   56     5   5 #> 6    28      NA 14.9   66     5   6  as_shadow(airquality) #> # A tibble: 153 × 6 #>    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA #>                          #>  1 !NA      !NA        !NA     !NA     !NA      !NA    #>  2 !NA      !NA        !NA     !NA     !NA      !NA    #>  3 !NA      !NA        !NA     !NA     !NA      !NA    #>  4 !NA      !NA        !NA     !NA     !NA      !NA    #>  5 NA       NA         !NA     !NA     !NA      !NA    #>  6 !NA      NA         !NA     !NA     !NA      !NA    #>  7 !NA      !NA        !NA     !NA     !NA      !NA    #>  8 !NA      !NA        !NA     !NA     !NA      !NA    #>  9 !NA      !NA        !NA     !NA     !NA      !NA    #> 10 NA       !NA        !NA     !NA     !NA      !NA    #> # ℹ 143 more rows bind_shadow(airquality) #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA  nabular(airquality) #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA  airquality %>%   bind_shadow() %>%   ggplot(aes(x = Temp,              fill = Ozone_NA)) +    geom_density(alpha = 0.5) airquality %>%   bind_shadow() %>%   as.data.frame() %>%     simputation::impute_lm(Ozone ~ Temp + Solar.R) %>%   ggplot(aes(x = Solar.R,              y = Ozone,              colour = Ozone_NA)) +    geom_point() #> Warning: Removed 7 rows containing missing values or values outside the scale range #> (`geom_point()`). gg_miss_upset(airquality) gg_miss_var(airquality) gg_miss_span(pedestrian,              var = hourly_counts,              span_every = 1500) n_miss(airquality) #> [1] 44 n_complete(airquality) #> [1] 874 prop_miss(airquality) #> [1] 0.04793028 prop_complete(airquality) #> [1] 0.9520697 pct_miss(airquality) #> [1] 4.793028 pct_complete(airquality) #> [1] 95.20697"},{"path":"http://naniar.njtierney.com/index.html","id":"numerical-summaries-for-missing-data","dir":"","previous_headings":"","what":"Numerical summaries for missing data","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides numerical summaries missing data, follow consistent rule uses syntax begining miss_. Summaries focussing variables single selected variable, start miss_var_, summaries cases (initial collected row order data), start miss_case_. functions return dataframes also work dplyr’s group_by(). example, can look number percent missings case variable miss_var_summary(), miss_case_summary(), return output ordered number missing values. also group_by() work number missings variable across levels within . can read functions vignette “Getting Started naniar”.","code":"miss_var_summary(airquality) #> # A tibble: 6 × 3 #>   variable n_miss pct_miss #>             #> 1 Ozone        37    24.2  #> 2 Solar.R       7     4.58 #> 3 Wind          0     0    #> 4 Temp          0     0    #> 5 Month         0     0    #> 6 Day           0     0 miss_case_summary(airquality) #> # A tibble: 153 × 3 #>     case n_miss pct_miss #>           #>  1     5      2     33.3 #>  2    27      2     33.3 #>  3     6      1     16.7 #>  4    10      1     16.7 #>  5    11      1     16.7 #>  6    25      1     16.7 #>  7    26      1     16.7 #>  8    32      1     16.7 #>  9    33      1     16.7 #> 10    34      1     16.7 #> # ℹ 143 more rows library(dplyr) #>  #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #>  #>     filter, lag #> The following objects are masked from 'package:base': #>  #>     intersect, setdiff, setequal, union airquality %>%   group_by(Month) %>%   miss_var_summary() #> # A tibble: 25 × 4 #> # Groups:   Month [5] #>    Month variable n_miss pct_miss #>               #>  1     5 Ozone         5     16.1 #>  2     5 Solar.R       4     12.9 #>  3     5 Wind          0      0   #>  4     5 Temp          0      0   #>  5     5 Day           0      0   #>  6     6 Ozone        21     70   #>  7     6 Solar.R       0      0   #>  8     6 Wind          0      0   #>  9     6 Temp          0      0   #> 10     6 Day           0      0   #> # ℹ 15 more rows"},{"path":"http://naniar.njtierney.com/index.html","id":"statistical-tests-of-missingness","dir":"","previous_headings":"","what":"Statistical tests of missingness","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides mcar_test() Little’s (1988) statistical test missing completely random (MCAR) data. null hypothesis test data MCAR, test statistic chi-squared value. Given high statistic value low p-value, can conclude airquality data missing completely random:","code":"mcar_test(airquality) #> # A tibble: 1 × 4 #>   statistic    df p.value missing.patterns #>                        #> 1      35.1    14 0.00142                4"},{"path":"http://naniar.njtierney.com/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"future-work","dir":"","previous_headings":"","what":"Future Work","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Extend geom_miss_* family include categorical variables, Bivariate plots: scatterplots, density overlays SQL translation databases Big Data tools (sparklyr, sparklingwater) Work well imputation engines / processes Provide tools assessing goodness fit classical approaches MCAR, MAR, MNAR (graphical inference nullabor package)","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Firstly, thanks Di Cook giving initial inspiration package laying rich theory literature work naniar built upon. Naming credit (!) goes Miles McBain. Among various things, Miles also worked overload missing data make work geom. Thanks also Colin Fay helping understand tidy evaluation features replace_to_na, miss_*_cumsum, .","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"a-note-on-the-name","dir":"","previous_headings":"","what":"A note on the name","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar previously named ggmissing initially provided ggplot geom visualisations. ggmissing changed naniar reflect fact package going bigger scope, just related ggplot2. Specifically, package designed provide suite tools generating visualisations missing values imputations, manipulate, summarise missing data. …naniar? Well, think useful think missing values data like dimension, perhaps like C.S. Lewis’s Narnia - different world, hidden away. go inside, sometimes seems like ’ve spent time time passed quickly, opposite. Also, NAniar = na r, desire, naniar may sound like “noneoya” nz/aussie accent. Full credit @MilesMcbain name, @Hadley rearranged spelling.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column describing presence of any missing values — add_any_miss","title":"Add a column describing presence of any missing values — add_any_miss","text":"adds column named \"any_miss\" (default) describes whether missings variables (default), whether specified columns, specified using variables names dplyr verbs, starts_with, contains, ends_with, etc. default added column called \"any_miss_all\", variables specified, otherwise, variables specified, label \"any_miss_vars\" indicate variables used create labels.","code":""},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column describing presence of any missing values — add_any_miss","text":"","code":"add_any_miss(   data,   ...,   label = \"any_miss\",   missing = \"missing\",   complete = \"complete\" )"},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column describing presence of any missing values — add_any_miss","text":"data data.frame ... Variable names use instead whole dataset. default looks whole dataset. Otherwise, one unquoted expressions separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. default add \"_all\" label left blank, otherwise add \"_vars\" distinguish used variables. label label column, defaults \"any_miss\". default additional variables listed label col \"any_miss_all\", otherwise \"any_miss_vars\", variables specified. missing character label values missing - defaults \"missing\" complete character character label values complete - defaults \"complete\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a column describing presence of any missing values — add_any_miss","text":"data.frame data column labelling whether row (variables) missing values - indicated \"missing\" \"complete\".","code":""},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a column describing presence of any missing values — add_any_miss","text":"default prefix \"any_miss\" used, can changed label argument.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column describing presence of any missing values — add_any_miss","text":"","code":"airquality %>% add_any_miss() #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_miss_all #>                    #>  1    41     190   7.4    67     5     1 complete     #>  2    36     118   8      72     5     2 complete     #>  3    12     149  12.6    74     5     3 complete     #>  4    18     313  11.5    62     5     4 complete     #>  5    NA      NA  14.3    56     5     5 missing      #>  6    28      NA  14.9    66     5     6 missing      #>  7    23     299   8.6    65     5     7 complete     #>  8    19      99  13.8    59     5     8 complete     #>  9     8      19  20.1    61     5     9 complete     #> 10    NA     194   8.6    69     5    10 missing      #> # ℹ 143 more rows airquality %>% add_any_miss(Ozone, Solar.R) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_miss_vars #>                     #>  1    41     190   7.4    67     5     1 complete      #>  2    36     118   8      72     5     2 complete      #>  3    12     149  12.6    74     5     3 complete      #>  4    18     313  11.5    62     5     4 complete      #>  5    NA      NA  14.3    56     5     5 missing       #>  6    28      NA  14.9    66     5     6 missing       #>  7    23     299   8.6    65     5     7 complete      #>  8    19      99  13.8    59     5     8 complete      #>  9     8      19  20.1    61     5     9 complete      #> 10    NA     194   8.6    69     5    10 missing       #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column describing if there are any missings in the dataset — add_label_missings","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"Add column describing missings dataset","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"","code":"add_label_missings(data, ..., missing = \"Missing\", complete = \"Not Missing\")"},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"data data.frame ... extra variable label missing character label values missing - defaults \"Missing\" complete character character label values complete - defaults \"Missing\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"data.frame column \"any_missing\" either \"Missing\" \"Missing\" purposes plotting / exploration / nice print methods","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"","code":"airquality %>% add_label_missings() #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_missing #>                   #>  1    41     190   7.4    67     5     1 Not Missing #>  2    36     118   8      72     5     2 Not Missing #>  3    12     149  12.6    74     5     3 Not Missing #>  4    18     313  11.5    62     5     4 Not Missing #>  5    NA      NA  14.3    56     5     5 Missing     #>  6    28      NA  14.9    66     5     6 Missing     #>  7    23     299   8.6    65     5     7 Not Missing #>  8    19      99  13.8    59     5     8 Not Missing #>  9     8      19  20.1    61     5     9 Not Missing #> 10    NA     194   8.6    69     5    10 Missing     #> # ℹ 143 more rows airquality %>% add_label_missings(Ozone, Solar.R) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_missing #>                   #>  1    41     190   7.4    67     5     1 Not Missing #>  2    36     118   8      72     5     2 Not Missing #>  3    12     149  12.6    74     5     3 Not Missing #>  4    18     313  11.5    62     5     4 Not Missing #>  5    NA      NA  14.3    56     5     5 Missing     #>  6    28      NA  14.9    66     5     6 Missing     #>  7    23     299   8.6    65     5     7 Not Missing #>  8    19      99  13.8    59     5     8 Not Missing #>  9     8      19  20.1    61     5     9 Not Missing #> 10    NA     194   8.6    69     5    10 Missing     #> # ℹ 143 more rows airquality %>% add_label_missings(Ozone, Solar.R, missing = \"yes\", complete = \"no\") #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_missing #>                   #>  1    41     190   7.4    67     5     1 no          #>  2    36     118   8      72     5     2 no          #>  3    12     149  12.6    74     5     3 no          #>  4    18     313  11.5    62     5     4 no          #>  5    NA      NA  14.3    56     5     5 yes         #>  6    28      NA  14.9    66     5     6 yes         #>  7    23     299   8.6    65     5     7 no          #>  8    19      99  13.8    59     5     8 no          #>  9     8      19  20.1    61     5     9 no          #> 10    NA     194   8.6    69     5    10 yes         #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column describing whether there is a shadow — add_label_shadow","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"Instead focussing labelling whether missings, instead focus whether shadows created. can useful data imputed need determine rows contained missing values shadow bound dataset.","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"","code":"add_label_shadow(data, ..., missing = \"Missing\", complete = \"Not Missing\")"},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"data data.frame ... extra variable label missing character label values missing - defaults \"Missing\" complete character character label values complete - defaults \"Missing\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"data.frame column, \"any_missing\", describes whether rows shadow value.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"","code":"airquality %>%   add_shadow(Ozone, Solar.R) %>%   add_label_shadow() #> # A tibble: 153 × 9 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA any_missing #>                             #>  1    41     190   7.4    67     5     1 !NA      !NA        Not Missing #>  2    36     118   8      72     5     2 !NA      !NA        Not Missing #>  3    12     149  12.6    74     5     3 !NA      !NA        Not Missing #>  4    18     313  11.5    62     5     4 !NA      !NA        Not Missing #>  5    NA      NA  14.3    56     5     5 NA       NA         Missing     #>  6    28      NA  14.9    66     5     6 !NA      NA         Missing     #>  7    23     299   8.6    65     5     7 !NA      !NA        Not Missing #>  8    19      99  13.8    59     5     8 !NA      !NA        Not Missing #>  9     8      19  20.1    61     5     9 !NA      !NA        Not Missing #> 10    NA     194   8.6    69     5    10 NA       !NA        Missing     #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column that tells us which ","title":"Add a column that tells us which ","text":"way extract cluster missingness group belongs . example, use vis_miss(airquality, cluster = TRUE), can see clustering data, way identify cluster. Future work incorporate seriation package allow better control clustering user.","code":""},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column that tells us which ","text":"","code":"add_miss_cluster(data, cluster_method = \"mcquitty\", n_clusters = 2)"},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column that tells us which ","text":"data dataframe cluster_method character vector agglomeration method use, default \"mcquitty\". Options taken stats::hclust helpfile, options include: \"ward.D\", \"ward.D2\", \"single\", \"complete\", \"average\" (= UPGMA), \"mcquitty\" (= WPGMA), \"median\" (= WPGMC) \"centroid\" (= UPGMC). n_clusters numeric number clusters expect. Defaults 2.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column that tells us which ","text":"","code":"add_miss_cluster(airquality) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day miss_cluster #>                    #>  1    41     190   7.4    67     5     1            1 #>  2    36     118   8      72     5     2            1 #>  3    12     149  12.6    74     5     3            1 #>  4    18     313  11.5    62     5     4            1 #>  5    NA      NA  14.3    56     5     5            2 #>  6    28      NA  14.9    66     5     6            1 #>  7    23     299   8.6    65     5     7            1 #>  8    19      99  13.8    59     5     8            1 #>  9     8      19  20.1    61     5     9            1 #> 10    NA     194   8.6    69     5    10            2 #> # ℹ 143 more rows add_miss_cluster(airquality, n_clusters = 3) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day miss_cluster #>                    #>  1    41     190   7.4    67     5     1            1 #>  2    36     118   8      72     5     2            1 #>  3    12     149  12.6    74     5     3            1 #>  4    18     313  11.5    62     5     4            1 #>  5    NA      NA  14.3    56     5     5            2 #>  6    28      NA  14.9    66     5     6            1 #>  7    23     299   8.6    65     5     7            1 #>  8    19      99  13.8    59     5     8            1 #>  9     8      19  20.1    61     5     9            1 #> 10    NA     194   8.6    69     5    10            3 #> # ℹ 143 more rows add_miss_cluster(airquality, cluster_method = \"ward.D\", n_clusters = 3) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day miss_cluster #>                    #>  1    41     190   7.4    67     5     1            1 #>  2    36     118   8      72     5     2            1 #>  3    12     149  12.6    74     5     3            1 #>  4    18     313  11.5    62     5     4            1 #>  5    NA      NA  14.3    56     5     5            2 #>  6    28      NA  14.9    66     5     6            2 #>  7    23     299   8.6    65     5     7            1 #>  8    19      99  13.8    59     5     8            1 #>  9     8      19  20.1    61     5     9            1 #> 10    NA     194   8.6    69     5    10            3 #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Add column containing number of missing data values — add_n_miss","title":"Add column containing number of missing data values — add_n_miss","text":"can useful data analysis add number missing data points dataframe. add_n_miss adds column named \"n_miss\", contains number missing values row.","code":""},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add column containing number of missing data values — add_n_miss","text":"","code":"add_n_miss(data, ..., label = \"n_miss\")"},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add column containing number of missing data values — add_n_miss","text":"data dataframe ... Variable names use instead whole dataset. default looks whole dataset. Otherwise, one unquoted expressions separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. default add \"_all\" label left blank, otherwise add \"_vars\" distinguish used variables. label character default \"n_miss\".","code":""},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add column containing number of missing data values — add_n_miss","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add column containing number of missing data values — add_n_miss","text":"","code":"airquality %>% add_n_miss() #>     Ozone Solar.R Wind Temp Month Day n_miss_all #> 1      41     190  7.4   67     5   1          0 #> 2      36     118  8.0   72     5   2          0 #> 3      12     149 12.6   74     5   3          0 #> 4      18     313 11.5   62     5   4          0 #> 5      NA      NA 14.3   56     5   5          2 #> 6      28      NA 14.9   66     5   6          1 #> 7      23     299  8.6   65     5   7          0 #> 8      19      99 13.8   59     5   8          0 #> 9       8      19 20.1   61     5   9          0 #> 10     NA     194  8.6   69     5  10          1 #> 11      7      NA  6.9   74     5  11          1 #> 12     16     256  9.7   69     5  12          0 #> 13     11     290  9.2   66     5  13          0 #> 14     14     274 10.9   68     5  14          0 #> 15     18      65 13.2   58     5  15          0 #> 16     14     334 11.5   64     5  16          0 #> 17     34     307 12.0   66     5  17          0 #> 18      6      78 18.4   57     5  18          0 #> 19     30     322 11.5   68     5  19          0 #> 20     11      44  9.7   62     5  20          0 #> 21      1       8  9.7   59     5  21          0 #> 22     11     320 16.6   73     5  22          0 #> 23      4      25  9.7   61     5  23          0 #> 24     32      92 12.0   61     5  24          0 #> 25     NA      66 16.6   57     5  25          1 #> 26     NA     266 14.9   58     5  26          1 #> 27     NA      NA  8.0   57     5  27          2 #> 28     23      13 12.0   67     5  28          0 #> 29     45     252 14.9   81     5  29          0 #> 30    115     223  5.7   79     5  30          0 #> 31     37     279  7.4   76     5  31          0 #> 32     NA     286  8.6   78     6   1          1 #> 33     NA     287  9.7   74     6   2          1 #> 34     NA     242 16.1   67     6   3          1 #> 35     NA     186  9.2   84     6   4          1 #> 36     NA     220  8.6   85     6   5          1 #> 37     NA     264 14.3   79     6   6          1 #> 38     29     127  9.7   82     6   7          0 #> 39     NA     273  6.9   87     6   8          1 #> 40     71     291 13.8   90     6   9          0 #> 41     39     323 11.5   87     6  10          0 #> 42     NA     259 10.9   93     6  11          1 #> 43     NA     250  9.2   92     6  12          1 #> 44     23     148  8.0   82     6  13          0 #> 45     NA     332 13.8   80     6  14          1 #> 46     NA     322 11.5   79     6  15          1 #> 47     21     191 14.9   77     6  16          0 #> 48     37     284 20.7   72     6  17          0 #> 49     20      37  9.2   65     6  18          0 #> 50     12     120 11.5   73     6  19          0 #> 51     13     137 10.3   76     6  20          0 #> 52     NA     150  6.3   77     6  21          1 #> 53     NA      59  1.7   76     6  22          1 #> 54     NA      91  4.6   76     6  23          1 #> 55     NA     250  6.3   76     6  24          1 #> 56     NA     135  8.0   75     6  25          1 #> 57     NA     127  8.0   78     6  26          1 #> 58     NA      47 10.3   73     6  27          1 #> 59     NA      98 11.5   80     6  28          1 #> 60     NA      31 14.9   77     6  29          1 #> 61     NA     138  8.0   83     6  30          1 #> 62    135     269  4.1   84     7   1          0 #> 63     49     248  9.2   85     7   2          0 #> 64     32     236  9.2   81     7   3          0 #> 65     NA     101 10.9   84     7   4          1 #> 66     64     175  4.6   83     7   5          0 #> 67     40     314 10.9   83     7   6          0 #> 68     77     276  5.1   88     7   7          0 #> 69     97     267  6.3   92     7   8          0 #> 70     97     272  5.7   92     7   9          0 #> 71     85     175  7.4   89     7  10          0 #> 72     NA     139  8.6   82     7  11          1 #> 73     10     264 14.3   73     7  12          0 #> 74     27     175 14.9   81     7  13          0 #> 75     NA     291 14.9   91     7  14          1 #> 76      7      48 14.3   80     7  15          0 #> 77     48     260  6.9   81     7  16          0 #> 78     35     274 10.3   82     7  17          0 #> 79     61     285  6.3   84     7  18          0 #> 80     79     187  5.1   87     7  19          0 #> 81     63     220 11.5   85     7  20          0 #> 82     16       7  6.9   74     7  21          0 #> 83     NA     258  9.7   81     7  22          1 #> 84     NA     295 11.5   82     7  23          1 #> 85     80     294  8.6   86     7  24          0 #> 86    108     223  8.0   85     7  25          0 #> 87     20      81  8.6   82     7  26          0 #> 88     52      82 12.0   86     7  27          0 #> 89     82     213  7.4   88     7  28          0 #> 90     50     275  7.4   86     7  29          0 #> 91     64     253  7.4   83     7  30          0 #> 92     59     254  9.2   81     7  31          0 #> 93     39      83  6.9   81     8   1          0 #> 94      9      24 13.8   81     8   2          0 #> 95     16      77  7.4   82     8   3          0 #> 96     78      NA  6.9   86     8   4          1 #> 97     35      NA  7.4   85     8   5          1 #> 98     66      NA  4.6   87     8   6          1 #> 99    122     255  4.0   89     8   7          0 #> 100    89     229 10.3   90     8   8          0 #> 101   110     207  8.0   90     8   9          0 #> 102    NA     222  8.6   92     8  10          1 #> 103    NA     137 11.5   86     8  11          1 #> 104    44     192 11.5   86     8  12          0 #> 105    28     273 11.5   82     8  13          0 #> 106    65     157  9.7   80     8  14          0 #> 107    NA      64 11.5   79     8  15          1 #> 108    22      71 10.3   77     8  16          0 #> 109    59      51  6.3   79     8  17          0 #> 110    23     115  7.4   76     8  18          0 #> 111    31     244 10.9   78     8  19          0 #> 112    44     190 10.3   78     8  20          0 #> 113    21     259 15.5   77     8  21          0 #> 114     9      36 14.3   72     8  22          0 #> 115    NA     255 12.6   75     8  23          1 #> 116    45     212  9.7   79     8  24          0 #> 117   168     238  3.4   81     8  25          0 #> 118    73     215  8.0   86     8  26          0 #> 119    NA     153  5.7   88     8  27          1 #> 120    76     203  9.7   97     8  28          0 #> 121   118     225  2.3   94     8  29          0 #> 122    84     237  6.3   96     8  30          0 #> 123    85     188  6.3   94     8  31          0 #> 124    96     167  6.9   91     9   1          0 #> 125    78     197  5.1   92     9   2          0 #> 126    73     183  2.8   93     9   3          0 #> 127    91     189  4.6   93     9   4          0 #> 128    47      95  7.4   87     9   5          0 #> 129    32      92 15.5   84     9   6          0 #> 130    20     252 10.9   80     9   7          0 #> 131    23     220 10.3   78     9   8          0 #> 132    21     230 10.9   75     9   9          0 #> 133    24     259  9.7   73     9  10          0 #> 134    44     236 14.9   81     9  11          0 #> 135    21     259 15.5   76     9  12          0 #> 136    28     238  6.3   77     9  13          0 #> 137     9      24 10.9   71     9  14          0 #> 138    13     112 11.5   71     9  15          0 #> 139    46     237  6.9   78     9  16          0 #> 140    18     224 13.8   67     9  17          0 #> 141    13      27 10.3   76     9  18          0 #> 142    24     238 10.3   68     9  19          0 #> 143    16     201  8.0   82     9  20          0 #> 144    13     238 12.6   64     9  21          0 #> 145    23      14  9.2   71     9  22          0 #> 146    36     139 10.3   81     9  23          0 #> 147     7      49 10.3   69     9  24          0 #> 148    14      20 16.6   63     9  25          0 #> 149    30     193  6.9   70     9  26          0 #> 150    NA     145 13.2   77     9  27          1 #> 151    14     191 14.3   75     9  28          0 #> 152    18     131  8.0   76     9  29          0 #> 153    20     223 11.5   68     9  30          0 airquality %>% add_n_miss(Ozone, Solar.R) #>     Ozone Solar.R Wind Temp Month Day n_miss_vars #> 1      41     190  7.4   67     5   1           0 #> 2      36     118  8.0   72     5   2           0 #> 3      12     149 12.6   74     5   3           0 #> 4      18     313 11.5   62     5   4           0 #> 5      NA      NA 14.3   56     5   5           2 #> 6      28      NA 14.9   66     5   6           1 #> 7      23     299  8.6   65     5   7           0 #> 8      19      99 13.8   59     5   8           0 #> 9       8      19 20.1   61     5   9           0 #> 10     NA     194  8.6   69     5  10           1 #> 11      7      NA  6.9   74     5  11           1 #> 12     16     256  9.7   69     5  12           0 #> 13     11     290  9.2   66     5  13           0 #> 14     14     274 10.9   68     5  14           0 #> 15     18      65 13.2   58     5  15           0 #> 16     14     334 11.5   64     5  16           0 #> 17     34     307 12.0   66     5  17           0 #> 18      6      78 18.4   57     5  18           0 #> 19     30     322 11.5   68     5  19           0 #> 20     11      44  9.7   62     5  20           0 #> 21      1       8  9.7   59     5  21           0 #> 22     11     320 16.6   73     5  22           0 #> 23      4      25  9.7   61     5  23           0 #> 24     32      92 12.0   61     5  24           0 #> 25     NA      66 16.6   57     5  25           1 #> 26     NA     266 14.9   58     5  26           1 #> 27     NA      NA  8.0   57     5  27           2 #> 28     23      13 12.0   67     5  28           0 #> 29     45     252 14.9   81     5  29           0 #> 30    115     223  5.7   79     5  30           0 #> 31     37     279  7.4   76     5  31           0 #> 32     NA     286  8.6   78     6   1           1 #> 33     NA     287  9.7   74     6   2           1 #> 34     NA     242 16.1   67     6   3           1 #> 35     NA     186  9.2   84     6   4           1 #> 36     NA     220  8.6   85     6   5           1 #> 37     NA     264 14.3   79     6   6           1 #> 38     29     127  9.7   82     6   7           0 #> 39     NA     273  6.9   87     6   8           1 #> 40     71     291 13.8   90     6   9           0 #> 41     39     323 11.5   87     6  10           0 #> 42     NA     259 10.9   93     6  11           1 #> 43     NA     250  9.2   92     6  12           1 #> 44     23     148  8.0   82     6  13           0 #> 45     NA     332 13.8   80     6  14           1 #> 46     NA     322 11.5   79     6  15           1 #> 47     21     191 14.9   77     6  16           0 #> 48     37     284 20.7   72     6  17           0 #> 49     20      37  9.2   65     6  18           0 #> 50     12     120 11.5   73     6  19           0 #> 51     13     137 10.3   76     6  20           0 #> 52     NA     150  6.3   77     6  21           1 #> 53     NA      59  1.7   76     6  22           1 #> 54     NA      91  4.6   76     6  23           1 #> 55     NA     250  6.3   76     6  24           1 #> 56     NA     135  8.0   75     6  25           1 #> 57     NA     127  8.0   78     6  26           1 #> 58     NA      47 10.3   73     6  27           1 #> 59     NA      98 11.5   80     6  28           1 #> 60     NA      31 14.9   77     6  29           1 #> 61     NA     138  8.0   83     6  30           1 #> 62    135     269  4.1   84     7   1           0 #> 63     49     248  9.2   85     7   2           0 #> 64     32     236  9.2   81     7   3           0 #> 65     NA     101 10.9   84     7   4           1 #> 66     64     175  4.6   83     7   5           0 #> 67     40     314 10.9   83     7   6           0 #> 68     77     276  5.1   88     7   7           0 #> 69     97     267  6.3   92     7   8           0 #> 70     97     272  5.7   92     7   9           0 #> 71     85     175  7.4   89     7  10           0 #> 72     NA     139  8.6   82     7  11           1 #> 73     10     264 14.3   73     7  12           0 #> 74     27     175 14.9   81     7  13           0 #> 75     NA     291 14.9   91     7  14           1 #> 76      7      48 14.3   80     7  15           0 #> 77     48     260  6.9   81     7  16           0 #> 78     35     274 10.3   82     7  17           0 #> 79     61     285  6.3   84     7  18           0 #> 80     79     187  5.1   87     7  19           0 #> 81     63     220 11.5   85     7  20           0 #> 82     16       7  6.9   74     7  21           0 #> 83     NA     258  9.7   81     7  22           1 #> 84     NA     295 11.5   82     7  23           1 #> 85     80     294  8.6   86     7  24           0 #> 86    108     223  8.0   85     7  25           0 #> 87     20      81  8.6   82     7  26           0 #> 88     52      82 12.0   86     7  27           0 #> 89     82     213  7.4   88     7  28           0 #> 90     50     275  7.4   86     7  29           0 #> 91     64     253  7.4   83     7  30           0 #> 92     59     254  9.2   81     7  31           0 #> 93     39      83  6.9   81     8   1           0 #> 94      9      24 13.8   81     8   2           0 #> 95     16      77  7.4   82     8   3           0 #> 96     78      NA  6.9   86     8   4           1 #> 97     35      NA  7.4   85     8   5           1 #> 98     66      NA  4.6   87     8   6           1 #> 99    122     255  4.0   89     8   7           0 #> 100    89     229 10.3   90     8   8           0 #> 101   110     207  8.0   90     8   9           0 #> 102    NA     222  8.6   92     8  10           1 #> 103    NA     137 11.5   86     8  11           1 #> 104    44     192 11.5   86     8  12           0 #> 105    28     273 11.5   82     8  13           0 #> 106    65     157  9.7   80     8  14           0 #> 107    NA      64 11.5   79     8  15           1 #> 108    22      71 10.3   77     8  16           0 #> 109    59      51  6.3   79     8  17           0 #> 110    23     115  7.4   76     8  18           0 #> 111    31     244 10.9   78     8  19           0 #> 112    44     190 10.3   78     8  20           0 #> 113    21     259 15.5   77     8  21           0 #> 114     9      36 14.3   72     8  22           0 #> 115    NA     255 12.6   75     8  23           1 #> 116    45     212  9.7   79     8  24           0 #> 117   168     238  3.4   81     8  25           0 #> 118    73     215  8.0   86     8  26           0 #> 119    NA     153  5.7   88     8  27           1 #> 120    76     203  9.7   97     8  28           0 #> 121   118     225  2.3   94     8  29           0 #> 122    84     237  6.3   96     8  30           0 #> 123    85     188  6.3   94     8  31           0 #> 124    96     167  6.9   91     9   1           0 #> 125    78     197  5.1   92     9   2           0 #> 126    73     183  2.8   93     9   3           0 #> 127    91     189  4.6   93     9   4           0 #> 128    47      95  7.4   87     9   5           0 #> 129    32      92 15.5   84     9   6           0 #> 130    20     252 10.9   80     9   7           0 #> 131    23     220 10.3   78     9   8           0 #> 132    21     230 10.9   75     9   9           0 #> 133    24     259  9.7   73     9  10           0 #> 134    44     236 14.9   81     9  11           0 #> 135    21     259 15.5   76     9  12           0 #> 136    28     238  6.3   77     9  13           0 #> 137     9      24 10.9   71     9  14           0 #> 138    13     112 11.5   71     9  15           0 #> 139    46     237  6.9   78     9  16           0 #> 140    18     224 13.8   67     9  17           0 #> 141    13      27 10.3   76     9  18           0 #> 142    24     238 10.3   68     9  19           0 #> 143    16     201  8.0   82     9  20           0 #> 144    13     238 12.6   64     9  21           0 #> 145    23      14  9.2   71     9  22           0 #> 146    36     139 10.3   81     9  23           0 #> 147     7      49 10.3   69     9  24           0 #> 148    14      20 16.6   63     9  25           0 #> 149    30     193  6.9   70     9  26           0 #> 150    NA     145 13.2   77     9  27           1 #> 151    14     191 14.3   75     9  28           0 #> 152    18     131  8.0   76     9  29           0 #> 153    20     223 11.5   68     9  30           0 airquality %>% add_n_miss(dplyr::contains(\"o\")) #>     Ozone Solar.R Wind Temp Month Day n_miss_vars #> 1      41     190  7.4   67     5   1           0 #> 2      36     118  8.0   72     5   2           0 #> 3      12     149 12.6   74     5   3           0 #> 4      18     313 11.5   62     5   4           0 #> 5      NA      NA 14.3   56     5   5           2 #> 6      28      NA 14.9   66     5   6           1 #> 7      23     299  8.6   65     5   7           0 #> 8      19      99 13.8   59     5   8           0 #> 9       8      19 20.1   61     5   9           0 #> 10     NA     194  8.6   69     5  10           1 #> 11      7      NA  6.9   74     5  11           1 #> 12     16     256  9.7   69     5  12           0 #> 13     11     290  9.2   66     5  13           0 #> 14     14     274 10.9   68     5  14           0 #> 15     18      65 13.2   58     5  15           0 #> 16     14     334 11.5   64     5  16           0 #> 17     34     307 12.0   66     5  17           0 #> 18      6      78 18.4   57     5  18           0 #> 19     30     322 11.5   68     5  19           0 #> 20     11      44  9.7   62     5  20           0 #> 21      1       8  9.7   59     5  21           0 #> 22     11     320 16.6   73     5  22           0 #> 23      4      25  9.7   61     5  23           0 #> 24     32      92 12.0   61     5  24           0 #> 25     NA      66 16.6   57     5  25           1 #> 26     NA     266 14.9   58     5  26           1 #> 27     NA      NA  8.0   57     5  27           2 #> 28     23      13 12.0   67     5  28           0 #> 29     45     252 14.9   81     5  29           0 #> 30    115     223  5.7   79     5  30           0 #> 31     37     279  7.4   76     5  31           0 #> 32     NA     286  8.6   78     6   1           1 #> 33     NA     287  9.7   74     6   2           1 #> 34     NA     242 16.1   67     6   3           1 #> 35     NA     186  9.2   84     6   4           1 #> 36     NA     220  8.6   85     6   5           1 #> 37     NA     264 14.3   79     6   6           1 #> 38     29     127  9.7   82     6   7           0 #> 39     NA     273  6.9   87     6   8           1 #> 40     71     291 13.8   90     6   9           0 #> 41     39     323 11.5   87     6  10           0 #> 42     NA     259 10.9   93     6  11           1 #> 43     NA     250  9.2   92     6  12           1 #> 44     23     148  8.0   82     6  13           0 #> 45     NA     332 13.8   80     6  14           1 #> 46     NA     322 11.5   79     6  15           1 #> 47     21     191 14.9   77     6  16           0 #> 48     37     284 20.7   72     6  17           0 #> 49     20      37  9.2   65     6  18           0 #> 50     12     120 11.5   73     6  19           0 #> 51     13     137 10.3   76     6  20           0 #> 52     NA     150  6.3   77     6  21           1 #> 53     NA      59  1.7   76     6  22           1 #> 54     NA      91  4.6   76     6  23           1 #> 55     NA     250  6.3   76     6  24           1 #> 56     NA     135  8.0   75     6  25           1 #> 57     NA     127  8.0   78     6  26           1 #> 58     NA      47 10.3   73     6  27           1 #> 59     NA      98 11.5   80     6  28           1 #> 60     NA      31 14.9   77     6  29           1 #> 61     NA     138  8.0   83     6  30           1 #> 62    135     269  4.1   84     7   1           0 #> 63     49     248  9.2   85     7   2           0 #> 64     32     236  9.2   81     7   3           0 #> 65     NA     101 10.9   84     7   4           1 #> 66     64     175  4.6   83     7   5           0 #> 67     40     314 10.9   83     7   6           0 #> 68     77     276  5.1   88     7   7           0 #> 69     97     267  6.3   92     7   8           0 #> 70     97     272  5.7   92     7   9           0 #> 71     85     175  7.4   89     7  10           0 #> 72     NA     139  8.6   82     7  11           1 #> 73     10     264 14.3   73     7  12           0 #> 74     27     175 14.9   81     7  13           0 #> 75     NA     291 14.9   91     7  14           1 #> 76      7      48 14.3   80     7  15           0 #> 77     48     260  6.9   81     7  16           0 #> 78     35     274 10.3   82     7  17           0 #> 79     61     285  6.3   84     7  18           0 #> 80     79     187  5.1   87     7  19           0 #> 81     63     220 11.5   85     7  20           0 #> 82     16       7  6.9   74     7  21           0 #> 83     NA     258  9.7   81     7  22           1 #> 84     NA     295 11.5   82     7  23           1 #> 85     80     294  8.6   86     7  24           0 #> 86    108     223  8.0   85     7  25           0 #> 87     20      81  8.6   82     7  26           0 #> 88     52      82 12.0   86     7  27           0 #> 89     82     213  7.4   88     7  28           0 #> 90     50     275  7.4   86     7  29           0 #> 91     64     253  7.4   83     7  30           0 #> 92     59     254  9.2   81     7  31           0 #> 93     39      83  6.9   81     8   1           0 #> 94      9      24 13.8   81     8   2           0 #> 95     16      77  7.4   82     8   3           0 #> 96     78      NA  6.9   86     8   4           1 #> 97     35      NA  7.4   85     8   5           1 #> 98     66      NA  4.6   87     8   6           1 #> 99    122     255  4.0   89     8   7           0 #> 100    89     229 10.3   90     8   8           0 #> 101   110     207  8.0   90     8   9           0 #> 102    NA     222  8.6   92     8  10           1 #> 103    NA     137 11.5   86     8  11           1 #> 104    44     192 11.5   86     8  12           0 #> 105    28     273 11.5   82     8  13           0 #> 106    65     157  9.7   80     8  14           0 #> 107    NA      64 11.5   79     8  15           1 #> 108    22      71 10.3   77     8  16           0 #> 109    59      51  6.3   79     8  17           0 #> 110    23     115  7.4   76     8  18           0 #> 111    31     244 10.9   78     8  19           0 #> 112    44     190 10.3   78     8  20           0 #> 113    21     259 15.5   77     8  21           0 #> 114     9      36 14.3   72     8  22           0 #> 115    NA     255 12.6   75     8  23           1 #> 116    45     212  9.7   79     8  24           0 #> 117   168     238  3.4   81     8  25           0 #> 118    73     215  8.0   86     8  26           0 #> 119    NA     153  5.7   88     8  27           1 #> 120    76     203  9.7   97     8  28           0 #> 121   118     225  2.3   94     8  29           0 #> 122    84     237  6.3   96     8  30           0 #> 123    85     188  6.3   94     8  31           0 #> 124    96     167  6.9   91     9   1           0 #> 125    78     197  5.1   92     9   2           0 #> 126    73     183  2.8   93     9   3           0 #> 127    91     189  4.6   93     9   4           0 #> 128    47      95  7.4   87     9   5           0 #> 129    32      92 15.5   84     9   6           0 #> 130    20     252 10.9   80     9   7           0 #> 131    23     220 10.3   78     9   8           0 #> 132    21     230 10.9   75     9   9           0 #> 133    24     259  9.7   73     9  10           0 #> 134    44     236 14.9   81     9  11           0 #> 135    21     259 15.5   76     9  12           0 #> 136    28     238  6.3   77     9  13           0 #> 137     9      24 10.9   71     9  14           0 #> 138    13     112 11.5   71     9  15           0 #> 139    46     237  6.9   78     9  16           0 #> 140    18     224 13.8   67     9  17           0 #> 141    13      27 10.3   76     9  18           0 #> 142    24     238 10.3   68     9  19           0 #> 143    16     201  8.0   82     9  20           0 #> 144    13     238 12.6   64     9  21           0 #> 145    23      14  9.2   71     9  22           0 #> 146    36     139 10.3   81     9  23           0 #> 147     7      49 10.3   69     9  24           0 #> 148    14      20 16.6   63     9  25           0 #> 149    30     193  6.9   70     9  26           0 #> 150    NA     145 13.2   77     9  27           1 #> 151    14     191 14.3   75     9  28           0 #> 152    18     131  8.0   76     9  29           0 #> 153    20     223 11.5   68     9  30           0"},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Add column containing proportion of missing data values — add_prop_miss","title":"Add column containing proportion of missing data values — add_prop_miss","text":"can useful data analysis add proportion missing data values dataframe. add_prop_miss adds column named \"prop_miss\", contains proportion missing values row. can specify variables like show missingness .","code":""},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add column containing proportion of missing data values — add_prop_miss","text":"","code":"add_prop_miss(data, ..., label = \"prop_miss\")"},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add column containing proportion of missing data values — add_prop_miss","text":"data dataframe ... Variable names use instead whole dataset. default looks whole dataset. Otherwise, one unquoted expressions separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. default add \"_all\" label left blank, otherwise add \"_vars\" distinguish used variables. label character string need name variable","code":""},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add column containing proportion of missing data values — add_prop_miss","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add column containing proportion of missing data values — add_prop_miss","text":"","code":"airquality %>% add_prop_miss() #>     Ozone Solar.R Wind Temp Month Day prop_miss_all #> 1      41     190  7.4   67     5   1     0.0000000 #> 2      36     118  8.0   72     5   2     0.0000000 #> 3      12     149 12.6   74     5   3     0.0000000 #> 4      18     313 11.5   62     5   4     0.0000000 #> 5      NA      NA 14.3   56     5   5     0.3333333 #> 6      28      NA 14.9   66     5   6     0.1666667 #> 7      23     299  8.6   65     5   7     0.0000000 #> 8      19      99 13.8   59     5   8     0.0000000 #> 9       8      19 20.1   61     5   9     0.0000000 #> 10     NA     194  8.6   69     5  10     0.1666667 #> 11      7      NA  6.9   74     5  11     0.1666667 #> 12     16     256  9.7   69     5  12     0.0000000 #> 13     11     290  9.2   66     5  13     0.0000000 #> 14     14     274 10.9   68     5  14     0.0000000 #> 15     18      65 13.2   58     5  15     0.0000000 #> 16     14     334 11.5   64     5  16     0.0000000 #> 17     34     307 12.0   66     5  17     0.0000000 #> 18      6      78 18.4   57     5  18     0.0000000 #> 19     30     322 11.5   68     5  19     0.0000000 #> 20     11      44  9.7   62     5  20     0.0000000 #> 21      1       8  9.7   59     5  21     0.0000000 #> 22     11     320 16.6   73     5  22     0.0000000 #> 23      4      25  9.7   61     5  23     0.0000000 #> 24     32      92 12.0   61     5  24     0.0000000 #> 25     NA      66 16.6   57     5  25     0.1666667 #> 26     NA     266 14.9   58     5  26     0.1666667 #> 27     NA      NA  8.0   57     5  27     0.3333333 #> 28     23      13 12.0   67     5  28     0.0000000 #> 29     45     252 14.9   81     5  29     0.0000000 #> 30    115     223  5.7   79     5  30     0.0000000 #> 31     37     279  7.4   76     5  31     0.0000000 #> 32     NA     286  8.6   78     6   1     0.1666667 #> 33     NA     287  9.7   74     6   2     0.1666667 #> 34     NA     242 16.1   67     6   3     0.1666667 #> 35     NA     186  9.2   84     6   4     0.1666667 #> 36     NA     220  8.6   85     6   5     0.1666667 #> 37     NA     264 14.3   79     6   6     0.1666667 #> 38     29     127  9.7   82     6   7     0.0000000 #> 39     NA     273  6.9   87     6   8     0.1666667 #> 40     71     291 13.8   90     6   9     0.0000000 #> 41     39     323 11.5   87     6  10     0.0000000 #> 42     NA     259 10.9   93     6  11     0.1666667 #> 43     NA     250  9.2   92     6  12     0.1666667 #> 44     23     148  8.0   82     6  13     0.0000000 #> 45     NA     332 13.8   80     6  14     0.1666667 #> 46     NA     322 11.5   79     6  15     0.1666667 #> 47     21     191 14.9   77     6  16     0.0000000 #> 48     37     284 20.7   72     6  17     0.0000000 #> 49     20      37  9.2   65     6  18     0.0000000 #> 50     12     120 11.5   73     6  19     0.0000000 #> 51     13     137 10.3   76     6  20     0.0000000 #> 52     NA     150  6.3   77     6  21     0.1666667 #> 53     NA      59  1.7   76     6  22     0.1666667 #> 54     NA      91  4.6   76     6  23     0.1666667 #> 55     NA     250  6.3   76     6  24     0.1666667 #> 56     NA     135  8.0   75     6  25     0.1666667 #> 57     NA     127  8.0   78     6  26     0.1666667 #> 58     NA      47 10.3   73     6  27     0.1666667 #> 59     NA      98 11.5   80     6  28     0.1666667 #> 60     NA      31 14.9   77     6  29     0.1666667 #> 61     NA     138  8.0   83     6  30     0.1666667 #> 62    135     269  4.1   84     7   1     0.0000000 #> 63     49     248  9.2   85     7   2     0.0000000 #> 64     32     236  9.2   81     7   3     0.0000000 #> 65     NA     101 10.9   84     7   4     0.1666667 #> 66     64     175  4.6   83     7   5     0.0000000 #> 67     40     314 10.9   83     7   6     0.0000000 #> 68     77     276  5.1   88     7   7     0.0000000 #> 69     97     267  6.3   92     7   8     0.0000000 #> 70     97     272  5.7   92     7   9     0.0000000 #> 71     85     175  7.4   89     7  10     0.0000000 #> 72     NA     139  8.6   82     7  11     0.1666667 #> 73     10     264 14.3   73     7  12     0.0000000 #> 74     27     175 14.9   81     7  13     0.0000000 #> 75     NA     291 14.9   91     7  14     0.1666667 #> 76      7      48 14.3   80     7  15     0.0000000 #> 77     48     260  6.9   81     7  16     0.0000000 #> 78     35     274 10.3   82     7  17     0.0000000 #> 79     61     285  6.3   84     7  18     0.0000000 #> 80     79     187  5.1   87     7  19     0.0000000 #> 81     63     220 11.5   85     7  20     0.0000000 #> 82     16       7  6.9   74     7  21     0.0000000 #> 83     NA     258  9.7   81     7  22     0.1666667 #> 84     NA     295 11.5   82     7  23     0.1666667 #> 85     80     294  8.6   86     7  24     0.0000000 #> 86    108     223  8.0   85     7  25     0.0000000 #> 87     20      81  8.6   82     7  26     0.0000000 #> 88     52      82 12.0   86     7  27     0.0000000 #> 89     82     213  7.4   88     7  28     0.0000000 #> 90     50     275  7.4   86     7  29     0.0000000 #> 91     64     253  7.4   83     7  30     0.0000000 #> 92     59     254  9.2   81     7  31     0.0000000 #> 93     39      83  6.9   81     8   1     0.0000000 #> 94      9      24 13.8   81     8   2     0.0000000 #> 95     16      77  7.4   82     8   3     0.0000000 #> 96     78      NA  6.9   86     8   4     0.1666667 #> 97     35      NA  7.4   85     8   5     0.1666667 #> 98     66      NA  4.6   87     8   6     0.1666667 #> 99    122     255  4.0   89     8   7     0.0000000 #> 100    89     229 10.3   90     8   8     0.0000000 #> 101   110     207  8.0   90     8   9     0.0000000 #> 102    NA     222  8.6   92     8  10     0.1666667 #> 103    NA     137 11.5   86     8  11     0.1666667 #> 104    44     192 11.5   86     8  12     0.0000000 #> 105    28     273 11.5   82     8  13     0.0000000 #> 106    65     157  9.7   80     8  14     0.0000000 #> 107    NA      64 11.5   79     8  15     0.1666667 #> 108    22      71 10.3   77     8  16     0.0000000 #> 109    59      51  6.3   79     8  17     0.0000000 #> 110    23     115  7.4   76     8  18     0.0000000 #> 111    31     244 10.9   78     8  19     0.0000000 #> 112    44     190 10.3   78     8  20     0.0000000 #> 113    21     259 15.5   77     8  21     0.0000000 #> 114     9      36 14.3   72     8  22     0.0000000 #> 115    NA     255 12.6   75     8  23     0.1666667 #> 116    45     212  9.7   79     8  24     0.0000000 #> 117   168     238  3.4   81     8  25     0.0000000 #> 118    73     215  8.0   86     8  26     0.0000000 #> 119    NA     153  5.7   88     8  27     0.1666667 #> 120    76     203  9.7   97     8  28     0.0000000 #> 121   118     225  2.3   94     8  29     0.0000000 #> 122    84     237  6.3   96     8  30     0.0000000 #> 123    85     188  6.3   94     8  31     0.0000000 #> 124    96     167  6.9   91     9   1     0.0000000 #> 125    78     197  5.1   92     9   2     0.0000000 #> 126    73     183  2.8   93     9   3     0.0000000 #> 127    91     189  4.6   93     9   4     0.0000000 #> 128    47      95  7.4   87     9   5     0.0000000 #> 129    32      92 15.5   84     9   6     0.0000000 #> 130    20     252 10.9   80     9   7     0.0000000 #> 131    23     220 10.3   78     9   8     0.0000000 #> 132    21     230 10.9   75     9   9     0.0000000 #> 133    24     259  9.7   73     9  10     0.0000000 #> 134    44     236 14.9   81     9  11     0.0000000 #> 135    21     259 15.5   76     9  12     0.0000000 #> 136    28     238  6.3   77     9  13     0.0000000 #> 137     9      24 10.9   71     9  14     0.0000000 #> 138    13     112 11.5   71     9  15     0.0000000 #> 139    46     237  6.9   78     9  16     0.0000000 #> 140    18     224 13.8   67     9  17     0.0000000 #> 141    13      27 10.3   76     9  18     0.0000000 #> 142    24     238 10.3   68     9  19     0.0000000 #> 143    16     201  8.0   82     9  20     0.0000000 #> 144    13     238 12.6   64     9  21     0.0000000 #> 145    23      14  9.2   71     9  22     0.0000000 #> 146    36     139 10.3   81     9  23     0.0000000 #> 147     7      49 10.3   69     9  24     0.0000000 #> 148    14      20 16.6   63     9  25     0.0000000 #> 149    30     193  6.9   70     9  26     0.0000000 #> 150    NA     145 13.2   77     9  27     0.1666667 #> 151    14     191 14.3   75     9  28     0.0000000 #> 152    18     131  8.0   76     9  29     0.0000000 #> 153    20     223 11.5   68     9  30     0.0000000 airquality %>% add_prop_miss(Solar.R, Ozone) #>     Ozone Solar.R Wind Temp Month Day prop_miss_vars #> 1      41     190  7.4   67     5   1            0.0 #> 2      36     118  8.0   72     5   2            0.0 #> 3      12     149 12.6   74     5   3            0.0 #> 4      18     313 11.5   62     5   4            0.0 #> 5      NA      NA 14.3   56     5   5            1.0 #> 6      28      NA 14.9   66     5   6            0.5 #> 7      23     299  8.6   65     5   7            0.0 #> 8      19      99 13.8   59     5   8            0.0 #> 9       8      19 20.1   61     5   9            0.0 #> 10     NA     194  8.6   69     5  10            0.5 #> 11      7      NA  6.9   74     5  11            0.5 #> 12     16     256  9.7   69     5  12            0.0 #> 13     11     290  9.2   66     5  13            0.0 #> 14     14     274 10.9   68     5  14            0.0 #> 15     18      65 13.2   58     5  15            0.0 #> 16     14     334 11.5   64     5  16            0.0 #> 17     34     307 12.0   66     5  17            0.0 #> 18      6      78 18.4   57     5  18            0.0 #> 19     30     322 11.5   68     5  19            0.0 #> 20     11      44  9.7   62     5  20            0.0 #> 21      1       8  9.7   59     5  21            0.0 #> 22     11     320 16.6   73     5  22            0.0 #> 23      4      25  9.7   61     5  23            0.0 #> 24     32      92 12.0   61     5  24            0.0 #> 25     NA      66 16.6   57     5  25            0.5 #> 26     NA     266 14.9   58     5  26            0.5 #> 27     NA      NA  8.0   57     5  27            1.0 #> 28     23      13 12.0   67     5  28            0.0 #> 29     45     252 14.9   81     5  29            0.0 #> 30    115     223  5.7   79     5  30            0.0 #> 31     37     279  7.4   76     5  31            0.0 #> 32     NA     286  8.6   78     6   1            0.5 #> 33     NA     287  9.7   74     6   2            0.5 #> 34     NA     242 16.1   67     6   3            0.5 #> 35     NA     186  9.2   84     6   4            0.5 #> 36     NA     220  8.6   85     6   5            0.5 #> 37     NA     264 14.3   79     6   6            0.5 #> 38     29     127  9.7   82     6   7            0.0 #> 39     NA     273  6.9   87     6   8            0.5 #> 40     71     291 13.8   90     6   9            0.0 #> 41     39     323 11.5   87     6  10            0.0 #> 42     NA     259 10.9   93     6  11            0.5 #> 43     NA     250  9.2   92     6  12            0.5 #> 44     23     148  8.0   82     6  13            0.0 #> 45     NA     332 13.8   80     6  14            0.5 #> 46     NA     322 11.5   79     6  15            0.5 #> 47     21     191 14.9   77     6  16            0.0 #> 48     37     284 20.7   72     6  17            0.0 #> 49     20      37  9.2   65     6  18            0.0 #> 50     12     120 11.5   73     6  19            0.0 #> 51     13     137 10.3   76     6  20            0.0 #> 52     NA     150  6.3   77     6  21            0.5 #> 53     NA      59  1.7   76     6  22            0.5 #> 54     NA      91  4.6   76     6  23            0.5 #> 55     NA     250  6.3   76     6  24            0.5 #> 56     NA     135  8.0   75     6  25            0.5 #> 57     NA     127  8.0   78     6  26            0.5 #> 58     NA      47 10.3   73     6  27            0.5 #> 59     NA      98 11.5   80     6  28            0.5 #> 60     NA      31 14.9   77     6  29            0.5 #> 61     NA     138  8.0   83     6  30            0.5 #> 62    135     269  4.1   84     7   1            0.0 #> 63     49     248  9.2   85     7   2            0.0 #> 64     32     236  9.2   81     7   3            0.0 #> 65     NA     101 10.9   84     7   4            0.5 #> 66     64     175  4.6   83     7   5            0.0 #> 67     40     314 10.9   83     7   6            0.0 #> 68     77     276  5.1   88     7   7            0.0 #> 69     97     267  6.3   92     7   8            0.0 #> 70     97     272  5.7   92     7   9            0.0 #> 71     85     175  7.4   89     7  10            0.0 #> 72     NA     139  8.6   82     7  11            0.5 #> 73     10     264 14.3   73     7  12            0.0 #> 74     27     175 14.9   81     7  13            0.0 #> 75     NA     291 14.9   91     7  14            0.5 #> 76      7      48 14.3   80     7  15            0.0 #> 77     48     260  6.9   81     7  16            0.0 #> 78     35     274 10.3   82     7  17            0.0 #> 79     61     285  6.3   84     7  18            0.0 #> 80     79     187  5.1   87     7  19            0.0 #> 81     63     220 11.5   85     7  20            0.0 #> 82     16       7  6.9   74     7  21            0.0 #> 83     NA     258  9.7   81     7  22            0.5 #> 84     NA     295 11.5   82     7  23            0.5 #> 85     80     294  8.6   86     7  24            0.0 #> 86    108     223  8.0   85     7  25            0.0 #> 87     20      81  8.6   82     7  26            0.0 #> 88     52      82 12.0   86     7  27            0.0 #> 89     82     213  7.4   88     7  28            0.0 #> 90     50     275  7.4   86     7  29            0.0 #> 91     64     253  7.4   83     7  30            0.0 #> 92     59     254  9.2   81     7  31            0.0 #> 93     39      83  6.9   81     8   1            0.0 #> 94      9      24 13.8   81     8   2            0.0 #> 95     16      77  7.4   82     8   3            0.0 #> 96     78      NA  6.9   86     8   4            0.5 #> 97     35      NA  7.4   85     8   5            0.5 #> 98     66      NA  4.6   87     8   6            0.5 #> 99    122     255  4.0   89     8   7            0.0 #> 100    89     229 10.3   90     8   8            0.0 #> 101   110     207  8.0   90     8   9            0.0 #> 102    NA     222  8.6   92     8  10            0.5 #> 103    NA     137 11.5   86     8  11            0.5 #> 104    44     192 11.5   86     8  12            0.0 #> 105    28     273 11.5   82     8  13            0.0 #> 106    65     157  9.7   80     8  14            0.0 #> 107    NA      64 11.5   79     8  15            0.5 #> 108    22      71 10.3   77     8  16            0.0 #> 109    59      51  6.3   79     8  17            0.0 #> 110    23     115  7.4   76     8  18            0.0 #> 111    31     244 10.9   78     8  19            0.0 #> 112    44     190 10.3   78     8  20            0.0 #> 113    21     259 15.5   77     8  21            0.0 #> 114     9      36 14.3   72     8  22            0.0 #> 115    NA     255 12.6   75     8  23            0.5 #> 116    45     212  9.7   79     8  24            0.0 #> 117   168     238  3.4   81     8  25            0.0 #> 118    73     215  8.0   86     8  26            0.0 #> 119    NA     153  5.7   88     8  27            0.5 #> 120    76     203  9.7   97     8  28            0.0 #> 121   118     225  2.3   94     8  29            0.0 #> 122    84     237  6.3   96     8  30            0.0 #> 123    85     188  6.3   94     8  31            0.0 #> 124    96     167  6.9   91     9   1            0.0 #> 125    78     197  5.1   92     9   2            0.0 #> 126    73     183  2.8   93     9   3            0.0 #> 127    91     189  4.6   93     9   4            0.0 #> 128    47      95  7.4   87     9   5            0.0 #> 129    32      92 15.5   84     9   6            0.0 #> 130    20     252 10.9   80     9   7            0.0 #> 131    23     220 10.3   78     9   8            0.0 #> 132    21     230 10.9   75     9   9            0.0 #> 133    24     259  9.7   73     9  10            0.0 #> 134    44     236 14.9   81     9  11            0.0 #> 135    21     259 15.5   76     9  12            0.0 #> 136    28     238  6.3   77     9  13            0.0 #> 137     9      24 10.9   71     9  14            0.0 #> 138    13     112 11.5   71     9  15            0.0 #> 139    46     237  6.9   78     9  16            0.0 #> 140    18     224 13.8   67     9  17            0.0 #> 141    13      27 10.3   76     9  18            0.0 #> 142    24     238 10.3   68     9  19            0.0 #> 143    16     201  8.0   82     9  20            0.0 #> 144    13     238 12.6   64     9  21            0.0 #> 145    23      14  9.2   71     9  22            0.0 #> 146    36     139 10.3   81     9  23            0.0 #> 147     7      49 10.3   69     9  24            0.0 #> 148    14      20 16.6   63     9  25            0.0 #> 149    30     193  6.9   70     9  26            0.0 #> 150    NA     145 13.2   77     9  27            0.5 #> 151    14     191 14.3   75     9  28            0.0 #> 152    18     131  8.0   76     9  29            0.0 #> 153    20     223 11.5   68     9  30            0.0 airquality %>% add_prop_miss(Solar.R, Ozone, label = \"testing\") #>     Ozone Solar.R Wind Temp Month Day testing_vars #> 1      41     190  7.4   67     5   1          0.0 #> 2      36     118  8.0   72     5   2          0.0 #> 3      12     149 12.6   74     5   3          0.0 #> 4      18     313 11.5   62     5   4          0.0 #> 5      NA      NA 14.3   56     5   5          1.0 #> 6      28      NA 14.9   66     5   6          0.5 #> 7      23     299  8.6   65     5   7          0.0 #> 8      19      99 13.8   59     5   8          0.0 #> 9       8      19 20.1   61     5   9          0.0 #> 10     NA     194  8.6   69     5  10          0.5 #> 11      7      NA  6.9   74     5  11          0.5 #> 12     16     256  9.7   69     5  12          0.0 #> 13     11     290  9.2   66     5  13          0.0 #> 14     14     274 10.9   68     5  14          0.0 #> 15     18      65 13.2   58     5  15          0.0 #> 16     14     334 11.5   64     5  16          0.0 #> 17     34     307 12.0   66     5  17          0.0 #> 18      6      78 18.4   57     5  18          0.0 #> 19     30     322 11.5   68     5  19          0.0 #> 20     11      44  9.7   62     5  20          0.0 #> 21      1       8  9.7   59     5  21          0.0 #> 22     11     320 16.6   73     5  22          0.0 #> 23      4      25  9.7   61     5  23          0.0 #> 24     32      92 12.0   61     5  24          0.0 #> 25     NA      66 16.6   57     5  25          0.5 #> 26     NA     266 14.9   58     5  26          0.5 #> 27     NA      NA  8.0   57     5  27          1.0 #> 28     23      13 12.0   67     5  28          0.0 #> 29     45     252 14.9   81     5  29          0.0 #> 30    115     223  5.7   79     5  30          0.0 #> 31     37     279  7.4   76     5  31          0.0 #> 32     NA     286  8.6   78     6   1          0.5 #> 33     NA     287  9.7   74     6   2          0.5 #> 34     NA     242 16.1   67     6   3          0.5 #> 35     NA     186  9.2   84     6   4          0.5 #> 36     NA     220  8.6   85     6   5          0.5 #> 37     NA     264 14.3   79     6   6          0.5 #> 38     29     127  9.7   82     6   7          0.0 #> 39     NA     273  6.9   87     6   8          0.5 #> 40     71     291 13.8   90     6   9          0.0 #> 41     39     323 11.5   87     6  10          0.0 #> 42     NA     259 10.9   93     6  11          0.5 #> 43     NA     250  9.2   92     6  12          0.5 #> 44     23     148  8.0   82     6  13          0.0 #> 45     NA     332 13.8   80     6  14          0.5 #> 46     NA     322 11.5   79     6  15          0.5 #> 47     21     191 14.9   77     6  16          0.0 #> 48     37     284 20.7   72     6  17          0.0 #> 49     20      37  9.2   65     6  18          0.0 #> 50     12     120 11.5   73     6  19          0.0 #> 51     13     137 10.3   76     6  20          0.0 #> 52     NA     150  6.3   77     6  21          0.5 #> 53     NA      59  1.7   76     6  22          0.5 #> 54     NA      91  4.6   76     6  23          0.5 #> 55     NA     250  6.3   76     6  24          0.5 #> 56     NA     135  8.0   75     6  25          0.5 #> 57     NA     127  8.0   78     6  26          0.5 #> 58     NA      47 10.3   73     6  27          0.5 #> 59     NA      98 11.5   80     6  28          0.5 #> 60     NA      31 14.9   77     6  29          0.5 #> 61     NA     138  8.0   83     6  30          0.5 #> 62    135     269  4.1   84     7   1          0.0 #> 63     49     248  9.2   85     7   2          0.0 #> 64     32     236  9.2   81     7   3          0.0 #> 65     NA     101 10.9   84     7   4          0.5 #> 66     64     175  4.6   83     7   5          0.0 #> 67     40     314 10.9   83     7   6          0.0 #> 68     77     276  5.1   88     7   7          0.0 #> 69     97     267  6.3   92     7   8          0.0 #> 70     97     272  5.7   92     7   9          0.0 #> 71     85     175  7.4   89     7  10          0.0 #> 72     NA     139  8.6   82     7  11          0.5 #> 73     10     264 14.3   73     7  12          0.0 #> 74     27     175 14.9   81     7  13          0.0 #> 75     NA     291 14.9   91     7  14          0.5 #> 76      7      48 14.3   80     7  15          0.0 #> 77     48     260  6.9   81     7  16          0.0 #> 78     35     274 10.3   82     7  17          0.0 #> 79     61     285  6.3   84     7  18          0.0 #> 80     79     187  5.1   87     7  19          0.0 #> 81     63     220 11.5   85     7  20          0.0 #> 82     16       7  6.9   74     7  21          0.0 #> 83     NA     258  9.7   81     7  22          0.5 #> 84     NA     295 11.5   82     7  23          0.5 #> 85     80     294  8.6   86     7  24          0.0 #> 86    108     223  8.0   85     7  25          0.0 #> 87     20      81  8.6   82     7  26          0.0 #> 88     52      82 12.0   86     7  27          0.0 #> 89     82     213  7.4   88     7  28          0.0 #> 90     50     275  7.4   86     7  29          0.0 #> 91     64     253  7.4   83     7  30          0.0 #> 92     59     254  9.2   81     7  31          0.0 #> 93     39      83  6.9   81     8   1          0.0 #> 94      9      24 13.8   81     8   2          0.0 #> 95     16      77  7.4   82     8   3          0.0 #> 96     78      NA  6.9   86     8   4          0.5 #> 97     35      NA  7.4   85     8   5          0.5 #> 98     66      NA  4.6   87     8   6          0.5 #> 99    122     255  4.0   89     8   7          0.0 #> 100    89     229 10.3   90     8   8          0.0 #> 101   110     207  8.0   90     8   9          0.0 #> 102    NA     222  8.6   92     8  10          0.5 #> 103    NA     137 11.5   86     8  11          0.5 #> 104    44     192 11.5   86     8  12          0.0 #> 105    28     273 11.5   82     8  13          0.0 #> 106    65     157  9.7   80     8  14          0.0 #> 107    NA      64 11.5   79     8  15          0.5 #> 108    22      71 10.3   77     8  16          0.0 #> 109    59      51  6.3   79     8  17          0.0 #> 110    23     115  7.4   76     8  18          0.0 #> 111    31     244 10.9   78     8  19          0.0 #> 112    44     190 10.3   78     8  20          0.0 #> 113    21     259 15.5   77     8  21          0.0 #> 114     9      36 14.3   72     8  22          0.0 #> 115    NA     255 12.6   75     8  23          0.5 #> 116    45     212  9.7   79     8  24          0.0 #> 117   168     238  3.4   81     8  25          0.0 #> 118    73     215  8.0   86     8  26          0.0 #> 119    NA     153  5.7   88     8  27          0.5 #> 120    76     203  9.7   97     8  28          0.0 #> 121   118     225  2.3   94     8  29          0.0 #> 122    84     237  6.3   96     8  30          0.0 #> 123    85     188  6.3   94     8  31          0.0 #> 124    96     167  6.9   91     9   1          0.0 #> 125    78     197  5.1   92     9   2          0.0 #> 126    73     183  2.8   93     9   3          0.0 #> 127    91     189  4.6   93     9   4          0.0 #> 128    47      95  7.4   87     9   5          0.0 #> 129    32      92 15.5   84     9   6          0.0 #> 130    20     252 10.9   80     9   7          0.0 #> 131    23     220 10.3   78     9   8          0.0 #> 132    21     230 10.9   75     9   9          0.0 #> 133    24     259  9.7   73     9  10          0.0 #> 134    44     236 14.9   81     9  11          0.0 #> 135    21     259 15.5   76     9  12          0.0 #> 136    28     238  6.3   77     9  13          0.0 #> 137     9      24 10.9   71     9  14          0.0 #> 138    13     112 11.5   71     9  15          0.0 #> 139    46     237  6.9   78     9  16          0.0 #> 140    18     224 13.8   67     9  17          0.0 #> 141    13      27 10.3   76     9  18          0.0 #> 142    24     238 10.3   68     9  19          0.0 #> 143    16     201  8.0   82     9  20          0.0 #> 144    13     238 12.6   64     9  21          0.0 #> 145    23      14  9.2   71     9  22          0.0 #> 146    36     139 10.3   81     9  23          0.0 #> 147     7      49 10.3   69     9  24          0.0 #> 148    14      20 16.6   63     9  25          0.0 #> 149    30     193  6.9   70     9  26          0.0 #> 150    NA     145 13.2   77     9  27          0.5 #> 151    14     191 14.3   75     9  28          0.0 #> 152    18     131  8.0   76     9  29          0.0 #> 153    20     223 11.5   68     9  30          0.0  # this can be applied to model the proportion of missing data # as in Tierney et al \\doi{10.1136/bmjopen-2014-007450} # see \"Modelling missingness\" in vignette \"Getting Started with naniar\" # for details"},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow column to dataframe — add_shadow","title":"Add a shadow column to dataframe — add_shadow","text":"alternative bind_shadow(), can add specific individual shadow columns dataset. also respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow column to dataframe — add_shadow","text":"","code":"add_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow column to dataframe — add_shadow","text":"data data.frame ... One unquoted variable names, separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow column to dataframe — add_shadow","text":"data.frame","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow column to dataframe — add_shadow","text":"","code":"airquality %>% add_shadow(Ozone) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA #>                #>  1    41     190   7.4    67     5     1 !NA      #>  2    36     118   8      72     5     2 !NA      #>  3    12     149  12.6    74     5     3 !NA      #>  4    18     313  11.5    62     5     4 !NA      #>  5    NA      NA  14.3    56     5     5 NA       #>  6    28      NA  14.9    66     5     6 !NA      #>  7    23     299   8.6    65     5     7 !NA      #>  8    19      99  13.8    59     5     8 !NA      #>  9     8      19  20.1    61     5     9 !NA      #> 10    NA     194   8.6    69     5    10 NA       #> # ℹ 143 more rows airquality %>% add_shadow(Ozone, Solar.R) #> # A tibble: 153 × 8 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA #>                      #>  1    41     190   7.4    67     5     1 !NA      !NA        #>  2    36     118   8      72     5     2 !NA      !NA        #>  3    12     149  12.6    74     5     3 !NA      !NA        #>  4    18     313  11.5    62     5     4 !NA      !NA        #>  5    NA      NA  14.3    56     5     5 NA       NA         #>  6    28      NA  14.9    66     5     6 !NA      NA         #>  7    23     299   8.6    65     5     7 !NA      !NA        #>  8    19      99  13.8    59     5     8 !NA      !NA        #>  9     8      19  20.1    61     5     9 !NA      !NA        #> 10    NA     194   8.6    69     5    10 NA       !NA        #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow shifted column to a dataset — add_shadow_shift","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"Shadow shift missing values using selected variables dataset, specifying variable names use dplyr vars dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"","code":"add_shadow_shift(data, ..., suffix = \"shift\")"},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"data data.frame ... One unquoted variable names separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. suffix suffix add variable, defaults \"shift\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"data added variable shifted named var_suffix","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"","code":"airquality %>% add_shadow_shift(Ozone, Solar.R) #> # A tibble: 153 × 8 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_shift Solar.R_shift #>                            #>  1    41     190   7.4    67     5     1        41           190   #>  2    36     118   8      72     5     2        36           118   #>  3    12     149  12.6    74     5     3        12           149   #>  4    18     313  11.5    62     5     4        18           313   #>  5    NA      NA  14.3    56     5     5       -19.7         -33.6 #>  6    28      NA  14.9    66     5     6        28           -33.1 #>  7    23     299   8.6    65     5     7        23           299   #>  8    19      99  13.8    59     5     8        19            99   #>  9     8      19  20.1    61     5     9         8            19   #> 10    NA     194   8.6    69     5    10       -18.5         194   #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a counter variable for a span of dataframe — add_span_counter","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"Adds variable, span_counter dataframe. Used internally facilitate counting missing values given span.","code":""},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"","code":"add_span_counter(data, span_size)"},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"data data.frame span_size integer","code":""},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"data.frame extra variable \"span_counter\".","code":""},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"","code":"if (FALSE) { # add_span_counter(pedestrian, span_size = 100) }"},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify if there are any or all missing or complete values — any-all-na-complete","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"useful exploring data search cases instances missing complete values. example, can help identify potentially remove keep columns data frame missing, complete. case, provide two functions: any_miss any_complete. Note any_miss alias, any_na. hood call anyNA. any_complete complement any_miss - returns TRUE complete values. Note dataframe any_complete look complete cases, complete rows, different complete variables. case, two functions: all_miss, all_complete.","code":""},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"","code":"any_na(x)  any_miss(x)  any_complete(x)  all_na(x)  all_miss(x)  all_complete(x)"},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"x object explore missings/complete values","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"","code":"# for vectors misses <- c(NA, NA, NA) complete <- c(1, 2, 3) mixture <- c(NA, 1, NA)  all_na(misses) #> [1] TRUE all_na(complete) #> [1] FALSE all_na(mixture) #> [1] FALSE all_complete(misses) #> [1] FALSE all_complete(complete) #> [1] TRUE all_complete(mixture) #> [1] FALSE  any_na(misses) #> [1] TRUE any_na(complete) #> [1] FALSE any_na(mixture) #> [1] TRUE  # for data frames all_na(airquality) #> [1] FALSE # an alias of all_na all_miss(airquality) #> [1] FALSE all_complete(airquality) #> [1] FALSE  any_na(airquality) #> [1] TRUE any_complete(airquality) #> [1] TRUE  # use in identifying columns with all missing/complete  library(dplyr) #>  #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #>  #>     filter, lag #> The following objects are masked from ‘package:base’: #>  #>     intersect, setdiff, setequal, union # for printing aq <- as_tibble(airquality) aq #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190   7.4    67     5     1 #>  2    36     118   8      72     5     2 #>  3    12     149  12.6    74     5     3 #>  4    18     313  11.5    62     5     4 #>  5    NA      NA  14.3    56     5     5 #>  6    28      NA  14.9    66     5     6 #>  7    23     299   8.6    65     5     7 #>  8    19      99  13.8    59     5     8 #>  9     8      19  20.1    61     5     9 #> 10    NA     194   8.6    69     5    10 #> # ℹ 143 more rows # select variables with all missing values aq %>% select(where(all_na)) #> # A tibble: 153 × 0 # there are none! #' # select columns with any NA values aq %>% select(where(any_na)) #> # A tibble: 153 × 2 #>    Ozone Solar.R #>        #>  1    41     190 #>  2    36     118 #>  3    12     149 #>  4    18     313 #>  5    NA      NA #>  6    28      NA #>  7    23     299 #>  8    19      99 #>  9     8      19 #> 10    NA     194 #> # ℹ 143 more rows # select only columns with all complete data aq %>% select(where(all_complete)) #> # A tibble: 153 × 4 #>     Wind  Temp Month   Day #>        #>  1   7.4    67     5     1 #>  2   8      72     5     2 #>  3  12.6    74     5     3 #>  4  11.5    62     5     4 #>  5  14.3    56     5     5 #>  6  14.9    66     5     6 #>  7   8.6    65     5     7 #>  8  13.8    59     5     8 #>  9  20.1    61     5     9 #> 10   8.6    69     5    10 #> # ℹ 143 more rows  # select columns where there are any complete cases (all the data) aq %>% select(where(any_complete)) #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190   7.4    67     5     1 #>  2    36     118   8      72     5     2 #>  3    12     149  12.6    74     5     3 #>  4    18     313  11.5    62     5     4 #>  5    NA      NA  14.3    56     5     5 #>  6    28      NA  14.9    66     5     6 #>  7    23     299   8.6    65     5     7 #>  8    19      99  13.8    59     5     8 #>  9     8      19  20.1    61     5     9 #> 10    NA     194   8.6    69     5    10 #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to determine whether there are any missings — any_row_miss","title":"Helper function to determine whether there are any missings — any_row_miss","text":"Helper function determine whether missings","code":""},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to determine whether there are any missings — any_row_miss","text":"","code":"any_row_miss(x)"},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to determine whether there are any missings — any_row_miss","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to determine whether there are any missings — any_row_miss","text":"logical vector TRUE = missing FALSE = complete","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Create shadows — as_shadow","title":"Create shadows — as_shadow","text":"Return tibble shadow matrix form, variables suffix _NA attached distinguish .","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create shadows — as_shadow","text":"","code":"as_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create shadows — as_shadow","text":"data dataframe ... selected variables use","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create shadows — as_shadow","text":"appended shadow column names","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create shadows — as_shadow","text":"Representing missing data structure achieved using shadow matrix, introduced Swayne Buja. shadow matrix dimension data, consists binary indicators missingness data values, missing represented \"NA\", missing represented \"!NA\". Although may represented 1 0, respectively.","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create shadows — as_shadow","text":"","code":"as_shadow(airquality) #> # A tibble: 153 × 6 #>    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA #>                          #>  1 !NA      !NA        !NA     !NA     !NA      !NA    #>  2 !NA      !NA        !NA     !NA     !NA      !NA    #>  3 !NA      !NA        !NA     !NA     !NA      !NA    #>  4 !NA      !NA        !NA     !NA     !NA      !NA    #>  5 NA       NA         !NA     !NA     !NA      !NA    #>  6 !NA      NA         !NA     !NA     !NA      !NA    #>  7 !NA      !NA        !NA     !NA     !NA      !NA    #>  8 !NA      !NA        !NA     !NA     !NA      !NA    #>  9 !NA      !NA        !NA     !NA     !NA      !NA    #> 10 NA       !NA        !NA     !NA     !NA      !NA    #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert data into shadow format for doing an upset plot — as_shadow_upset","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"Upset plots way visualising common sets, function transforms data format feeds directly upset plot","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"","code":"as_shadow_upset(data)"},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"","code":"if (FALSE) {  library(UpSetR) airquality %>%   as_shadow_upset() %>%   upset() }"},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Bind a shadow dataframe to original data — bind_shadow","title":"Bind a shadow dataframe to original data — bind_shadow","text":"Binding shadow matrix regular dataframe helps visualise work missing data.","code":""},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bind a shadow dataframe to original data — bind_shadow","text":"","code":"bind_shadow(data, only_miss = FALSE, ...)"},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bind a shadow dataframe to original data — bind_shadow","text":"data dataframe only_miss logical - FALSE (default) bind dataframe variables duplicated shadow. Setting TRUE bind variables variables contain missing values. See examples details. ... extra options pass recode_shadow() - work progress.","code":""},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bind a shadow dataframe to original data — bind_shadow","text":"data added variable shifted suffix _NA","code":""},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bind a shadow dataframe to original data — bind_shadow","text":"","code":"bind_shadow(airquality) #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA   # bind only the variables that contain missing values bind_shadow(airquality, only_miss = TRUE) #> # A tibble: 153 × 8 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA #>                      #>  1    41     190   7.4    67     5     1 !NA      !NA        #>  2    36     118   8      72     5     2 !NA      !NA        #>  3    12     149  12.6    74     5     3 !NA      !NA        #>  4    18     313  11.5    62     5     4 !NA      !NA        #>  5    NA      NA  14.3    56     5     5 NA       NA         #>  6    28      NA  14.9    66     5     6 !NA      NA         #>  7    23     299   8.6    65     5     7 !NA      !NA        #>  8    19      99  13.8    59     5     8 !NA      !NA        #>  9     8      19  20.1    61     5     9 !NA      !NA        #> 10    NA     194   8.6    69     5    10 NA       !NA        #> # ℹ 143 more rows  aq_shadow <- bind_shadow(airquality)  if (FALSE) { # explore missing data visually library(ggplot2)  # using the bounded shadow to visualise Ozone according to whether Solar # Radiation is missing or not.  ggplot(data = aq_shadow,        aes(x = Ozone)) +        geom_histogram() +        facet_wrap(~Solar.R_NA,        ncol = 1) }"},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow column to a dataset — cast_shadow","title":"Add a shadow column to a dataset — cast_shadow","text":"Casting shadow shifted column performs equivalent pattern data %>% select(var) %>% impute_below(). convenience function makes easy perform certain visualisations, line principle user way flexibly return data formats containing information missing data. forms base building block functions cast_shadow_shift, cast_shadow_shift_label. also respects dplyr verbs starts_with, contains, ends_with, etc. select variables.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow column to a dataset — cast_shadow","text":"","code":"cast_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow column to a dataset — cast_shadow","text":"data data.frame ... One unquoted variable names separated commas. respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow column to a dataset — cast_shadow","text":"data added variable shifted suffix _NA","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow column to a dataset — cast_shadow","text":"","code":"airquality %>% cast_shadow(Ozone, Solar.R) #> # A tibble: 153 × 4 #>    Ozone Solar.R Ozone_NA Solar.R_NA #>                  #>  1    41     190 !NA      !NA        #>  2    36     118 !NA      !NA        #>  3    12     149 !NA      !NA        #>  4    18     313 !NA      !NA        #>  5    NA      NA NA       NA         #>  6    28      NA !NA      NA         #>  7    23     299 !NA      !NA        #>  8    19      99 !NA      !NA        #>  9     8      19 !NA      !NA        #> 10    NA     194 NA       !NA        #> # ℹ 143 more rows if (FALSE) { library(ggplot2) library(magrittr) airquality  %>%   cast_shadow(Ozone,Solar.R) %>%   ggplot(aes(x = Ozone,              colour = Solar.R_NA)) +         geom_density() }"},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"Shift values add shadow column.  also respects dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"","code":"cast_shadow_shift(data, ...)"},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"data data.frame ... One unquoted variable names separated commas. respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"data.frame shadow shadow_shift vars","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"","code":"airquality %>% cast_shadow_shift(Ozone,Temp) #> # A tibble: 153 × 6 #>    Ozone  Temp Ozone_NA Temp_NA Ozone_shift Temp_shift #>                          #>  1    41    67 !NA      !NA            41           67 #>  2    36    72 !NA      !NA            36           72 #>  3    12    74 !NA      !NA            12           74 #>  4    18    62 !NA      !NA            18           62 #>  5    NA    56 NA       !NA           -19.7         56 #>  6    28    66 !NA      !NA            28           66 #>  7    23    65 !NA      !NA            23           65 #>  8    19    59 !NA      !NA            19           59 #>  9     8    61 !NA      !NA             8           61 #> 10    NA    69 NA       !NA           -18.5         69 #> # ℹ 143 more rows  airquality %>% cast_shadow_shift(dplyr::contains(\"o\")) #> # A tibble: 153 × 12 #>    Ozone Solar.R Month Ozone_NA Solar.R_NA Month_NA Ozone_shift Solar.R_shift #>                                       #>  1    41     190     5 !NA      !NA        !NA             41           190   #>  2    36     118     5 !NA      !NA        !NA             36           118   #>  3    12     149     5 !NA      !NA        !NA             12           149   #>  4    18     313     5 !NA      !NA        !NA             18           313   #>  5    NA      NA     5 NA       NA         !NA            -19.7         -33.6 #>  6    28      NA     5 !NA      NA         !NA             28           -33.1 #>  7    23     299     5 !NA      !NA        !NA             23           299   #>  8    19      99     5 !NA      !NA        !NA             19            99   #>  9     8      19     5 !NA      !NA        !NA              8            19   #> 10    NA     194     5 NA       !NA        !NA            -18.5         194   #> # ℹ 143 more rows #> # ℹ 4 more variables: Month_shift , Ozone_NA_shift , #> #   Solar.R_NA_shift , Month_NA_shift "},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"Shift values, add shadow, add missing label","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"","code":"cast_shadow_shift_label(data, ...)"},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"data data.frame ... One unquoted expressions separated commas. also respect dplyr verbs \"starts_with\", \"contains\", \"ends_with\", etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"data.frame shadow shadow_shift vars, missing labels","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"","code":"airquality %>% cast_shadow_shift_label(Ozone, Solar.R) #> # A tibble: 153 × 7 #>    Ozone Solar.R Ozone_NA Solar.R_NA Ozone_shift Solar.R_shift any_missing #>                                         #>  1    41     190 !NA      !NA               41           190   Not Missing #>  2    36     118 !NA      !NA               36           118   Not Missing #>  3    12     149 !NA      !NA               12           149   Not Missing #>  4    18     313 !NA      !NA               18           313   Not Missing #>  5    NA      NA NA       NA               -19.7         -33.6 Missing     #>  6    28      NA !NA      NA                28           -33.1 Missing     #>  7    23     299 !NA      !NA               23           299   Not Missing #>  8    19      99 !NA      !NA               19            99   Not Missing #>  9     8      19 !NA      !NA                8            19   Not Missing #> 10    NA     194 NA       !NA              -18.5         194   Missing     #> # ℹ 143 more rows  # replicate the plot generated by geom_miss_point() if (FALSE) { library(ggplot2)  airquality %>%   cast_shadow_shift_label(Ozone,Solar.R) %>%   ggplot(aes(x = Ozone_shift,              y = Solar.R_shift,              colour = any_missing)) +         geom_point() }"},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":null,"dir":"Reference","previous_headings":"","what":"Common number values for NA — common_na_numbers","title":"Common number values for NA — common_na_numbers","text":"vector contains common number values NA (missing), aimed used inside naniar functions miss_scan_count() replace_with_na(). current list numbers can found printing common_na_numbers. useful way explore data possible missings, strongly warn using replace NA values without carefully looking incidence cases. Common NA strings data object common_na_strings.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Common number values for NA — common_na_numbers","text":"","code":"common_na_numbers"},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Common number values for NA — common_na_numbers","text":"object class numeric length 8.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Common number values for NA — common_na_numbers","text":"original discussion https://github.com/njtierney/naniar/issues/168","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Common number values for NA — common_na_numbers","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  miss_scan_count(dat_ms, -99) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            1 #> 2 y            0 #> 3 z            1 miss_scan_count(dat_ms, c(\"-99\",\"-98\",\"N/A\")) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            1 #> 3 z            2 common_na_numbers #> [1]    -9   -99  -999 -9999  9999    66    77    88 miss_scan_count(dat_ms, common_na_numbers) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            0 #> 3 z            2"},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":null,"dir":"Reference","previous_headings":"","what":"Common string values for NA — common_na_strings","title":"Common string values for NA — common_na_strings","text":"vector contains common values NA (missing), aimed used inside naniar functions miss_scan_count() replace_with_na(). current list strings used can found printing common_na_strings. useful way explore data possible missings, strongly warn using replace NA values without carefully looking incidence cases. Please note common_na_strings uses \\\\ around \"?\", \".\" \"*\" characters protect using wildcard features grep. Common NA numbers data object common_na_numbers.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Common string values for NA — common_na_strings","text":"","code":"common_na_strings"},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Common string values for NA — common_na_strings","text":"object class character length 26.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Common string values for NA — common_na_strings","text":"original discussion https://github.com/njtierney/naniar/issues/168","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Common string values for NA — common_na_strings","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  miss_scan_count(dat_ms, -99) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            1 #> 2 y            0 #> 3 z            1 miss_scan_count(dat_ms, c(\"-99\",\"-98\",\"N/A\")) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            1 #> 3 z            2 common_na_strings #>  [1] \"missing\" \"NA\"      \"N A\"     \"N/A\"     \"#N/A\"    \"NA \"     \" NA\"     #>  [8] \"N /A\"    \"N / A\"   \" N / A\"  \"N / A \"  \"na\"      \"n a\"     \"n/a\"     #> [15] \"na \"     \" na\"     \"n /a\"    \"n / a\"   \" a / a\"  \"n / a \"  \"NULL\"    #> [22] \"null\"    \"\"        \"\\\\?\"     \"\\\\*\"     \"\\\\.\"     miss_scan_count(dat_ms, common_na_strings) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            4 #> 2 y            4 #> 3 z            5 replace_with_na(dat_ms, replace = list(y = common_na_strings)) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1"},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Key drawing functions — draw_key","title":"Key drawing functions — draw_key","text":"Geom associated function draws key geom needs displayed legend. options built naniar.","code":""},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Key drawing functions — draw_key","text":"","code":"draw_key_missing_point(data, params, size)"},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Key drawing functions — draw_key","text":"data single row data frame containing scaled aesthetics display key params list additional parameters supplied geom. size Width height key mm.","code":""},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Key drawing functions — draw_key","text":"grid grob.","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Long form representation of a shadow matrix — gather_shadow","title":"Long form representation of a shadow matrix — gather_shadow","text":"gather_shadow long-form representation binding shadow matrix data, producing variables named case, variable, missing, missing contains missing value representation.","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Long form representation of a shadow matrix — gather_shadow","text":"","code":"gather_shadow(data)"},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Long form representation of a shadow matrix — gather_shadow","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Long form representation of a shadow matrix — gather_shadow","text":"dataframe long, format, containing information missings","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Long form representation of a shadow matrix — gather_shadow","text":"","code":"gather_shadow(airquality) #> # A tibble: 918 × 3 #>     case variable   missing #>              #>  1     1 Ozone_NA   !NA     #>  2     1 Solar.R_NA !NA     #>  3     1 Wind_NA    !NA     #>  4     1 Temp_NA    !NA     #>  5     1 Month_NA   !NA     #>  6     1 Day_NA     !NA     #>  7     2 Ozone_NA   !NA     #>  8     2 Solar.R_NA !NA     #>  9     2 Wind_NA    !NA     #> 10     2 Temp_NA    !NA     #> # ℹ 908 more rows"},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":null,"dir":"Reference","previous_headings":"","what":"geom_miss_point — geom_miss_point","title":"geom_miss_point — geom_miss_point","text":"geom_miss_point provides way transform plot missing values ggplot2. uses methods ggobi display missing data points 10\\ axis.","code":""},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"geom_miss_point — geom_miss_point","text":"","code":"geom_miss_point(   mapping = NULL,   data = NULL,   prop_below = 0.1,   jitter = 0.05,   stat = \"miss_point\",   position = \"identity\",   colour = ..missing..,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE,   ... )"},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"geom_miss_point — geom_miss_point","text":"mapping Set aesthetic mappings created ggplot2::aes() ggplot2::aes_(). specified inherit.aes = TRUE (default), combined default mapping top level plot. need supply mapping mapping defined plot. data data frame. specified, overrides default data frame defined top level plot. prop_below degree shift values. default 0.1 jitter amount jitter add. default 0.05 stat statistical transformation use data layer, string. position Position adjustment, either string, result call position adjustment function. colour colour chosen aesthetic na.rm FALSE (default), removes missing values warning. TRUE silently removes missing values. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders. ... arguments passed ggplot2::layer(). three types arguments can use : Aesthetics: set aesthetic fixed value, like color = \"red\" size = 3. arguments layer, example override default stat associated layer. arguments passed stat.","code":""},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"geom_miss_point — geom_miss_point","text":"Plot Missing Data Points","code":""},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"geom_miss_point — geom_miss_point","text":"Warning message na.rm = T supplied.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"geom_miss_point — geom_miss_point","text":"","code":"if (FALSE) { library(ggplot2)  # using regular geom_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) + geom_point()  # using  geom_miss_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point()   # using facets  ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() +  facet_wrap(~Month) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings per case (row) — gg_miss_case","title":"Plot the number of missings per case (row) — gg_miss_case","text":"visual analogue miss_case_summary. draws ggplot number missings case (row). default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings per case (row) — gg_miss_case","text":"","code":"gg_miss_case(x, facet, order_cases = TRUE, show_pct = FALSE)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings per case (row) — gg_miss_case","text":"x data.frame facet (optional) single bare variable name, want create faceted plot. order_cases logical Order rows missingness (default FALSE - order). show_pct logical Show percentage cases","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings per case (row) — gg_miss_case","text":"ggplot object depicting number missings given case.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings per case (row) — gg_miss_case","text":"","code":"gg_miss_case(airquality)  if (FALSE) { library(ggplot2) gg_miss_case(airquality) + labs(x = \"Number of Cases\") gg_miss_case(airquality, show_pct = TRUE) gg_miss_case(airquality, order_cases = FALSE) gg_miss_case(airquality, facet = Month) gg_miss_case(airquality, facet = Month, order_cases = FALSE) gg_miss_case(airquality, facet = Month, show_pct = TRUE) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"plot showing cumulative sum missing values cases, reading rows top bottom. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"","code":"gg_miss_case_cumsum(x, breaks = 20)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"x dataframe breaks breaks x axis default 20","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"ggplot object depicting number missings","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"","code":"gg_miss_case_cumsum(airquality)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"function draws ggplot plot number missings column, broken categorical variable dataset. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"","code":"gg_miss_fct(x, fct)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"x data.frame fct column containing factor variable visualise","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"ggplot object depicting % missing factor level variable.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"","code":"gg_miss_fct(x = riskfactors, fct = marital)  if (FALSE) { library(ggplot2) gg_miss_fct(x = riskfactors, fct = marital) + labs(title = \"NA in Risk Factors and Marital status\") }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings in a given repeating span — gg_miss_span","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"gg_miss_span replacement function imputeTS::plotNA.distributionBar(tsNH4, breaksize = 100), shows number missings given span, breaksize. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"","code":"gg_miss_span(data, var, span_every, facet)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"data data.frame var bare unquoted variable name data. span_every integer describing length span explored facet (optional) single bare variable name, want create faceted plot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"ggplot2 showing number missings span (window, breaksize)","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"","code":"miss_var_span(pedestrian, hourly_counts, span_every = 3000) #> # A tibble: 13 × 6 #>    span_counter n_miss n_complete prop_miss prop_complete n_in_span #>                                       #>  1            1      0       3000  0                1          3000 #>  2            2      0       3000  0                1          3000 #>  3            3      1       2999  0.000333         1.00       3000 #>  4            4    121       2879  0.0403           0.960      3000 #>  5            5    503       2497  0.168            0.832      3000 #>  6            6    555       2445  0.185            0.815      3000 #>  7            7    190       2810  0.0633           0.937      3000 #>  8            8      0       3000  0                1          3000 #>  9            9      1       2999  0.000333         1.00       3000 #> 10           10      0       3000  0                1          3000 #> 11           11      0       3000  0                1          3000 #> 12           12    745       2255  0.248            0.752      3000 #> 13           13    432       1268  0.254            0.746      1700 if (FALSE) { library(ggplot2) gg_miss_span(pedestrian, hourly_counts, span_every = 3000) gg_miss_span(pedestrian, hourly_counts, span_every = 3000, facet = sensor_name) # works with the rest of ggplot gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + labs(x = \"custom\") gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + theme_dark() }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"Upset plots way visualising common sets, gg_miss_upset shows number missing values sets data. default option gg_miss_upset taken UpSetR::upset - use 5 sets 40 interactions. also set ordering frequency intersections. Setting nsets = 5 means look 5 variables combinations. number combinations rather intersections controlled nintersects. 40 intersections, 40 combinations variables explored. number sets intersections can changed passing arguments nsets = 10 look 10 sets variables, nintersects = 50 look 50 intersections.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"","code":"gg_miss_upset(data, order.by = \"freq\", ...)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"data data.frame order.(UpSetR::upset) intersections matrix ordered . Options include frequency (entered \"freq\"), degree, order.  See ?UpSetR::upset options ... arguments pass upset plot - see ?UpSetR::upset","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"ggplot visualisation missing data","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"","code":"if (FALSE) { gg_miss_upset(airquality) gg_miss_upset(riskfactors) gg_miss_upset(riskfactors, nsets = 10) gg_miss_upset(riskfactors, nsets = 10, nintersects = 10) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings for each variable — gg_miss_var","title":"Plot the number of missings for each variable — gg_miss_var","text":"visual analogue miss_var_summary. draws ggplot number missings variable, ordered show variables missing data. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings for each variable — gg_miss_var","text":"","code":"gg_miss_var(x, facet, show_pct = FALSE)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings for each variable — gg_miss_var","text":"x dataframe facet (optional) bare variable name, want create faceted plot. show_pct logical shows number missings (default), set TRUE, display proportion missings.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings for each variable — gg_miss_var","text":"ggplot object depicting number missings given column","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings for each variable — gg_miss_var","text":"","code":"gg_miss_var(airquality)  if (FALSE) { library(ggplot2) gg_miss_var(airquality) + labs(y = \"Look at all the missing ones\") gg_miss_var(airquality, Month) gg_miss_var(airquality, Month, show_pct = TRUE) gg_miss_var(airquality, Month, show_pct = TRUE) + ylim(0, 100) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"plot showing cumulative sum missing values variable, reading columns left right initial dataframe. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"","code":"gg_miss_var_cumsum(x)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"x data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"ggplot object showing cumulative sum missings variables","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"","code":"gg_miss_var_cumsum(airquality)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot which variables contain a missing value — gg_miss_which","title":"Plot which variables contain a missing value — gg_miss_which","text":"plot produces set rectangles indicating whether missing element column .  default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot which variables contain a missing value — gg_miss_which","text":"","code":"gg_miss_which(x)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot which variables contain a missing value — gg_miss_which","text":"x dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot which variables contain a missing value — gg_miss_which","text":"ggplot object variables contains missing values","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot which variables contain a missing value — gg_miss_which","text":"","code":"gg_miss_which(airquality)"},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute data with values shifted 10 percent below range. — impute_below","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"can useful exploratory graphics impute data outside range data. impute_below imputes variables missings values 10 percent range numeric values, plus jittered noise, separate repeated values, missing values can visualised along rest data. character factor values, adds new string label.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"","code":"impute_below(x, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"x variable interest shift ... extra arguments pass","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"","code":"library(dplyr) vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_below(vec) #>  [1] -0.008593142 -0.530161130 -0.561854135  0.509078646  0.115911160 #>  [6] -0.751444156 -0.252584949 -0.690342117  0.985024011 -0.742595875 impute_below(vec, prop_below = 0.25) #>  [1] -0.008593142 -0.530161130 -0.561854135  0.509078646  0.115911160 #>  [6] -0.983475878 -0.252584949 -0.922373839  0.985024011 -0.974627597 impute_below(vec,             prop_below = 0.25,             jitter = 0.2) #>  [1] -0.008593142 -0.530161130 -0.561854135  0.509078646  0.115911160 #>  [6] -1.088182499 -0.252584949 -0.843774343  0.985024011 -1.052789373  dat <- tibble(  num = rnorm(10),  int = as.integer(rpois(10, 5)),  fct = factor(LETTERS[1:10]) ) %>%  mutate(    across(      everything(),      \\(x) set_prop_miss(x, prop = 0.25)    )  )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1  0.721     10 A     #>  2 -0.303      5 B     #>  3 -0.730      6 C     #>  4  0.0459    NA D     #>  5  0.271      7 NA    #>  6 -1.74       5 F     #>  7 -0.290      1 NA    #>  8 -0.686      5 H     #>  9 NA         NA I     #> 10 NA          3 J      dat %>%  nabular() %>%  mutate(    num = impute_below(num),    int = impute_below(int),    fct = impute_below(fct),  ) #> # A tibble: 10 × 6 #>        num     int fct     num_NA int_NA fct_NA #>                   #>  1  0.721  10      A       !NA    !NA    !NA    #>  2 -0.303   5      B       !NA    !NA    !NA    #>  3 -0.730   6      C       !NA    !NA    !NA    #>  4  0.0459 -0.0751 D       !NA    NA     !NA    #>  5  0.271   7      missing !NA    !NA    NA     #>  6 -1.74    5      F       !NA    !NA    !NA    #>  7 -0.290   1      missing !NA    !NA    NA     #>  8 -0.686   5      H       !NA    !NA    !NA    #>  9 -2.01    0.0370 I       NA     NA     !NA    #> 10 -2.03    3      J       NA     !NA    !NA     dat %>%  nabular() %>%  mutate(    across(      where(is.numeric),      impute_below    )  ) #> # A tibble: 10 × 6 #>        num     int fct   num_NA int_NA fct_NA #>                 #>  1  0.721  10      A     !NA    !NA    !NA    #>  2 -0.303   5      B     !NA    !NA    !NA    #>  3 -0.730   6      C     !NA    !NA    !NA    #>  4  0.0459 -0.0751 D     !NA    NA     !NA    #>  5  0.271   7      NA    !NA    !NA    NA     #>  6 -1.74    5      F     !NA    !NA    !NA    #>  7 -0.290   1      NA    !NA    !NA    NA     #>  8 -0.686   5      H     !NA    !NA    !NA    #>  9 -2.01    0.0370 I     NA     NA     !NA    #> 10 -2.03    3      J     NA     !NA    !NA     dat %>%  nabular() %>%  mutate(    across(      c(\"num\", \"int\"),      impute_below    )  ) #> # A tibble: 10 × 6 #>        num     int fct   num_NA int_NA fct_NA #>                 #>  1  0.721  10      A     !NA    !NA    !NA    #>  2 -0.303   5      B     !NA    !NA    !NA    #>  3 -0.730   6      C     !NA    !NA    !NA    #>  4  0.0459 -0.0751 D     !NA    NA     !NA    #>  5  0.271   7      NA    !NA    !NA    NA     #>  6 -1.74    5      F     !NA    !NA    !NA    #>  7 -0.290   1      NA    !NA    !NA    NA     #>  8 -0.686   5      H     !NA    !NA    !NA    #>  9 -2.01    0.0370 I     NA     NA     !NA    #> 10 -2.03    3      J     NA     !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_below.numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute numeric values below a range for graphical exploration — impute_below.numeric","title":"Impute numeric values below a range for graphical exploration — impute_below.numeric","text":"Impute numeric values range graphical exploration","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below.numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute numeric values below a range for graphical exploration — impute_below.numeric","text":"","code":"# S3 method for numeric impute_below(   x,   prop_below = 0.1,   jitter = 0.05,   seed_shift = 2017 - 7 - 1 - 1850,   ... )"},{"path":"http://naniar.njtierney.com/reference/impute_below.numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute numeric values below a range for graphical exploration — impute_below.numeric","text":"x variable interest shift prop_below degree shift values. default jitter amount jitter add. default 0.05 seed_shift random seed set, like ... extra arguments pass","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute data with values shifted 10 percent below range. — impute_below_all","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"can useful exploratory graphics impute data outside range data. impute_below_all imputes variables missings values 10\\ values adds new string label.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"","code":"impute_below_all(.tbl, prop_below = 0.1, jitter = 0.05, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":".tbl data.frame prop_below degree shift values. default jitter amount jitter add. default 0.05 ... additional arguments","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"","code":"# you can impute data like so: airquality %>%   impute_below_all() #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30  # However, this does not show you WHERE the missing values are. # to keep track of them, you want to use `bind_shadow()` first.  airquality %>%   bind_shadow() %>%   impute_below_all() #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1  41     190     7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2  36     118     8      72     5     2 !NA      !NA        !NA     !NA     #>  3  12     149    12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4  18     313    11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5 -19.7   -33.6  14.3    56     5     5 NA       NA         !NA     !NA     #>  6  28     -33.1  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7  23     299     8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8  19      99    13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9   8      19    20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10 -18.5   194     8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA   # This identifies where the missing values are located, which means you # can do things like this:  if (FALSE) { library(ggplot2) airquality %>%   bind_shadow() %>%   impute_below_all() %>%   # identify where there are missings across rows.   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +   geom_point() # Note that this ^^ is a long version of `geom_miss_point()`. }"},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_below — impute_below_at","title":"Scoped variants of impute_below — impute_below_at","text":"impute_below imputes missing values set percentage range data. impute many variables , recommend use across function workflow, shown examples impute_below(). impute_below_all operates variables. impute variables satisfy specific condition, use scoped variants, impute_below_at, impute_below_if. use _at effectively, must know _at`` affects variables selected character vector, vars()`.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_below — impute_below_at","text":"","code":"impute_below_at(.tbl, .vars, prop_below = 0.1, jitter = 0.05, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_below — impute_below_at","text":".tbl data.frame .vars variables impute prop_below degree shift values. default jitter amount jitter add. default 0.05 ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_below — impute_below_at","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_below — impute_below_at","text":"","code":"# select variables starting with a particular string. impute_below_at(airquality,                 .vars = c(\"Ozone\", \"Solar.R\")) #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30  impute_below_at(airquality, .vars = 1:2) #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30  if (FALSE) { library(dplyr) impute_below_at(airquality,                 .vars = vars(Ozone))  library(ggplot2) airquality %>%   bind_shadow() %>%   impute_below_at(vars(Ozone, Solar.R)) %>%   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +          geom_point() }"},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_below — impute_below_if","title":"Scoped variants of impute_below — impute_below_if","text":"impute_below operates variables. impute variables satisfy specific condition, use scoped variants, impute_below_at, impute_below_if.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_below — impute_below_if","text":"","code":"impute_below_if(.tbl, .predicate, prop_below = 0.1, jitter = 0.05, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_below — impute_below_if","text":".tbl data.frame .predicate predicate function (.numeric) prop_below degree shift values. default jitter amount jitter add. default 0.05 ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_below — impute_below_if","text":"dataset values imputed","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_below — impute_below_if","text":"","code":"airquality %>%   impute_below_if(.predicate = is.numeric) #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30"},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute a factor value into a vector with missing values — impute_factor","title":"Impute a factor value into a vector with missing values — impute_factor","text":"imputing fixed factor levels. adds new imputed value end levels vector. generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute a factor value into a vector with missing values — impute_factor","text":"","code":"impute_factor(x, value)  # S3 method for default impute_factor(x, value)  # S3 method for factor impute_factor(x, value)  # S3 method for character impute_factor(x, value)  # S3 method for shade impute_factor(x, value)"},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute a factor value into a vector with missing values — impute_factor","text":"x vector value factor impute","code":""},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute a factor value into a vector with missing values — impute_factor","text":"vector factor values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute a factor value into a vector with missing values — impute_factor","text":"","code":"vec <- factor(LETTERS[1:10])  vec[sample(1:10, 3)] <- NA  vec #>  [1] A    B    C    D    E     G     I     #> Levels: A B C D E F G H I J  impute_factor(vec, \"wat\") #>  [1] A   B   C   D   E   wat G   wat I   wat #> Levels: A B C D E F G H I J wat  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1  0.0742     4 A     #>  2 -0.201     NA B     #>  3  1.51      NA C     #>  4 NA          4 D     #>  5 NA          3 E     #>  6  1.37       6 NA    #>  7  1.06       3 G     #>  8 -1.00       3 NA    #>  9  0.880      4 I     #> 10  0.987      7 J      dat %>%   nabular() %>%   mutate(     num = impute_fixed(num, -9999),     int = impute_zero(int),     fct = impute_factor(fct, \"out\")   ) #> # A tibble: 10 × 6 #>           num   int fct   num_NA int_NA fct_NA #>                  #>  1     0.0742     4 A     !NA    !NA    !NA    #>  2    -0.201      0 B     !NA    NA     !NA    #>  3     1.51       0 C     !NA    NA     !NA    #>  4 -9999          4 D     NA     !NA    !NA    #>  5 -9999          3 E     NA     !NA    !NA    #>  6     1.37       6 out   !NA    !NA    NA     #>  7     1.06       3 G     !NA    !NA    !NA    #>  8    -1.00       3 out   !NA    !NA    NA     #>  9     0.880      4 I     !NA    !NA    !NA    #> 10     0.987      7 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute a fixed value into a vector with missing values — impute_fixed","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"","code":"impute_fixed(x, value)  # S3 method for default impute_fixed(x, value)"},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"x vector value value impute","code":""},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"vector fixed values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  vec #>  [1] -1.4057189  2.4815984         NA  0.4221011 -0.6310333  0.5363818 #>  [7] -1.4013999         NA         NA -0.1498814  impute_fixed(vec, -999) #>  [1]   -1.4057189    2.4815984 -999.0000000    0.4221011   -0.6310333 #>  [6]    0.5363818   -1.4013999 -999.0000000 -999.0000000   -0.1498814  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1 NA          1 A     #>  2 NA         NA B     #>  3 -0.813     NA C     #>  4 -0.0584     1 NA    #>  5 -2.26       9 E     #>  6 -1.14       7 F     #>  7 -0.294      2 G     #>  8 -0.493      5 NA    #>  9  1.95       7 I     #> 10  0.349      3 J      dat %>%   nabular() %>%   mutate(     num = impute_fixed(num, -9999),     int = impute_zero(int),     fct = impute_factor(fct, \"out\")   ) #> # A tibble: 10 × 6 #>           num   int fct   num_NA int_NA fct_NA #>                  #>  1 -9999          1 A     NA     !NA    !NA    #>  2 -9999          0 B     NA     NA     !NA    #>  3    -0.813      0 C     !NA    NA     !NA    #>  4    -0.0584     1 out   !NA    !NA    NA     #>  5    -2.26       9 E     !NA    !NA    !NA    #>  6    -1.14       7 F     !NA    !NA    !NA    #>  7    -0.294      2 G     !NA    !NA    !NA    #>  8    -0.493      5 out   !NA    !NA    NA     #>  9     1.95       7 I     !NA    !NA    !NA    #> 10     0.349      3 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute the mean value into a vector with missing values — impute_mean","title":"Impute the mean value into a vector with missing values — impute_mean","text":"can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute the mean value into a vector with missing values — impute_mean","text":"","code":"impute_mean(x)  # S3 method for default impute_mean(x)  # S3 method for factor impute_mean(x)"},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute the mean value into a vector with missing values — impute_mean","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute the mean value into a vector with missing values — impute_mean","text":"vector mean values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute the mean value into a vector with missing values — impute_mean","text":"","code":"library(dplyr) vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_mean(vec) #>  [1]  0.5301633  0.7462801  1.3446716  0.5301633 -0.4860343  0.8088018 #>  [7]  0.3218633  0.0581052  0.5301633  0.9174552  dat <- tibble(   num = rnorm(10),   int = as.integer(rpois(10, 5)),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>       num   int fct   #>        #>  1 NA         7 A     #>  2  1.35     NA B     #>  3 NA         4 C     #>  4  0.590     4 NA    #>  5  1.23      5 E     #>  6 -1.42     NA F     #>  7 -1.04      9 NA    #>  8  1.28      3 H     #>  9 -1.31      7 I     #> 10  1.60      6 J      dat %>%   nabular() %>%   mutate(     num = impute_mean(num),     int = impute_mean(int),     fct = impute_mean(fct),   ) #> # A tibble: 10 × 6 #>       num   int fct   num_NA int_NA fct_NA #>              #>  1  0.285  7    A     NA     !NA    !NA    #>  2  1.35   5.62 B     !NA    NA     !NA    #>  3  0.285  4    C     NA     !NA    !NA    #>  4  0.590  4    J     !NA    !NA    NA     #>  5  1.23   5    E     !NA    !NA    !NA    #>  6 -1.42   5.62 F     !NA    NA     !NA    #>  7 -1.04   9    J     !NA    !NA    NA     #>  8  1.28   3    H     !NA    !NA    !NA    #>  9 -1.31   7    I     !NA    !NA    !NA    #> 10  1.60   6    J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       where(is.numeric),       impute_mean     )   ) #> # A tibble: 10 × 6 #>       num   int fct   num_NA int_NA fct_NA #>              #>  1  0.285  7    A     NA     !NA    !NA    #>  2  1.35   5.62 B     !NA    NA     !NA    #>  3  0.285  4    C     NA     !NA    !NA    #>  4  0.590  4    NA    !NA    !NA    NA     #>  5  1.23   5    E     !NA    !NA    !NA    #>  6 -1.42   5.62 F     !NA    NA     !NA    #>  7 -1.04   9    NA    !NA    !NA    NA     #>  8  1.28   3    H     !NA    !NA    !NA    #>  9 -1.31   7    I     !NA    !NA    !NA    #> 10  1.60   6    J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       c(\"num\", \"int\"),       impute_mean     )   ) #> # A tibble: 10 × 6 #>       num   int fct   num_NA int_NA fct_NA #>              #>  1  0.285  7    A     NA     !NA    !NA    #>  2  1.35   5.62 B     !NA    NA     !NA    #>  3  0.285  4    C     NA     !NA    !NA    #>  4  0.590  4    NA    !NA    !NA    NA     #>  5  1.23   5    E     !NA    !NA    !NA    #>  6 -1.42   5.62 F     !NA    NA     !NA    #>  7 -1.04   9    NA    !NA    !NA    NA     #>  8  1.28   3    H     !NA    !NA    !NA    #>  9 -1.31   7    I     !NA    !NA    !NA    #> 10  1.60   6    J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute the median value into a vector with missing values — impute_median","title":"Impute the median value into a vector with missing values — impute_median","text":"Impute median value vector missing values","code":""},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute the median value into a vector with missing values — impute_median","text":"","code":"impute_median(x)  # S3 method for default impute_median(x)  # S3 method for factor impute_median(x)"},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute the median value into a vector with missing values — impute_median","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute the median value into a vector with missing values — impute_median","text":"vector median values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute the median value into a vector with missing values — impute_median","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_median(vec) #>  [1] -0.7289445 -0.9342655 -1.2804352 -0.3857275 -0.3857275  0.2674186 #>  [7] -0.3857275 -0.1630526  0.2793086 -0.3857275  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = as.integer(rpois(10, 5)),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1  0.449      8 A     #>  2 -0.306      6 B     #>  3 -0.0124    11 C     #>  4 -1.09       6 D     #>  5 NA          3 NA    #>  6 -0.0466     4 F     #>  7 -1.44      NA G     #>  8 NA          5 H     #>  9 -0.397     NA NA    #> 10  0.664      3 J      dat %>%   nabular() %>%   mutate(     num = impute_median(num),     int = impute_median(int),   ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1  0.449    8   A     !NA    !NA    !NA    #>  2 -0.306    6   B     !NA    !NA    !NA    #>  3 -0.0124  11   C     !NA    !NA    !NA    #>  4 -1.09     6   D     !NA    !NA    !NA    #>  5 -0.177    3   NA    NA     !NA    NA     #>  6 -0.0466   4   F     !NA    !NA    !NA    #>  7 -1.44     5.5 G     !NA    NA     !NA    #>  8 -0.177    5   H     NA     !NA    !NA    #>  9 -0.397    5.5 NA    !NA    NA     NA     #> 10  0.664    3   J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       where(is.numeric),       impute_median     )   ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1  0.449    8   A     !NA    !NA    !NA    #>  2 -0.306    6   B     !NA    !NA    !NA    #>  3 -0.0124  11   C     !NA    !NA    !NA    #>  4 -1.09     6   D     !NA    !NA    !NA    #>  5 -0.177    3   NA    NA     !NA    NA     #>  6 -0.0466   4   F     !NA    !NA    !NA    #>  7 -1.44     5.5 G     !NA    NA     !NA    #>  8 -0.177    5   H     NA     !NA    !NA    #>  9 -0.397    5.5 NA    !NA    NA     NA     #> 10  0.664    3   J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       c(\"num\", \"int\"),       impute_median     )  ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1  0.449    8   A     !NA    !NA    !NA    #>  2 -0.306    6   B     !NA    !NA    !NA    #>  3 -0.0124  11   C     !NA    !NA    !NA    #>  4 -1.09     6   D     !NA    !NA    !NA    #>  5 -0.177    3   NA    NA     !NA    NA     #>  6 -0.0466   4   F     !NA    !NA    !NA    #>  7 -1.44     5.5 G     !NA    NA     !NA    #>  8 -0.177    5   H     NA     !NA    !NA    #>  9 -0.397    5.5 NA    !NA    NA     NA     #> 10  0.664    3   J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute the mode value into a vector with missing values — impute_mode","title":"Impute the mode value into a vector with missing values — impute_mode","text":"Impute mode value vector missing values","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute the mode value into a vector with missing values — impute_mode","text":"","code":"impute_mode(x)  # S3 method for default impute_mode(x)  # S3 method for integer impute_mode(x)  # S3 method for factor impute_mode(x)"},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute the mode value into a vector with missing values — impute_mode","text":"x vector approach adapts examples provided stack overflow, integer case, just rounds value. can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute the mode value into a vector with missing values — impute_mode","text":"vector mode values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute the mode value into a vector with missing values — impute_mode","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_mode(vec) #>  [1]  1.371914294  0.413380638 -1.669939609  0.069016915  0.069016915 #>  [6] -1.158660464  0.001326548 -1.771324596  0.018509032  0.069016915  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1 -0.100      6 A     #>  2 -0.342      4 B     #>  3 -0.108     NA C     #>  4  1.51       6 D     #>  5  0.202     10 NA    #>  6  2.26       3 F     #>  7 NA         NA NA    #>  8 -1.30       8 H     #>  9 NA          6 I     #> 10 -0.0709     3 J       dat %>%   nabular() %>%   mutate(     num = impute_mode(num),     int = impute_mode(int),     fct = impute_mode(fct)   ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1 -0.100      6 A     !NA    !NA    !NA    #>  2 -0.342      4 B     !NA    !NA    !NA    #>  3 -0.108      6 C     !NA    NA     !NA    #>  4  1.51       6 D     !NA    !NA    !NA    #>  5  0.202     10 B     !NA    !NA    NA     #>  6  2.26       3 F     !NA    !NA    !NA    #>  7 -0.0964     6 B     NA     NA     NA     #>  8 -1.30       8 H     !NA    !NA    !NA    #>  9 -0.0964     6 I     NA     !NA    !NA    #> 10 -0.0709     3 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute zero into a vector with missing values — impute_zero","title":"Impute zero into a vector with missing values — impute_zero","text":"can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute zero into a vector with missing values — impute_zero","text":"","code":"impute_zero(x)"},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute zero into a vector with missing values — impute_zero","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute zero into a vector with missing values — impute_zero","text":"vector fixed values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute zero into a vector with missing values — impute_zero","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  vec #>  [1]          NA -0.25705805 -1.41422789  0.01887104  0.35647301  0.89006961 #>  [7]          NA          NA  0.43744452 -1.65606748  impute_zero(vec) #>  [1]  0.00000000 -0.25705805 -1.41422789  0.01887104  0.35647301  0.89006961 #>  [7]  0.00000000  0.00000000  0.43744452 -1.65606748  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>       num   int fct   #>        #>  1 -1.30      5 A     #>  2  2.19      3 B     #>  3 -0.303    NA C     #>  4  1.36      2 NA    #>  5 -0.744     5 E     #>  6 NA         6 NA    #>  7  1.76      7 G     #>  8  0.724    NA H     #>  9 NA         3 I     #> 10  1.38      7 J      dat %>%   nabular() %>%   mutate(     num = impute_fixed(num, -9999),     int = impute_zero(int),     fct = impute_factor(fct, \"out\")   ) #> # A tibble: 10 × 6 #>          num   int fct   num_NA int_NA fct_NA #>                 #>  1    -1.30      5 A     !NA    !NA    !NA    #>  2     2.19      3 B     !NA    !NA    !NA    #>  3    -0.303     0 C     !NA    NA     !NA    #>  4     1.36      2 out   !NA    !NA    NA     #>  5    -0.744     5 E     !NA    !NA    !NA    #>  6 -9999         6 out   NA     !NA    NA     #>  7     1.76      7 G     !NA    !NA    !NA    #>  8     0.724     0 H     !NA    NA     !NA    #>  9 -9999         3 I     NA     !NA    !NA    #> 10     1.38      7 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect if this is a shade — is_shade","title":"Detect if this is a shade — is_shade","text":"tells us column shade","code":""},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect if this is a shade — is_shade","text":"","code":"is_shade(x)  are_shade(x)  any_shade(x)"},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect if this is a shade — is_shade","text":"x vector want test shade","code":""},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect if this is a shade — is_shade","text":"logical - shade?","code":""},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect if this is a shade — is_shade","text":"","code":"xs <- shade(c(NA, 1, 2, \"3\"))  is_shade(xs) #> [1] TRUE are_shade(xs) #> [1] TRUE TRUE TRUE TRUE any_shade(xs) #> [1] TRUE  aq_s <- as_shadow(airquality)  is_shade(aq_s) #> [1] FALSE are_shade(aq_s) #>   Ozone_NA Solar.R_NA    Wind_NA    Temp_NA   Month_NA     Day_NA  #>       TRUE       TRUE       TRUE       TRUE       TRUE       TRUE  any_shade(aq_s) #> [1] TRUE any_shade(airquality) #> [1] FALSE"},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":null,"dir":"Reference","previous_headings":"","what":"Label a missing from one column — label_miss_1d","title":"Label a missing from one column — label_miss_1d","text":"Label whether value missing row one columns.","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label a missing from one column — label_miss_1d","text":"","code":"label_miss_1d(x1)"},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label a missing from one column — label_miss_1d","text":"x1 variable dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label a missing from one column — label_miss_1d","text":"vector indicating whether rows missing values","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Label a missing from one column — label_miss_1d","text":"can generalise label_miss work number variables?","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label a missing from one column — label_miss_1d","text":"","code":"label_miss_1d(airquality$Ozone) #>   [1] Not Missing Not Missing Not Missing Not Missing Missing     Not Missing #>   [7] Not Missing Not Missing Not Missing Missing     Not Missing Not Missing #>  [13] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [19] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [25] Missing     Missing     Missing     Not Missing Not Missing Not Missing #>  [31] Not Missing Missing     Missing     Missing     Missing     Missing     #>  [37] Missing     Not Missing Missing     Not Missing Not Missing Missing     #>  [43] Missing     Not Missing Missing     Missing     Not Missing Not Missing #>  [49] Not Missing Not Missing Not Missing Missing     Missing     Missing     #>  [55] Missing     Missing     Missing     Missing     Missing     Missing     #>  [61] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #>  [67] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #>  [73] Not Missing Not Missing Missing     Not Missing Not Missing Not Missing #>  [79] Not Missing Not Missing Not Missing Not Missing Missing     Missing     #>  [85] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [91] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [97] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #> [103] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [109] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [115] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [121] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [127] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [133] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [139] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [145] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #> [151] Not Missing Not Missing Not Missing #> Levels: Missing Not Missing"},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":null,"dir":"Reference","previous_headings":"","what":"label_miss_2d — label_miss_2d","title":"label_miss_2d — label_miss_2d","text":"Label whether value missing either row two columns.","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"label_miss_2d — label_miss_2d","text":"","code":"label_miss_2d(x1, x2)"},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"label_miss_2d — label_miss_2d","text":"x1 variable dataframe x2 another variable dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"label_miss_2d — label_miss_2d","text":"vector indicating whether rows missing values","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"label_miss_2d — label_miss_2d","text":"","code":"label_miss_2d(airquality$Ozone, airquality$Solar.R) #>   [1] Not Missing Not Missing Not Missing Not Missing Missing     Missing     #>   [7] Not Missing Not Missing Not Missing Missing     Missing     Not Missing #>  [13] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [19] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [25] Missing     Missing     Missing     Not Missing Not Missing Not Missing #>  [31] Not Missing Missing     Missing     Missing     Missing     Missing     #>  [37] Missing     Not Missing Missing     Not Missing Not Missing Missing     #>  [43] Missing     Not Missing Missing     Missing     Not Missing Not Missing #>  [49] Not Missing Not Missing Not Missing Missing     Missing     Missing     #>  [55] Missing     Missing     Missing     Missing     Missing     Missing     #>  [61] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #>  [67] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #>  [73] Not Missing Not Missing Missing     Not Missing Not Missing Not Missing #>  [79] Not Missing Not Missing Not Missing Not Missing Missing     Missing     #>  [85] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [91] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #>  [97] Missing     Missing     Not Missing Not Missing Not Missing Missing     #> [103] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [109] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [115] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [121] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [127] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [133] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [139] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [145] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #> [151] Not Missing Not Missing Not Missing #> Levels: Missing Not Missing"},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":null,"dir":"Reference","previous_headings":"","what":"Is there a missing value in the row of a dataframe? — label_missings","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"Creates character vector describing presence/absence missing values","code":""},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"","code":"label_missings(data, ..., missing = \"Missing\", complete = \"Not Missing\")"},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"data dataframe set vectors length ... extra variable label missing character label values missing - defaults \"Missing\" complete character character label values complete - defaults \"Missing\"","code":""},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"character vector \"Missing\" \"Missing\".","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"","code":"label_missings(airquality) #>   [1] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>   [6] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [11] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [16] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [21] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [26] \"Missing\"     \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [31] \"Not Missing\" \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     #>  [36] \"Missing\"     \"Missing\"     \"Not Missing\" \"Missing\"     \"Not Missing\" #>  [41] \"Not Missing\" \"Missing\"     \"Missing\"     \"Not Missing\" \"Missing\"     #>  [46] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [51] \"Not Missing\" \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     #>  [56] \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     #>  [61] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [66] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [71] \"Not Missing\" \"Missing\"     \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [76] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [81] \"Not Missing\" \"Not Missing\" \"Missing\"     \"Missing\"     \"Not Missing\" #>  [86] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [91] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [96] \"Missing\"     \"Missing\"     \"Missing\"     \"Not Missing\" \"Not Missing\" #> [101] \"Not Missing\" \"Missing\"     \"Missing\"     \"Not Missing\" \"Not Missing\" #> [106] \"Not Missing\" \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [111] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #> [116] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     \"Not Missing\" #> [121] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [126] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [131] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [136] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [141] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [146] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #> [151] \"Not Missing\" \"Not Missing\" \"Not Missing\"  if (FALSE) { library(dplyr)  airquality %>%   mutate(is_missing = label_missings(airquality)) %>%   head()  airquality %>%   mutate(is_missing = label_missings(airquality,                                      missing = \"definitely missing\",                                      complete = \"absolutely complete\")) %>%   head() }"},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":null,"dir":"Reference","previous_headings":"","what":"Little's missing completely at random (MCAR) test — mcar_test","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Use Little's (1988) test statistic assess data missing completely random (MCAR). null hypothesis test data MCAR, test statistic chi-squared value. example shows output mcar_test(airquality). Given high statistic value low p-value, can conclude airquality data missing completely random.","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"","code":"mcar_test(data)"},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"data data frame","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"tibble::tibble() one row four columns: statistic Chi-squared statistic Little's test df Degrees freedom used chi-squared statistic p.value P-value chi-squared statistic missing.patterns Number missing data patterns data","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Code adapted LittleMCAR() now-orphaned BaylorEdPsych package: https://rdrr.io/cran/BaylorEdPsych/man/LittleMCAR.html. code adapted Eric Stemmler: https://web.archive.org/web/20201120030409/https://stats-bayes.com/post/2020/08/14/r-function--little-s-test--data-missing-completely--random/ using Maximum likelihood estimation norm.","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Little, Roderick J. . 1988. \"Test Missing Completely Random Multivariate Data Missing Values.\" Journal American Statistical Association 83 (404): 1198--1202. doi:10.1080/01621459.1988.10478722 .","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Andrew Heiss, andrew@andrewheiss.com","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"","code":"mcar_test(airquality) #> # A tibble: 1 × 4 #>   statistic    df p.value missing.patterns #>                        #> 1      35.1    14 0.00142                4 mcar_test(oceanbuoys) #> # A tibble: 1 × 4 #>   statistic    df p.value missing.patterns #>                        #> 1      747.    31       0                6  # If there are non-numeric columns, there will be a warning mcar_test(riskfactors) #> Warning: NAs introduced by coercion to integer range #> # A tibble: 1 × 4 #>   statistic    df  p.value missing.patterns #>                         #> 1     1741.  1319 3.32e-14               48"},{"path":"http://naniar.njtierney.com/reference/miss-pct-prop-defunct.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","title":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","text":"Defunct. Please see prop_miss_var(), prop_complete_var(), pct_miss_var(), pct_complete_var(), prop_miss_case(), prop_complete_case(), pct_miss_case(), pct_complete_case().","code":""},{"path":"http://naniar.njtierney.com/reference/miss-pct-prop-defunct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","text":"","code":"miss_var_prop(...)  complete_var_prop(...)  miss_var_pct(...)  complete_var_pct(...)  miss_case_prop(...)  complete_case_prop(...)  miss_case_pct(...)  complete_case_pct(...)"},{"path":"http://naniar.njtierney.com/reference/miss-pct-prop-defunct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","text":"... arguments","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the missingness in each case — miss_case_cumsum","title":"Summarise the missingness in each case — miss_case_cumsum","text":"Provide data.frame containing case (row), number percent missing values case.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the missingness in each case — miss_case_cumsum","text":"","code":"miss_case_cumsum(data)"},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the missingness in each case — miss_case_cumsum","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the missingness in each case — miss_case_cumsum","text":"tibble containing number percent missing data case","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the missingness in each case — miss_case_cumsum","text":"","code":"miss_case_cumsum(airquality) #> Warning: `miss_case_cumsum()` was deprecated in naniar 1.1.0. #> ℹ Please use `miss_var_summary(data, add_cumsum = TRUE)` #> # A tibble: 153 × 3 #>     case n_miss n_miss_cumsum #>                #>  1     1      0             0 #>  2     2      0             0 #>  3     3      0             0 #>  4     4      0             0 #>  5     5      2             2 #>  6     6      1             3 #>  7     7      0             3 #>  8     8      0             3 #>  9     9      0             3 #> 10    10      1             4 #> # ℹ 143 more rows  if (FALSE) { library(dplyr)  airquality %>%   group_by(Month) %>%   miss_case_cumsum() }"},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the missingness in each case — miss_case_summary","title":"Summarise the missingness in each case — miss_case_summary","text":"Provide summary case data number, percent missings, cumulative sum missings order variables. default, orders missings variable.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the missingness in each case — miss_case_summary","text":"","code":"miss_case_summary(data, order = TRUE, add_cumsum = FALSE, ...)"},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the missingness in each case — miss_case_summary","text":"data data.frame order logical indicating whether order result n_miss. Defaults TRUE. FALSE, order cases order input. add_cumsum logical indicating whether add cumulative sum missings data. can useful exploring patterns nonresponse. calculated cumulative sum missings variables first presented function. ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the missingness in each case — miss_case_summary","text":"tibble percent missing data case.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the missingness in each case — miss_case_summary","text":"","code":"miss_case_summary(airquality) #> # A tibble: 153 × 3 #>     case n_miss pct_miss #>           #>  1     5      2     33.3 #>  2    27      2     33.3 #>  3     6      1     16.7 #>  4    10      1     16.7 #>  5    11      1     16.7 #>  6    25      1     16.7 #>  7    26      1     16.7 #>  8    32      1     16.7 #>  9    33      1     16.7 #> 10    34      1     16.7 #> # ℹ 143 more rows  if (FALSE) { # works with group_by from dplyr library(dplyr) airquality %>%   group_by(Month) %>%   miss_case_summary() }"},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Tabulate missings in cases. — miss_case_table","title":"Tabulate missings in cases. — miss_case_table","text":"Provide tidy table number cases 0, 1, 2, n, missing values proportion number cases cases make .","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tabulate missings in cases. — miss_case_table","text":"","code":"miss_case_table(data)"},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tabulate missings in cases. — miss_case_table","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tabulate missings in cases. — miss_case_table","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tabulate missings in cases. — miss_case_table","text":"","code":"miss_case_table(airquality) #> # A tibble: 3 × 3 #>   n_miss_in_case n_cases pct_cases #>                     #> 1              0     111     72.5  #> 2              1      40     26.1  #> 3              2       2      1.31 if (FALSE) { library(dplyr) airquality %>%   group_by(Month) %>%   miss_case_table() }"},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportions of missings in data, variables, and cases. — miss_prop_summary","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"Return missing data info dataframe, variables, cases. Specifically, returning many elements dataframe contain missing value, many elements variable contain missing value, many elements case contain missing.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"","code":"miss_prop_summary(data)"},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"","code":"miss_prop_summary(airquality) #> # A tibble: 1 × 3 #>       df   var  case #>       #> 1 0.0479 0.333 0.275 if (FALSE) { library(dplyr) # respects dplyr::group_by airquality %>% group_by(Month) %>% miss_prop_summary() }"},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":null,"dir":"Reference","previous_headings":"","what":"Search and present different kinds of missing values — miss_scan_count","title":"Search and present different kinds of missing values — miss_scan_count","text":"Searching different kinds missing values really annoying. values like -99 data, , encoded missing, can difficult ascertain , , . miss_scan_count makes easier users search particular occurrences values across variables. Note searches done regular expressions, special ways searching text. See example see look characters like ?.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Search and present different kinds of missing values — miss_scan_count","text":"","code":"miss_scan_count(data, search)"},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Search and present different kinds of missing values — miss_scan_count","text":"data data search values search ","code":""},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Search and present different kinds of missing values — miss_scan_count","text":"dataframe occurrences values searched ","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Search and present different kinds of missing values — miss_scan_count","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,  ~specials,                          1,   \"A\",   -100, \"?\",                          3,   \"N/A\", -99,  \"!\",                          NA,  NA,    -98,  \".\",                          -99, \"E\",   -101, \"*\",                          -98, \"F\",   -1,  \"-\")  miss_scan_count(dat_ms,-99) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            1 #> 2 y            0 #> 3 z            1 #> 4 specials     0 miss_scan_count(dat_ms,c(-99,-98)) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            0 #> 3 z            2 #> 4 specials     0 miss_scan_count(dat_ms,c(\"-99\",\"-98\",\"N/A\")) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            1 #> 3 z            2 #> 4 specials     0 miss_scan_count(dat_ms, \"\\\\?\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"\\\\!\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"\\\\.\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"\\\\*\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"-\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            0 #> 3 z            5 #> 4 specials     1 miss_scan_count(dat_ms,common_na_strings) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            4 #> 2 y            4 #> 3 z            5 #> 4 specials     5"},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Collate summary measures from naniar into one tibble — miss_summary","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"miss_summary performs missing data helper summaries puts lists within tibble","code":""},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"","code":"miss_summary(data, order = TRUE)"},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"data dataframe order whether order result n_miss","code":""},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"tibble missing data summaries","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"","code":"s_miss <- miss_summary(airquality) s_miss$miss_df_prop #> [1] 0.04793028 s_miss$miss_case_table #> [[1]] #> # A tibble: 3 × 3 #>   n_miss_in_case n_cases pct_cases #>                     #> 1              0     111     72.5  #> 2              1      40     26.1  #> 3              2       2      1.31 #>  s_miss$miss_var_summary #> [[1]] #> # A tibble: 6 × 3 #>   variable n_miss pct_miss #>             #> 1 Ozone        37    24.2  #> 2 Solar.R       7     4.58 #> 3 Wind          0     0    #> 4 Temp          0     0    #> 5 Month         0     0    #> 6 Day           0     0    #>  # etc, etc, etc.  if (FALSE) { library(dplyr) s_miss_group <- group_by(airquality, Month) %>% miss_summary() s_miss_group$miss_df_prop s_miss_group$miss_case_table # etc, etc, etc. }"},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"Calculate cumulative sum number & percentage missingness variable.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"","code":"miss_var_cumsum(data)"},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"tibble cumulative sum missing data variable","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"","code":"miss_var_cumsum(airquality) #> Warning: `miss_var_cumsum()` was deprecated in naniar 1.1.0. #> ℹ Please use `miss_var_summary(data, add_cumsum = TRUE)` #> # A tibble: 6 × 3 #>   variable n_miss n_miss_cumsum #>                  #> 1 Ozone        37            37 #> 2 Solar.R       7            44 #> 3 Wind          0            44 #> 4 Temp          0            44 #> 5 Month         0            44 #> 6 Day           0            44 if (FALSE) { library(dplyr)  # respects dplyr::group_by  airquality %>%   group_by(Month) %>%   miss_var_cumsum() }"},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the number of missing and complete values in a single run — miss_var_run","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"us useful find number missing values occur single run. function, miss_var_run(), returns dataframe column names \"run_length\" \"is_na\", describe length run, whether run describes missing value.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"","code":"miss_var_run(data, var)"},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"data data.frame var bare variable name","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"dataframe column names \"run_length\" \"is_na\", describe length run, whether run describes missing value.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"","code":"miss_var_run(pedestrian, hourly_counts) #> # A tibble: 35 × 2 #>    run_length is_na    #>              #>  1       6628 complete #>  2          1 missing  #>  3       5250 complete #>  4        624 missing  #>  5       3652 complete #>  6          1 missing  #>  7       1290 complete #>  8        744 missing  #>  9       7420 complete #> 10          1 missing  #> # ℹ 25 more rows  if (FALSE) { # find the number of runs missing/complete for each month library(dplyr)   pedestrian %>%   group_by(month) %>%   miss_var_run(hourly_counts)  library(ggplot2)  # explore the number of missings in a given run miss_var_run(pedestrian, hourly_counts) %>%   filter(is_na == \"missing\") %>%   count(run_length) %>%   ggplot(aes(x = run_length,              y = n)) +       geom_col()  # look at the number of missing values and the run length of these. miss_var_run(pedestrian, hourly_counts) %>%   ggplot(aes(x = is_na,              y = run_length)) +       geom_boxplot()  # using group_by  pedestrian %>%    group_by(month) %>%    miss_var_run(hourly_counts) }"},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"summarise missing values time series object can useful calculate number missing values given time period. miss_var_span takes data.frame object, variable, span_every argument returns dataframe containing number missing values within span. number observations perfect multiple span length, final span whatever last remainder . example, pedestrian dataset 37,700 rows. span set 4000, 1700 rows remaining. can provided using modulo (%%): nrow(data) %% 4000. remainder number provided n_in_span.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"","code":"miss_var_span(data, var, span_every)"},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"data data.frame var bare unquoted variable name interest. span_every integer describing length span explored","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"dataframe variables n_miss, n_complete, prop_miss, prop_complete, describe number, proportion missing complete values within given time span. final variable, n_in_span states many observations span.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"","code":"miss_var_span(data = pedestrian,              var = hourly_counts,              span_every = 168) #> # A tibble: 225 × 6 #>    span_counter n_miss n_complete prop_miss prop_complete n_in_span #>                                       #>  1            1      0        168         0             1       168 #>  2            2      0        168         0             1       168 #>  3            3      0        168         0             1       168 #>  4            4      0        168         0             1       168 #>  5            5      0        168         0             1       168 #>  6            6      0        168         0             1       168 #>  7            7      0        168         0             1       168 #>  8            8      0        168         0             1       168 #>  9            9      0        168         0             1       168 #> 10           10      0        168         0             1       168 #> # ℹ 215 more rows  if (FALSE) {  library(dplyr)  pedestrian %>%    group_by(month) %>%      miss_var_span(var = hourly_counts,                    span_every = 168) }"},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the missingness in each variable — miss_var_summary","title":"Summarise the missingness in each variable — miss_var_summary","text":"Provide summary variable number, percent missings, cumulative sum missings order variables. default, orders missings variable.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the missingness in each variable — miss_var_summary","text":"","code":"miss_var_summary(data, order = FALSE, add_cumsum = FALSE, digits, ...)"},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the missingness in each variable — miss_var_summary","text":"data data.frame order logical indicating whether order result n_miss. Defaults TRUE. FALSE, order variables order input. add_cumsum logical indicating whether add cumulative sum missings data. can useful exploring patterns nonresponse. calculated cumulative sum missings variables first presented function. digits many digits display pct_miss column. Useful working small amounts missing data. ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the missingness in each variable — miss_var_summary","text":"tibble percent missing data variable","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Summarise the missingness in each variable — miss_var_summary","text":"n_miss_cumsum calculated cumulative sum missings variables order given data entering function","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the missingness in each variable — miss_var_summary","text":"","code":"miss_var_summary(airquality) #> # A tibble: 6 × 3 #>   variable n_miss pct_miss #>             #> 1 Ozone        37    24.2  #> 2 Solar.R       7     4.58 #> 3 Wind          0     0    #> 4 Temp          0     0    #> 5 Month         0     0    #> 6 Day           0     0    miss_var_summary(oceanbuoys, order = TRUE) #> # A tibble: 8 × 3 #>   variable   n_miss pct_miss #>               #> 1 humidity       93   12.6   #> 2 air_temp_c     81   11.0   #> 3 sea_temp_c      3    0.408 #> 4 year            0    0     #> 5 latitude        0    0     #> 6 longitude       0    0     #> 7 wind_ew         0    0     #> 8 wind_ns         0    0      if (FALSE) { # works with group_by from dplyr library(dplyr) airquality %>%   group_by(Month) %>%   miss_var_summary() }"},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Tabulate the missings in the variables — miss_var_table","title":"Tabulate the missings in the variables — miss_var_table","text":"Provide tidy table number variables 0, 1, 2, n, missing values proportion number variables variables make .","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tabulate the missings in the variables — miss_var_table","text":"","code":"miss_var_table(data)"},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tabulate the missings in the variables — miss_var_table","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tabulate the missings in the variables — miss_var_table","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tabulate the missings in the variables — miss_var_table","text":"","code":"miss_var_table(airquality) #> # A tibble: 3 × 3 #>   n_miss_in_var n_vars pct_vars #>                  #> 1             0      4     66.7 #> 2             7      1     16.7 #> 3            37      1     16.7 if (FALSE) { library(dplyr) airquality %>%   group_by(Month) %>%   miss_var_table() }"},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":null,"dir":"Reference","previous_headings":"","what":"Which variables contain missing values? — miss_var_which","title":"Which variables contain missing values? — miss_var_which","text":"can helpful writing functions just return names variables contain missing values. miss_var_which returns vector variable names contain missings. return NULL missings.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which variables contain missing values? — miss_var_which","text":"","code":"miss_var_which(data)"},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which variables contain missing values? — miss_var_which","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which variables contain missing values? — miss_var_which","text":"character vector variable names","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which variables contain missing values? — miss_var_which","text":"","code":"miss_var_which(airquality) #> [1] \"Ozone\"   \"Solar.R\"  miss_var_which(mtcars) #> NULL"},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":null,"dir":"Reference","previous_headings":"","what":"The number of variables with complete values — n-var-case-complete","title":"The number of variables with complete values — n-var-case-complete","text":"function calculates number variables contain complete value","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The number of variables with complete values — n-var-case-complete","text":"","code":"n_var_complete(data)  n_case_complete(data)"},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The number of variables with complete values — n-var-case-complete","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The number of variables with complete values — n-var-case-complete","text":"integer number complete values","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The number of variables with complete values — n-var-case-complete","text":"","code":"# how many variables contain complete values? n_var_complete(airquality) #> [1] 4 n_case_complete(airquality) #> [1] 111"},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":null,"dir":"Reference","previous_headings":"","what":"The number of variables or cases with missing values — n-var-case-miss","title":"The number of variables or cases with missing values — n-var-case-miss","text":"function calculates number variables cases contain missing value","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The number of variables or cases with missing values — n-var-case-miss","text":"","code":"n_var_miss(data)  n_case_miss(data)"},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The number of variables or cases with missing values — n-var-case-miss","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The number of variables or cases with missing values — n-var-case-miss","text":"integer, number missings","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The number of variables or cases with missing values — n-var-case-miss","text":"","code":"# how many variables contain missing values? n_var_miss(airquality) #> [1] 2 n_case_miss(airquality) #> [1] 42"},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the number of complete values — n_complete","title":"Return the number of complete values — n_complete","text":"complement n_miss","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the number of complete values — n_complete","text":"","code":"n_complete(x)"},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the number of complete values — n_complete","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the number of complete values — n_complete","text":"numeric number complete values","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the number of complete values — n_complete","text":"","code":"n_complete(airquality) #> [1] 874 n_complete(airquality$Ozone) #> [1] 116"},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the number of complete values in each row — n_complete_row","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"Substitute rowSums(!.na(data)) also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"","code":"n_complete_row(data)"},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"numeric vector number complete values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"","code":"n_complete_row(airquality) #>   [1] 6 6 6 6 4 5 6 6 6 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 4 6 6 6 6 5 5 5 5 5 5 #>  [38] 6 5 6 6 5 5 6 5 5 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 6 6 6 5 6 6 6 6 6 6 5 6 6 #>  [75] 5 6 6 6 6 6 6 6 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 6 6 6 5 5 6 6 6 5 6 6 6 6 #> [112] 6 6 6 5 6 6 6 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 #> [149] 6 5 6 6 6"},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the number of missing values — n_miss","title":"Return the number of missing values — n_miss","text":"Substitute sum(.na(data))","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the number of missing values — n_miss","text":"","code":"n_miss(x)"},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the number of missing values — n_miss","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the number of missing values — n_miss","text":"numeric number missing values","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the number of missing values — n_miss","text":"","code":"n_miss(airquality) #> [1] 44 n_miss(airquality$Ozone) #> [1] 37"},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the number of missing values in each row — n_miss_row","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"Substitute rowSums(.na(data)), also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"","code":"n_miss_row(data)"},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"numeric vector number missing values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"","code":"n_miss_row(airquality) #>   [1] 0 0 0 0 2 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 0 0 0 0 1 1 1 1 1 1 #>  [38] 0 1 0 0 1 1 0 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 #>  [75] 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 #> [112] 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [149] 0 1 0 0 0"},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert data into nabular form by binding shade to it — nabular","title":"Convert data into nabular form by binding shade to it — nabular","text":"Binding shadow matrix regular dataframe converts nabular data, makes easier visualise work missing data.","code":""},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert data into nabular form by binding shade to it — nabular","text":"","code":"nabular(data, only_miss = FALSE, ...)"},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert data into nabular form by binding shade to it — nabular","text":"data dataframe only_miss logical - FALSE (default) bind dataframe variables duplicated shadow. Setting TRUE bind variables variables contain missing values. See examples details. ... extra options pass recode_shadow() - work progress.","code":""},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert data into nabular form by binding shade to it — nabular","text":"data added variable shifted suffix _NA","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert data into nabular form by binding shade to it — nabular","text":"","code":"aq_nab <- nabular(airquality) aq_s <- bind_shadow(airquality)  all.equal(aq_nab, aq_s) #> [1] TRUE"},{"path":"http://naniar.njtierney.com/reference/naniar-ggproto.html","id":null,"dir":"Reference","previous_headings":"","what":"naniar-ggproto — GeomMissPoint","title":"naniar-ggproto — GeomMissPoint","text":"stat geom overrides using ggproto ggplot2 make naniar work.","code":""},{"path":"http://naniar.njtierney.com/reference/naniar-ggproto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"naniar-ggproto — GeomMissPoint","text":"","code":"StatMissPoint"},{"path":"http://naniar.njtierney.com/reference/naniar-ggproto.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"naniar-ggproto — GeomMissPoint","text":"object class StatMissPoint (inherits Stat, ggproto, gg) length 6.","code":""},{"path":"http://naniar.njtierney.com/reference/naniar.html","id":null,"dir":"Reference","previous_headings":"","what":"naniar — naniar","title":"naniar — naniar","text":"naniar package make easier summarise handle missing values R. strives way consistent tidyverse principles possible.  work fully discussed Tierney & Cook (2023) doi:10.18637/jss.v105.i07.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/naniar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"naniar — naniar","text":"Maintainer: Nicholas Tierney nicholas.tierney@gmail.com (ORCID) Authors: Di Cook dicook@monash.edu (ORCID) Miles McBain miles.mcbain@gmail.com (ORCID) Colin Fay contact@colinfay.(ORCID) contributors: Mitchell O'Hara-Wild [contributor] Jim Hester james.f.hester@gmail.com [contributor] Luke Smith [contributor] Andrew Heiss andrew@andrewheiss.com (ORCID) [contributor]","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":null,"dir":"Reference","previous_headings":"","what":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"Real-time data moored ocean buoys improved detection, understanding prediction El Ni'o La Ni'. data collected Tropical Atmosphere Ocean project (https://www.pmel.noaa.gov/gtmba/pmel-theme/pacific-ocean-tao).","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"","code":"data(oceanbuoys)"},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"object class tbl_df (inherits tbl, data.frame) 736 rows 8 columns.","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"https://www.pmel.noaa.gov/tao/drupal/disdel/","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"Format: data frame 736 observations following 8 variables. year numeric levels 1993 1997. latitude numeric levels -5  -2 0. longitude numeric levels -110 -95. sea_temp_c Sea surface temperature(degree Celsius),  measured TAO buoys one meter surface. air_temp_c Air temperature(degree Celsius), measured TAO buoys three meters sea surface. humidity Relative humidity(%), measured TAO buoys 3 meters sea surface. wind_ew East-West wind vector components(M/s).  TAO buoys measure wind speed direction four meters sea surface. positive, East-West component wind blowing towards East. negative, component blowing towards West. wind_ns North-South wind vector components(M/s). TAO buoys measure wind speed direction four meters sea surface. positive, North-South component wind blowing towards North. negative, component blowing towards South.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"","code":"vis_miss(oceanbuoys)   # Look at the missingness in the variables miss_var_summary(oceanbuoys) #> # A tibble: 8 × 3 #>   variable   n_miss pct_miss #>               #> 1 humidity       93   12.6   #> 2 air_temp_c     81   11.0   #> 3 sea_temp_c      3    0.408 #> 4 year            0    0     #> 5 latitude        0    0     #> 6 longitude       0    0     #> 7 wind_ew         0    0     #> 8 wind_ns         0    0     if (FALSE) { # Look at the missingness in air temperature and humidity library(ggplot2) p <- ggplot(oceanbuoys,        aes(x = air_temp_c,            y = humidity)) +      geom_miss_point()   p   # for each year?  p + facet_wrap(~year)   # this shows that there are more missing values in humidity in 1993, and  # more air temperature missing values in 1997   # see more examples in the vignette, \"getting started with naniar\". }"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":null,"dir":"Reference","previous_headings":"","what":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"Calculate percentage cases (rows) contain missing complete value.","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"","code":"pct_miss_case(data)  pct_complete_case(data)"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"numeric percentage cases contain missing complete value","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"","code":"pct_miss_case(airquality) #> [1] 27.45098 pct_complete_case(airquality) #> [1] 72.54902"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":null,"dir":"Reference","previous_headings":"","what":"Percentage of variables containing missings or complete values — pct-miss-complete-var","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"Calculate percentage variables contain single missing complete value.","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"","code":"pct_miss_var(data)  pct_complete_var(data)"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"numeric percent variables contain missing complete data","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"","code":"prop_miss_var(airquality) #> [1] 0.3333333 prop_complete_var(airquality) #> [1] 0.6666667"},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the percent of complete values — pct_complete","title":"Return the percent of complete values — pct_complete","text":"complement pct_miss","code":""},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the percent of complete values — pct_complete","text":"","code":"pct_complete(x)"},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the percent of complete values — pct_complete","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the percent of complete values — pct_complete","text":"numeric percent complete values","code":""},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the percent of complete values — pct_complete","text":"","code":"pct_complete(airquality) #> [1] 95.20697 pct_complete(airquality$Ozone) #> [1] 75.81699"},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the percent of missing values — pct_miss","title":"Return the percent of missing values — pct_miss","text":"shorthand mean(.na(x)) * 100","code":""},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the percent of missing values — pct_miss","text":"","code":"pct_miss(x)"},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the percent of missing values — pct_miss","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the percent of missing values — pct_miss","text":"numeric percent missing values x","code":""},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the percent of missing values — pct_miss","text":"","code":"pct_miss(airquality) #> [1] 4.793028 pct_miss(airquality$Ozone) #> [1] 24.18301"},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":null,"dir":"Reference","previous_headings":"","what":"Pedestrian count information around Melbourne for 2016 — pedestrian","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"dataset contains hourly counts pedestrians 4 sensors around Melbourne: Birrarung Marr, Bourke Street Mall, Flagstaff station, Spencer St-Collins St (south), recorded January 1st 2016 00:00:00 December 31st 2016 23:00:00. data made free publicly available https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-monthly-counts-per-hour/information/","code":""},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"","code":"data(pedestrian)"},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"tibble 37,700 rows 9 variables: hourly_counts (integer) number pedestrians counted sensor time date_time (POSIXct, POSIXt) time count taken year (integer) Year record month (factor) Month record ordered factor (1 = January, 12 = December) month_day (integer) Full day month week_day (factor) Full day week ordered factor (1 = Sunday, 7 = Saturday) hour (integer) hour day 24 hour format sensor_id (integer) id sensor sensor_name (character) full name sensor","code":""},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-monthly-counts-per-hour/information/","code":""},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"","code":"# explore the missingness with vis_miss  vis_miss(pedestrian)   # Look at the missingness in the variables miss_var_summary(pedestrian) #> # A tibble: 9 × 3 #>   variable      n_miss pct_miss #>                  #> 1 hourly_counts   2548     6.76 #> 2 date_time          0     0    #> 3 year               0     0    #> 4 month              0     0    #> 5 month_day          0     0    #> 6 week_day           0     0    #> 7 hour               0     0    #> 8 sensor_id          0     0    #> 9 sensor_name        0     0     if (FALSE) { # There is only missingness in hourly_counts # Look at the missingness over a rolling window library(ggplot2) gg_miss_span(pedestrian, hourly_counts, span_every = 3000) }"},{"path":"http://naniar.njtierney.com/reference/plotly_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Plotly helpers (Convert a geom to a ","title":"Plotly helpers (Convert a geom to a ","text":"Helper functions make easier automatically create plotly charts. function makes possible convert ggplot2 geoms included ggplot2 . Users need use function. exists purely allow package authors write conversion method(s).","code":""},{"path":"http://naniar.njtierney.com/reference/plotly_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plotly helpers (Convert a geom to a ","text":"","code":"to_basic.GeomMissPoint(data, prestats_data, layout, params, p, ...)"},{"path":"http://naniar.njtierney.com/reference/plotly_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plotly helpers (Convert a geom to a ","text":"data data returned ggplot2::ggplot_build(). prestats_data data statistics computed. layout panel layout. params parameters geom, statistic, 'constant' aesthetics p ggplot2 object (conversion may depend scales, instance). ... currently ignored","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"Calculate proportion cases (rows) contain missing complete values.","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"","code":"prop_miss_case(data)  prop_complete_case(data)"},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"numeric proportion cases contain missing complete value","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"","code":"prop_miss_case(airquality) #> [1] 0.2745098 prop_complete_case(airquality) #> [1] 0.7254902"},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportion of variables containing missings or complete values — prop-miss-complete-var","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"Calculate proportion variables contain single missing complete values.","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"","code":"prop_miss_var(data)  prop_complete_var(data)"},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"numeric proportion variables contain missing complete data","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"","code":"prop_miss_var(airquality) #> [1] 0.3333333 prop_complete_var(airquality) #> [1] 0.6666667"},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the proportion of complete values — prop_complete","title":"Return the proportion of complete values — prop_complete","text":"complement prop_miss","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the proportion of complete values — prop_complete","text":"","code":"prop_complete(x)"},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the proportion of complete values — prop_complete","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the proportion of complete values — prop_complete","text":"numeric proportion complete values","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the proportion of complete values — prop_complete","text":"","code":"prop_complete(airquality) #> [1] 0.9520697 prop_complete(airquality$Ozone) #> [1] 0.7581699"},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the proportion of missing values in each row — prop_complete_row","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"Substitute rowMeans(!.na(data)), also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"","code":"prop_complete_row(data)"},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"numeric vector proportion missing values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"","code":"prop_complete_row(airquality) #>   [1] 1.0000000 1.0000000 1.0000000 1.0000000 0.6666667 0.8333333 1.0000000 #>   [8] 1.0000000 1.0000000 0.8333333 0.8333333 1.0000000 1.0000000 1.0000000 #>  [15] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #>  [22] 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 0.6666667 1.0000000 #>  [29] 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 0.8333333 0.8333333 #>  [36] 0.8333333 0.8333333 1.0000000 0.8333333 1.0000000 1.0000000 0.8333333 #>  [43] 0.8333333 1.0000000 0.8333333 0.8333333 1.0000000 1.0000000 1.0000000 #>  [50] 1.0000000 1.0000000 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 #>  [57] 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 1.0000000 1.0000000 #>  [64] 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #>  [71] 1.0000000 0.8333333 1.0000000 1.0000000 0.8333333 1.0000000 1.0000000 #>  [78] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 #>  [85] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #>  [92] 1.0000000 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 0.8333333 #>  [99] 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 1.0000000 1.0000000 #> [106] 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [113] 1.0000000 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000 0.8333333 #> [120] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [127] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [134] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [141] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [148] 1.0000000 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000"},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the proportion of missing values — prop_miss","title":"Return the proportion of missing values — prop_miss","text":"shorthand mean(.na(x))","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the proportion of missing values — prop_miss","text":"","code":"prop_miss(x)"},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the proportion of missing values — prop_miss","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the proportion of missing values — prop_miss","text":"numeric proportion missing values x","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the proportion of missing values — prop_miss","text":"","code":"prop_miss(airquality) #> [1] 0.04793028 prop_miss(airquality$Ozone) #> [1] 0.2418301"},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the proportion of missing values in each row — prop_miss_row","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"Substitute rowMeans(.na(data)), also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"","code":"prop_miss_row(data)"},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"numeric vector proportion missing values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"","code":"prop_miss_row(airquality) #>   [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.3333333 0.1666667 0.0000000 #>   [8] 0.0000000 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 0.0000000 #>  [15] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #>  [22] 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.3333333 0.0000000 #>  [29] 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 0.1666667 #>  [36] 0.1666667 0.1666667 0.0000000 0.1666667 0.0000000 0.0000000 0.1666667 #>  [43] 0.1666667 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 0.0000000 #>  [50] 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 #>  [57] 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.0000000 0.0000000 #>  [64] 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #>  [71] 0.0000000 0.1666667 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 #>  [78] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 #>  [85] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #>  [92] 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 #>  [99] 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 #> [106] 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [113] 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.1666667 #> [120] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [127] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [134] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [141] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [148] 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000"},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add special missing values to the shadow matrix — recode_shadow","title":"Add special missing values to the shadow matrix — recode_shadow","text":"can useful add special missing values, naniar supports recode_shadow function.","code":""},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add special missing values to the shadow matrix — recode_shadow","text":"","code":"recode_shadow(data, ...)  # S3 method for data.frame recode_shadow(data, ...)  # S3 method for grouped_df recode_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add special missing values to the shadow matrix — recode_shadow","text":"data data.frame ... sequence two-sided formulas dplyr::case_when, wrapper function .written around .","code":""},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add special missing values to the shadow matrix — recode_shadow","text":"dataframe altered shadows","code":""},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add special missing values to the shadow matrix — recode_shadow","text":"","code":"df <- tibble::tribble( ~wind, ~temp, -99,    45, 68,    NA, 72,    25 )  dfs <- bind_shadow(df)  dfs #> # A tibble: 3 × 4 #>    wind  temp wind_NA temp_NA #>           #> 1   -99    45 !NA     !NA     #> 2    68    NA !NA     NA      #> 3    72    25 !NA     !NA      recode_shadow(dfs, temp = .where(wind == -99 ~ \"bananas\")) #> # A tibble: 3 × 4 #>    wind  temp wind_NA temp_NA    #>              #> 1   -99    45 !NA     NA_bananas #> 2    68    NA !NA     NA         #> 3    72    25 !NA     !NA         recode_shadow(dfs,               temp = .where(wind == -99 ~ \"bananas\")) %>% recode_shadow(wind = .where(wind == -99 ~ \"apples\")) #> # A tibble: 3 × 4 #>    wind  temp wind_NA   temp_NA    #>                #> 1   -99    45 NA_apples NA_bananas #> 2    68    NA !NA       NA         #> 3    72    25 !NA       !NA"},{"path":"http://naniar.njtierney.com/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. magrittr %>% rlang are_na, is_na visdat vis_miss","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace NA value with provided value — replace_na_with","title":"Replace NA value with provided value — replace_na_with","text":"function helps replace NA values single provided value. can classed kind imputation, powered impute_fixed(). However, generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm(). See tidyr::replace_na() slightly different approach, dplyr::coalesce() replacing NAs values vectors, dplyr::na_if() replace specified values NA.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace NA value with provided value — replace_na_with","text":"","code":"replace_na_with(x, value)"},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace NA value with provided value — replace_na_with","text":"x vector value value replace","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace NA value with provided value — replace_na_with","text":"vector replaced values","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace NA value with provided value — replace_na_with","text":"","code":"library(naniar) x <- c(1:5, NA, NA, NA) x #> [1]  1  2  3  4  5 NA NA NA replace_na_with(x, 0L) #> [1] 1 2 3 4 5 0 0 0 replace_na_with(x, \"unknown\") #> [1] \"1\"       \"2\"       \"3\"       \"4\"       \"5\"       \"unknown\" \"unknown\" #> [8] \"unknown\"  library(dplyr) dat <- tibble(   ones = c(NA,1,1),   twos = c(NA,NA, 2),   threes = c(NA, NA, NA) )  dat #> # A tibble: 3 × 3 #>    ones  twos threes #>       #> 1    NA    NA NA     #> 2     1    NA NA     #> 3     1     2 NA      dat %>%   mutate(     ones = replace_na_with(ones, 0),     twos = replace_na_with(twos, -99),     threes = replace_na_with(threes, \"unknowns\")   ) #> # A tibble: 3 × 3 #>    ones  twos threes   #>         #> 1     0   -99 unknowns #> 2     1   -99 unknowns #> 3     1     2 unknowns  dat %>%   mutate(     across(       everything(),       \\(x) replace_na_with(x, -99)     )   ) #> # A tibble: 3 × 3 #>    ones  twos threes #>       #> 1   -99   -99    -99 #> 2     1   -99    -99 #> 3     1     2    -99"},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace values with missings — replace_to_na","title":"Replace values with missings — replace_to_na","text":"function Defunct, please see replace_with_na().","code":""},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace values with missings — replace_to_na","text":"","code":"replace_to_na(...)"},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace values with missings — replace_to_na","text":"... additional arguments methods.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace values with missings — replace_to_na","text":"values replaced NA","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace values with missings — replace_with_na","title":"Replace values with missings — replace_with_na","text":"Specify variables values want convert missing values. complement tidyr::replace_na.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace values with missings — replace_with_na","text":"","code":"replace_with_na(data, replace = list(), ...)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace values with missings — replace_with_na","text":"data data.frame replace named list given NA replace values column ... additional arguments methods. Currently unused","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace values with missings — replace_with_na","text":"Dataframe values replaced NA.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace values with missings — replace_with_na","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                          1,   \"A\",   -100,                          3,   \"N/A\", -99,                          NA,  NA,    -98,                          -99, \"E\",   -101,                          -98, \"F\",   -1)  replace_with_na(dat_ms,                replace = list(x = -99)) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  replace_with_na(dat_ms,              replace = list(x = c(-99, -98))) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4    NA E      -101 #> 5    NA F        -1  replace_with_na(dat_ms,              replace = list(x = c(-99, -98),                           y = c(\"N/A\"),                           z = c(-101))) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4    NA E        NA #> 5    NA F        -1"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace all values with NA where a certain condition is met — replace_with_na_all","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"function takes dataframe replaces values meet condition specified NA value, following special syntax.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"","code":"replace_with_na_all(data, condition)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"data dataframe condition condition required TRUE set NA. , condition specified formula, following syntax: ~.x {condition}. example, writing ~.x < 20 mean \"variable value less 20, replace NA\".","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  dat_ms #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1 #replace all instances of -99 with NA replace_with_na_all(data = dat_ms,                     condition = ~.x == -99) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A      NA #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  # replace all instances of -99 or -98, or \"N/A\" with NA replace_with_na_all(dat_ms,                     condition = ~.x %in% c(-99, -98, \"N/A\")) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA       NA #> 3    NA NA       NA #> 4    NA E      -101 #> 5    NA F        -1 # replace all instances of common na strings replace_with_na_all(dat_ms,                     condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  # where works with functions replace_with_na_all(airquality, ~ sqrt(.x) < 5) #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190    NA    67    NA    NA #>  2    36     118    NA    72    NA    NA #>  3    NA     149    NA    74    NA    NA #>  4    NA     313    NA    62    NA    NA #>  5    NA      NA    NA    56    NA    NA #>  6    28      NA    NA    66    NA    NA #>  7    NA     299    NA    65    NA    NA #>  8    NA      99    NA    59    NA    NA #>  9    NA      NA    NA    61    NA    NA #> 10    NA     194    NA    69    NA    NA #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"Replace specified variables NA certain condition met","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"","code":"replace_with_na_at(data, .vars, condition)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"data dataframe .vars character string variables replace NA values condition condition required TRUE set NA. , condition specified formula, following syntax: ~.x {condition}. example, writing ~.x < 20 mean \"variable value less 20, replace NA\".","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  dat_ms #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  replace_with_na_at(data = dat_ms,                  .vars = \"x\",                  condition = ~.x == -99) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  replace_with_na_at(data = dat_ms,                  .vars = c(\"x\",\"z\"),                  condition = ~.x == -99) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A      NA #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  # replace using values in common_na_strings replace_with_na_at(data = dat_ms,                  .vars = c(\"x\",\"z\"),                  condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"Replace values NA based condition, variables meet predicate","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"","code":"replace_with_na_if(data, .predicate, condition)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"data Dataframe .predicate predicate function applied columns logical vector. condition condition required TRUE set NA. , condition specified formula, following syntax: ~.x {condition}. example, writing ~.x < 20 mean \"variable value less 20, replace NA\".","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"Dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  dat_ms #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  replace_with_na_if(data = dat_ms,                  .predicate = is.character,                  condition = ~.x == \"N/A\") #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1 replace_with_na_if(data = dat_ms,                    .predicate = is.character,                    condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  replace_with_na(dat_ms,               to_na = list(x = c(-99, -98),                            y = c(\"N/A\"),                            z = c(-101))) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1"},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":null,"dir":"Reference","previous_headings":"","what":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"data subset 2009 survey BRFSS, ongoing data collection program designed measure behavioral risk factors adult population (18 years age older) living households.","code":""},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"","code":"data(riskfactors)"},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"object class tbl_df (inherits tbl, data.frame) 245 rows 34 columns.","code":""},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"https://www.cdc.gov/brfss/annual_data/annual_2009.htm","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"","code":"vis_miss(riskfactors)   # Look at the missingness in the variables miss_var_summary(riskfactors) #> # A tibble: 34 × 3 #>    variable      n_miss pct_miss #>                   #>  1 pregnant         215    87.8  #>  2 smoke_stop       212    86.5  #>  3 smoke_last       161    65.7  #>  4 drink_average    135    55.1  #>  5 drink_days       134    54.7  #>  6 smoke_days       128    52.2  #>  7 health_poor      113    46.1  #>  8 bmi               11     4.49 #>  9 weight_lbs        10     4.08 #> 10 diet_fruit         8     3.27 #> # ℹ 24 more rows  # and now as a plot gg_miss_var(riskfactors)   if (FALSE) { # Look at the missingness in bmi and poor health library(ggplot2) p <- ggplot(riskfactors,        aes(x = health_poor,            y = bmi)) +      geom_miss_point()   p   # for each sex?  p + facet_wrap(~sex)  # for each education bracket?  p + facet_wrap(~education) }"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_mean — scoped-impute_mean","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"impute_mean imputes mean vector. get work variables, use impute_mean_all. impute variables satisfy specific condition, use scoped variants, impute_below_at, impute_below_if. use _at effectively, must know _at`` affects variables selected character vector, vars()`.","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"","code":"impute_mean_all(.tbl)  impute_mean_at(.tbl, .vars)  impute_mean_if(.tbl, .predicate)"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_mean — scoped-impute_mean","text":".tbl data.frame .vars variables impute .predicate variables impute","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"","code":"# select variables starting with a particular string. impute_mean_all(airquality) #>         Ozone  Solar.R Wind Temp Month Day #> 1    41.00000 190.0000  7.4   67     5   1 #> 2    36.00000 118.0000  8.0   72     5   2 #> 3    12.00000 149.0000 12.6   74     5   3 #> 4    18.00000 313.0000 11.5   62     5   4 #> 5    42.12931 185.9315 14.3   56     5   5 #> 6    28.00000 185.9315 14.9   66     5   6 #> 7    23.00000 299.0000  8.6   65     5   7 #> 8    19.00000  99.0000 13.8   59     5   8 #> 9     8.00000  19.0000 20.1   61     5   9 #> 10   42.12931 194.0000  8.6   69     5  10 #> 11    7.00000 185.9315  6.9   74     5  11 #> 12   16.00000 256.0000  9.7   69     5  12 #> 13   11.00000 290.0000  9.2   66     5  13 #> 14   14.00000 274.0000 10.9   68     5  14 #> 15   18.00000  65.0000 13.2   58     5  15 #> 16   14.00000 334.0000 11.5   64     5  16 #> 17   34.00000 307.0000 12.0   66     5  17 #> 18    6.00000  78.0000 18.4   57     5  18 #> 19   30.00000 322.0000 11.5   68     5  19 #> 20   11.00000  44.0000  9.7   62     5  20 #> 21    1.00000   8.0000  9.7   59     5  21 #> 22   11.00000 320.0000 16.6   73     5  22 #> 23    4.00000  25.0000  9.7   61     5  23 #> 24   32.00000  92.0000 12.0   61     5  24 #> 25   42.12931  66.0000 16.6   57     5  25 #> 26   42.12931 266.0000 14.9   58     5  26 #> 27   42.12931 185.9315  8.0   57     5  27 #> 28   23.00000  13.0000 12.0   67     5  28 #> 29   45.00000 252.0000 14.9   81     5  29 #> 30  115.00000 223.0000  5.7   79     5  30 #> 31   37.00000 279.0000  7.4   76     5  31 #> 32   42.12931 286.0000  8.6   78     6   1 #> 33   42.12931 287.0000  9.7   74     6   2 #> 34   42.12931 242.0000 16.1   67     6   3 #> 35   42.12931 186.0000  9.2   84     6   4 #> 36   42.12931 220.0000  8.6   85     6   5 #> 37   42.12931 264.0000 14.3   79     6   6 #> 38   29.00000 127.0000  9.7   82     6   7 #> 39   42.12931 273.0000  6.9   87     6   8 #> 40   71.00000 291.0000 13.8   90     6   9 #> 41   39.00000 323.0000 11.5   87     6  10 #> 42   42.12931 259.0000 10.9   93     6  11 #> 43   42.12931 250.0000  9.2   92     6  12 #> 44   23.00000 148.0000  8.0   82     6  13 #> 45   42.12931 332.0000 13.8   80     6  14 #> 46   42.12931 322.0000 11.5   79     6  15 #> 47   21.00000 191.0000 14.9   77     6  16 #> 48   37.00000 284.0000 20.7   72     6  17 #> 49   20.00000  37.0000  9.2   65     6  18 #> 50   12.00000 120.0000 11.5   73     6  19 #> 51   13.00000 137.0000 10.3   76     6  20 #> 52   42.12931 150.0000  6.3   77     6  21 #> 53   42.12931  59.0000  1.7   76     6  22 #> 54   42.12931  91.0000  4.6   76     6  23 #> 55   42.12931 250.0000  6.3   76     6  24 #> 56   42.12931 135.0000  8.0   75     6  25 #> 57   42.12931 127.0000  8.0   78     6  26 #> 58   42.12931  47.0000 10.3   73     6  27 #> 59   42.12931  98.0000 11.5   80     6  28 #> 60   42.12931  31.0000 14.9   77     6  29 #> 61   42.12931 138.0000  8.0   83     6  30 #> 62  135.00000 269.0000  4.1   84     7   1 #> 63   49.00000 248.0000  9.2   85     7   2 #> 64   32.00000 236.0000  9.2   81     7   3 #> 65   42.12931 101.0000 10.9   84     7   4 #> 66   64.00000 175.0000  4.6   83     7   5 #> 67   40.00000 314.0000 10.9   83     7   6 #> 68   77.00000 276.0000  5.1   88     7   7 #> 69   97.00000 267.0000  6.3   92     7   8 #> 70   97.00000 272.0000  5.7   92     7   9 #> 71   85.00000 175.0000  7.4   89     7  10 #> 72   42.12931 139.0000  8.6   82     7  11 #> 73   10.00000 264.0000 14.3   73     7  12 #> 74   27.00000 175.0000 14.9   81     7  13 #> 75   42.12931 291.0000 14.9   91     7  14 #> 76    7.00000  48.0000 14.3   80     7  15 #> 77   48.00000 260.0000  6.9   81     7  16 #> 78   35.00000 274.0000 10.3   82     7  17 #> 79   61.00000 285.0000  6.3   84     7  18 #> 80   79.00000 187.0000  5.1   87     7  19 #> 81   63.00000 220.0000 11.5   85     7  20 #> 82   16.00000   7.0000  6.9   74     7  21 #> 83   42.12931 258.0000  9.7   81     7  22 #> 84   42.12931 295.0000 11.5   82     7  23 #> 85   80.00000 294.0000  8.6   86     7  24 #> 86  108.00000 223.0000  8.0   85     7  25 #> 87   20.00000  81.0000  8.6   82     7  26 #> 88   52.00000  82.0000 12.0   86     7  27 #> 89   82.00000 213.0000  7.4   88     7  28 #> 90   50.00000 275.0000  7.4   86     7  29 #> 91   64.00000 253.0000  7.4   83     7  30 #> 92   59.00000 254.0000  9.2   81     7  31 #> 93   39.00000  83.0000  6.9   81     8   1 #> 94    9.00000  24.0000 13.8   81     8   2 #> 95   16.00000  77.0000  7.4   82     8   3 #> 96   78.00000 185.9315  6.9   86     8   4 #> 97   35.00000 185.9315  7.4   85     8   5 #> 98   66.00000 185.9315  4.6   87     8   6 #> 99  122.00000 255.0000  4.0   89     8   7 #> 100  89.00000 229.0000 10.3   90     8   8 #> 101 110.00000 207.0000  8.0   90     8   9 #> 102  42.12931 222.0000  8.6   92     8  10 #> 103  42.12931 137.0000 11.5   86     8  11 #> 104  44.00000 192.0000 11.5   86     8  12 #> 105  28.00000 273.0000 11.5   82     8  13 #> 106  65.00000 157.0000  9.7   80     8  14 #> 107  42.12931  64.0000 11.5   79     8  15 #> 108  22.00000  71.0000 10.3   77     8  16 #> 109  59.00000  51.0000  6.3   79     8  17 #> 110  23.00000 115.0000  7.4   76     8  18 #> 111  31.00000 244.0000 10.9   78     8  19 #> 112  44.00000 190.0000 10.3   78     8  20 #> 113  21.00000 259.0000 15.5   77     8  21 #> 114   9.00000  36.0000 14.3   72     8  22 #> 115  42.12931 255.0000 12.6   75     8  23 #> 116  45.00000 212.0000  9.7   79     8  24 #> 117 168.00000 238.0000  3.4   81     8  25 #> 118  73.00000 215.0000  8.0   86     8  26 #> 119  42.12931 153.0000  5.7   88     8  27 #> 120  76.00000 203.0000  9.7   97     8  28 #> 121 118.00000 225.0000  2.3   94     8  29 #> 122  84.00000 237.0000  6.3   96     8  30 #> 123  85.00000 188.0000  6.3   94     8  31 #> 124  96.00000 167.0000  6.9   91     9   1 #> 125  78.00000 197.0000  5.1   92     9   2 #> 126  73.00000 183.0000  2.8   93     9   3 #> 127  91.00000 189.0000  4.6   93     9   4 #> 128  47.00000  95.0000  7.4   87     9   5 #> 129  32.00000  92.0000 15.5   84     9   6 #> 130  20.00000 252.0000 10.9   80     9   7 #> 131  23.00000 220.0000 10.3   78     9   8 #> 132  21.00000 230.0000 10.9   75     9   9 #> 133  24.00000 259.0000  9.7   73     9  10 #> 134  44.00000 236.0000 14.9   81     9  11 #> 135  21.00000 259.0000 15.5   76     9  12 #> 136  28.00000 238.0000  6.3   77     9  13 #> 137   9.00000  24.0000 10.9   71     9  14 #> 138  13.00000 112.0000 11.5   71     9  15 #> 139  46.00000 237.0000  6.9   78     9  16 #> 140  18.00000 224.0000 13.8   67     9  17 #> 141  13.00000  27.0000 10.3   76     9  18 #> 142  24.00000 238.0000 10.3   68     9  19 #> 143  16.00000 201.0000  8.0   82     9  20 #> 144  13.00000 238.0000 12.6   64     9  21 #> 145  23.00000  14.0000  9.2   71     9  22 #> 146  36.00000 139.0000 10.3   81     9  23 #> 147   7.00000  49.0000 10.3   69     9  24 #> 148  14.00000  20.0000 16.6   63     9  25 #> 149  30.00000 193.0000  6.9   70     9  26 #> 150  42.12931 145.0000 13.2   77     9  27 #> 151  14.00000 191.0000 14.3   75     9  28 #> 152  18.00000 131.0000  8.0   76     9  29 #> 153  20.00000 223.0000 11.5   68     9  30  impute_mean_at(airquality,                .vars = c(\"Ozone\", \"Solar.R\")) #>         Ozone  Solar.R Wind Temp Month Day #> 1    41.00000 190.0000  7.4   67     5   1 #> 2    36.00000 118.0000  8.0   72     5   2 #> 3    12.00000 149.0000 12.6   74     5   3 #> 4    18.00000 313.0000 11.5   62     5   4 #> 5    42.12931 185.9315 14.3   56     5   5 #> 6    28.00000 185.9315 14.9   66     5   6 #> 7    23.00000 299.0000  8.6   65     5   7 #> 8    19.00000  99.0000 13.8   59     5   8 #> 9     8.00000  19.0000 20.1   61     5   9 #> 10   42.12931 194.0000  8.6   69     5  10 #> 11    7.00000 185.9315  6.9   74     5  11 #> 12   16.00000 256.0000  9.7   69     5  12 #> 13   11.00000 290.0000  9.2   66     5  13 #> 14   14.00000 274.0000 10.9   68     5  14 #> 15   18.00000  65.0000 13.2   58     5  15 #> 16   14.00000 334.0000 11.5   64     5  16 #> 17   34.00000 307.0000 12.0   66     5  17 #> 18    6.00000  78.0000 18.4   57     5  18 #> 19   30.00000 322.0000 11.5   68     5  19 #> 20   11.00000  44.0000  9.7   62     5  20 #> 21    1.00000   8.0000  9.7   59     5  21 #> 22   11.00000 320.0000 16.6   73     5  22 #> 23    4.00000  25.0000  9.7   61     5  23 #> 24   32.00000  92.0000 12.0   61     5  24 #> 25   42.12931  66.0000 16.6   57     5  25 #> 26   42.12931 266.0000 14.9   58     5  26 #> 27   42.12931 185.9315  8.0   57     5  27 #> 28   23.00000  13.0000 12.0   67     5  28 #> 29   45.00000 252.0000 14.9   81     5  29 #> 30  115.00000 223.0000  5.7   79     5  30 #> 31   37.00000 279.0000  7.4   76     5  31 #> 32   42.12931 286.0000  8.6   78     6   1 #> 33   42.12931 287.0000  9.7   74     6   2 #> 34   42.12931 242.0000 16.1   67     6   3 #> 35   42.12931 186.0000  9.2   84     6   4 #> 36   42.12931 220.0000  8.6   85     6   5 #> 37   42.12931 264.0000 14.3   79     6   6 #> 38   29.00000 127.0000  9.7   82     6   7 #> 39   42.12931 273.0000  6.9   87     6   8 #> 40   71.00000 291.0000 13.8   90     6   9 #> 41   39.00000 323.0000 11.5   87     6  10 #> 42   42.12931 259.0000 10.9   93     6  11 #> 43   42.12931 250.0000  9.2   92     6  12 #> 44   23.00000 148.0000  8.0   82     6  13 #> 45   42.12931 332.0000 13.8   80     6  14 #> 46   42.12931 322.0000 11.5   79     6  15 #> 47   21.00000 191.0000 14.9   77     6  16 #> 48   37.00000 284.0000 20.7   72     6  17 #> 49   20.00000  37.0000  9.2   65     6  18 #> 50   12.00000 120.0000 11.5   73     6  19 #> 51   13.00000 137.0000 10.3   76     6  20 #> 52   42.12931 150.0000  6.3   77     6  21 #> 53   42.12931  59.0000  1.7   76     6  22 #> 54   42.12931  91.0000  4.6   76     6  23 #> 55   42.12931 250.0000  6.3   76     6  24 #> 56   42.12931 135.0000  8.0   75     6  25 #> 57   42.12931 127.0000  8.0   78     6  26 #> 58   42.12931  47.0000 10.3   73     6  27 #> 59   42.12931  98.0000 11.5   80     6  28 #> 60   42.12931  31.0000 14.9   77     6  29 #> 61   42.12931 138.0000  8.0   83     6  30 #> 62  135.00000 269.0000  4.1   84     7   1 #> 63   49.00000 248.0000  9.2   85     7   2 #> 64   32.00000 236.0000  9.2   81     7   3 #> 65   42.12931 101.0000 10.9   84     7   4 #> 66   64.00000 175.0000  4.6   83     7   5 #> 67   40.00000 314.0000 10.9   83     7   6 #> 68   77.00000 276.0000  5.1   88     7   7 #> 69   97.00000 267.0000  6.3   92     7   8 #> 70   97.00000 272.0000  5.7   92     7   9 #> 71   85.00000 175.0000  7.4   89     7  10 #> 72   42.12931 139.0000  8.6   82     7  11 #> 73   10.00000 264.0000 14.3   73     7  12 #> 74   27.00000 175.0000 14.9   81     7  13 #> 75   42.12931 291.0000 14.9   91     7  14 #> 76    7.00000  48.0000 14.3   80     7  15 #> 77   48.00000 260.0000  6.9   81     7  16 #> 78   35.00000 274.0000 10.3   82     7  17 #> 79   61.00000 285.0000  6.3   84     7  18 #> 80   79.00000 187.0000  5.1   87     7  19 #> 81   63.00000 220.0000 11.5   85     7  20 #> 82   16.00000   7.0000  6.9   74     7  21 #> 83   42.12931 258.0000  9.7   81     7  22 #> 84   42.12931 295.0000 11.5   82     7  23 #> 85   80.00000 294.0000  8.6   86     7  24 #> 86  108.00000 223.0000  8.0   85     7  25 #> 87   20.00000  81.0000  8.6   82     7  26 #> 88   52.00000  82.0000 12.0   86     7  27 #> 89   82.00000 213.0000  7.4   88     7  28 #> 90   50.00000 275.0000  7.4   86     7  29 #> 91   64.00000 253.0000  7.4   83     7  30 #> 92   59.00000 254.0000  9.2   81     7  31 #> 93   39.00000  83.0000  6.9   81     8   1 #> 94    9.00000  24.0000 13.8   81     8   2 #> 95   16.00000  77.0000  7.4   82     8   3 #> 96   78.00000 185.9315  6.9   86     8   4 #> 97   35.00000 185.9315  7.4   85     8   5 #> 98   66.00000 185.9315  4.6   87     8   6 #> 99  122.00000 255.0000  4.0   89     8   7 #> 100  89.00000 229.0000 10.3   90     8   8 #> 101 110.00000 207.0000  8.0   90     8   9 #> 102  42.12931 222.0000  8.6   92     8  10 #> 103  42.12931 137.0000 11.5   86     8  11 #> 104  44.00000 192.0000 11.5   86     8  12 #> 105  28.00000 273.0000 11.5   82     8  13 #> 106  65.00000 157.0000  9.7   80     8  14 #> 107  42.12931  64.0000 11.5   79     8  15 #> 108  22.00000  71.0000 10.3   77     8  16 #> 109  59.00000  51.0000  6.3   79     8  17 #> 110  23.00000 115.0000  7.4   76     8  18 #> 111  31.00000 244.0000 10.9   78     8  19 #> 112  44.00000 190.0000 10.3   78     8  20 #> 113  21.00000 259.0000 15.5   77     8  21 #> 114   9.00000  36.0000 14.3   72     8  22 #> 115  42.12931 255.0000 12.6   75     8  23 #> 116  45.00000 212.0000  9.7   79     8  24 #> 117 168.00000 238.0000  3.4   81     8  25 #> 118  73.00000 215.0000  8.0   86     8  26 #> 119  42.12931 153.0000  5.7   88     8  27 #> 120  76.00000 203.0000  9.7   97     8  28 #> 121 118.00000 225.0000  2.3   94     8  29 #> 122  84.00000 237.0000  6.3   96     8  30 #> 123  85.00000 188.0000  6.3   94     8  31 #> 124  96.00000 167.0000  6.9   91     9   1 #> 125  78.00000 197.0000  5.1   92     9   2 #> 126  73.00000 183.0000  2.8   93     9   3 #> 127  91.00000 189.0000  4.6   93     9   4 #> 128  47.00000  95.0000  7.4   87     9   5 #> 129  32.00000  92.0000 15.5   84     9   6 #> 130  20.00000 252.0000 10.9   80     9   7 #> 131  23.00000 220.0000 10.3   78     9   8 #> 132  21.00000 230.0000 10.9   75     9   9 #> 133  24.00000 259.0000  9.7   73     9  10 #> 134  44.00000 236.0000 14.9   81     9  11 #> 135  21.00000 259.0000 15.5   76     9  12 #> 136  28.00000 238.0000  6.3   77     9  13 #> 137   9.00000  24.0000 10.9   71     9  14 #> 138  13.00000 112.0000 11.5   71     9  15 #> 139  46.00000 237.0000  6.9   78     9  16 #> 140  18.00000 224.0000 13.8   67     9  17 #> 141  13.00000  27.0000 10.3   76     9  18 #> 142  24.00000 238.0000 10.3   68     9  19 #> 143  16.00000 201.0000  8.0   82     9  20 #> 144  13.00000 238.0000 12.6   64     9  21 #> 145  23.00000  14.0000  9.2   71     9  22 #> 146  36.00000 139.0000 10.3   81     9  23 #> 147   7.00000  49.0000 10.3   69     9  24 #> 148  14.00000  20.0000 16.6   63     9  25 #> 149  30.00000 193.0000  6.9   70     9  26 #> 150  42.12931 145.0000 13.2   77     9  27 #> 151  14.00000 191.0000 14.3   75     9  28 #> 152  18.00000 131.0000  8.0   76     9  29 #> 153  20.00000 223.0000 11.5   68     9  30  if (FALSE) { library(dplyr) impute_mean_at(airquality,                 .vars = vars(Ozone))  impute_mean_if(airquality,                 .predicate = is.numeric)  library(ggplot2) airquality %>%   bind_shadow() %>%   impute_mean_all() %>%   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +          geom_point() }"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_median — scoped-impute_median","title":"Scoped variants of impute_median — scoped-impute_median","text":"impute_median imputes median vector. impute many variables , recommend use  across function workflow, shown examples impute_median(). can use scoped variants, impute_median_all.impute_below_at, impute_below_if impute , , just variables meeting condition, respectively. use _at effectively, must know _at affects variables selected character vector, vars().","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_median — scoped-impute_median","text":"","code":"impute_median_all(.tbl)  impute_median_at(.tbl, .vars)  impute_median_if(.tbl, .predicate)"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_median — scoped-impute_median","text":".tbl data.frame .vars variables impute .predicate variables impute","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_median — scoped-impute_median","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_median — scoped-impute_median","text":"","code":"# select variables starting with a particular string. impute_median_all(airquality) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5     205 14.3   56     5   5 #> 6    28.0     205 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0     205  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5     205  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0     205  6.9   86     8   4 #> 97   35.0     205  7.4   85     8   5 #> 98   66.0     205  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30  impute_median_at(airquality,                .vars = c(\"Ozone\", \"Solar.R\")) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5     205 14.3   56     5   5 #> 6    28.0     205 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0     205  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5     205  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0     205  6.9   86     8   4 #> 97   35.0     205  7.4   85     8   5 #> 98   66.0     205  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30 library(dplyr) impute_median_at(airquality,                 .vars = vars(Ozone)) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5      NA 14.3   56     5   5 #> 6    28.0      NA 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0      NA  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5      NA  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0      NA  6.9   86     8   4 #> 97   35.0      NA  7.4   85     8   5 #> 98   66.0      NA  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30  impute_median_if(airquality,                 .predicate = is.numeric) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5     205 14.3   56     5   5 #> 6    28.0     205 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0     205  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5     205  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0     205  6.9   86     8   4 #> 97   35.0     205  7.4   85     8   5 #> 98   66.0     205  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30  library(ggplot2) airquality %>%   bind_shadow() %>%   impute_median_all() %>%   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +          geom_point()"},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Set a proportion or number of missing values — set-prop-n-miss","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"Set proportion number missing values","code":""},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"","code":"set_prop_miss(x, prop = 0.1)  set_n_miss(x, n = 1)"},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"x vector values set missing prop proportion values 0 1 set missing n number values set missing","code":""},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"vector missing values added","code":""},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"","code":"vec <- rnorm(5) set_prop_miss(vec, 0.2) #> [1] -0.65662615 -0.64975149  0.09030152          NA  0.74846478 set_prop_miss(vec, 0.4) #> [1] -0.6566262 -0.6497515         NA -1.3162772         NA set_n_miss(vec, 1) #> [1] -0.6566262 -0.6497515         NA -1.3162772  0.7484648 set_n_miss(vec, 4) #> [1]        NA        NA        NA -1.316277        NA"},{"path":"http://naniar.njtierney.com/reference/shade.html","id":null,"dir":"Reference","previous_headings":"","what":"Create new levels of missing — shade","title":"Create new levels of missing — shade","text":"Returns (least) factors !NA NA, !NA indicates datum missing, NA indicates missingness. also allows specify new missings, like. function powers factor levels as_shadow().","code":""},{"path":"http://naniar.njtierney.com/reference/shade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create new levels of missing — shade","text":"","code":"shade(x, ..., extra_levels = NULL)"},{"path":"http://naniar.njtierney.com/reference/shade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create new levels of missing — shade","text":"x vector ... additional levels missing add extra_levels extra levels might specify factor.","code":""},{"path":"http://naniar.njtierney.com/reference/shade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create new levels of missing — shade","text":"","code":"df <- tibble::tribble(   ~wind, ~temp,   -99,    45,   68,    NA,   72,    25   )  shade(df$wind) #> [1] !NA !NA !NA #> Levels: !NA NA  shade(df$wind, inst_fail = -99) #> [1] NA_inst_fail !NA          !NA          #> Levels: !NA NA NA_inst_fail"},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape shadow data into a long format — shadow_long","title":"Reshape shadow data into a long format — shadow_long","text":"data nabular form, shadow bound data, can useful reshape long format shadow columns separate grouping - variable, value, variable_NA value_NA.","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape shadow data into a long format — shadow_long","text":"","code":"shadow_long(shadow_data, ..., fn_value_transform = NULL, only_main_vars = TRUE)"},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape shadow data into a long format — shadow_long","text":"shadow_data data.frame ... bare name variables want focus fn_value_transform function transform \"value\" column. Default NULL, defaults .character. aware .numeric may fail instances coerce value numeric. See examples. only_main_vars logical - want filter main variables?","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshape shadow data into a long format — shadow_long","text":"data long format, columns variable, value, variable_NA, value_NA.","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reshape shadow data into a long format — shadow_long","text":"","code":"aq_shadow <- nabular(airquality)  shadow_long(aq_shadow) #> # A tibble: 918 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone    41    Ozone_NA    !NA      #>  2 Solar.R  190   Solar.R_NA  !NA      #>  3 Wind     7.4   Wind_NA     !NA      #>  4 Temp     67    Temp_NA     !NA      #>  5 Month    5     Month_NA    !NA      #>  6 Day      1     Day_NA      !NA      #>  7 Ozone    36    Ozone_NA    !NA      #>  8 Solar.R  118   Solar.R_NA  !NA      #>  9 Wind     8     Wind_NA     !NA      #> 10 Temp     72    Temp_NA     !NA      #> # ℹ 908 more rows  # then filter only on Ozone shadow_long(aq_shadow, Ozone) #> # A tibble: 153 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone    41    Ozone_NA    !NA      #>  2 Ozone    36    Ozone_NA    !NA      #>  3 Ozone    12    Ozone_NA    !NA      #>  4 Ozone    18    Ozone_NA    !NA      #>  5 Ozone    NA    Ozone_NA    NA       #>  6 Ozone    28    Ozone_NA    !NA      #>  7 Ozone    23    Ozone_NA    !NA      #>  8 Ozone    19    Ozone_NA    !NA      #>  9 Ozone    8     Ozone_NA    !NA      #> 10 Ozone    NA    Ozone_NA    NA       #> # ℹ 143 more rows  shadow_long(aq_shadow, Ozone, Solar.R) #> # A tibble: 306 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone    41    Ozone_NA    !NA      #>  2 Solar.R  190   Solar.R_NA  !NA      #>  3 Ozone    36    Ozone_NA    !NA      #>  4 Solar.R  118   Solar.R_NA  !NA      #>  5 Ozone    12    Ozone_NA    !NA      #>  6 Solar.R  149   Solar.R_NA  !NA      #>  7 Ozone    18    Ozone_NA    !NA      #>  8 Solar.R  313   Solar.R_NA  !NA      #>  9 Ozone    NA    Ozone_NA    NA       #> 10 Solar.R  NA    Solar.R_NA  NA       #> # ℹ 296 more rows  # ensure `value` is numeric shadow_long(aq_shadow, fn_value_transform = as.numeric) #> # A tibble: 918 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone     41   Ozone_NA    !NA      #>  2 Solar.R  190   Solar.R_NA  !NA      #>  3 Wind       7.4 Wind_NA     !NA      #>  4 Temp      67   Temp_NA     !NA      #>  5 Month      5   Month_NA    !NA      #>  6 Day        1   Day_NA      !NA      #>  7 Ozone     36   Ozone_NA    !NA      #>  8 Solar.R  118   Solar.R_NA  !NA      #>  9 Wind       8   Wind_NA     !NA      #> 10 Temp      72   Temp_NA     !NA      #> # ℹ 908 more rows shadow_long(aq_shadow, Ozone, Solar.R, fn_value_transform = as.numeric) #> # A tibble: 306 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone       41 Ozone_NA    !NA      #>  2 Solar.R    190 Solar.R_NA  !NA      #>  3 Ozone       36 Ozone_NA    !NA      #>  4 Solar.R    118 Solar.R_NA  !NA      #>  5 Ozone       12 Ozone_NA    !NA      #>  6 Solar.R    149 Solar.R_NA  !NA      #>  7 Ozone       18 Ozone_NA    !NA      #>  8 Solar.R    313 Solar.R_NA  !NA      #>  9 Ozone       NA Ozone_NA    NA       #> 10 Solar.R     NA Solar.R_NA  NA       #> # ℹ 296 more rows"},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"shadow_shift transforms missing values facilitate visualisation, different behaviour different types variables. numeric variables, values shifted 10% minimum value given variable plus jittered noise, separate repeated values, missing values can visualised along rest data.","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"","code":"shadow_shift(...)"},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"... arguments impute_below().","code":""},{"path":[]},{"path":[]},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"","code":"airquality$Ozone #>   [1]  41  36  12  18  NA  28  23  19   8  NA   7  16  11  14  18  14  34   6 #>  [19]  30  11   1  11   4  32  NA  NA  NA  23  45 115  37  NA  NA  NA  NA  NA #>  [37]  NA  29  NA  71  39  NA  NA  23  NA  NA  21  37  20  12  13  NA  NA  NA #>  [55]  NA  NA  NA  NA  NA  NA  NA 135  49  32  NA  64  40  77  97  97  85  NA #>  [73]  10  27  NA   7  48  35  61  79  63  16  NA  NA  80 108  20  52  82  50 #>  [91]  64  59  39   9  16  78  35  66 122  89 110  NA  NA  44  28  65  NA  22 #> [109]  59  23  31  44  21   9  NA  45 168  73  NA  76 118  84  85  96  78  73 #> [127]  91  47  32  20  23  21  24  44  21  28   9  13  46  18  13  24  16  13 #> [145]  23  36   7  14  30  NA  14  18  20 shadow_shift(airquality$Ozone) #> Warning: `shadow_shift()` was deprecated in naniar 1.1.0. #> ℹ Please use `impute_below()` instead. #>   [1]  41.00000  36.00000  12.00000  18.00000 -19.72321  28.00000  23.00000 #>   [8]  19.00000   8.00000 -18.51277   7.00000  16.00000  11.00000  14.00000 #>  [15]  18.00000  14.00000  34.00000   6.00000  30.00000  11.00000   1.00000 #>  [22]  11.00000   4.00000  32.00000 -17.81863 -19.43853 -15.14310  23.00000 #>  [29]  45.00000 115.00000  37.00000 -16.17315 -14.65883 -17.85609 -13.29299 #>  [36] -16.16323 -19.60935  29.00000 -19.65780  71.00000  39.00000 -13.40961 #>  [43] -13.53728  23.00000 -19.65993 -16.48342  21.00000  37.00000  20.00000 #>  [50]  12.00000  13.00000 -17.17718 -16.74073 -13.65786 -16.78786 -12.30098 #>  [57] -13.33171 -16.77414 -17.08225 -15.98818 -19.17558 135.00000  49.00000 #>  [64]  32.00000 -14.27138  64.00000  40.00000  77.00000  97.00000  97.00000 #>  [71]  85.00000 -13.51764  10.00000  27.00000 -13.48998   7.00000  48.00000 #>  [78]  35.00000  61.00000  79.00000  63.00000  16.00000 -16.92150 -16.60335 #>  [85]  80.00000 108.00000  20.00000  52.00000  82.00000  50.00000  64.00000 #>  [92]  59.00000  39.00000   9.00000  16.00000  78.00000  35.00000  66.00000 #>  [99] 122.00000  89.00000 110.00000 -14.78907 -16.19151  44.00000  28.00000 #> [106]  65.00000 -19.73591  22.00000  59.00000  23.00000  31.00000  44.00000 #> [113]  21.00000   9.00000 -18.92235  45.00000 168.00000  73.00000 -14.86296 #> [120]  76.00000 118.00000  84.00000  85.00000  96.00000  78.00000  73.00000 #> [127]  91.00000  47.00000  32.00000  20.00000  23.00000  21.00000  24.00000 #> [134]  44.00000  21.00000  28.00000   9.00000  13.00000  46.00000  18.00000 #> [141]  13.00000  24.00000  16.00000  13.00000  23.00000  36.00000   7.00000 #> [148]  14.00000  30.00000 -14.83089  14.00000  18.00000  20.00000 if (FALSE) { library(dplyr) airquality %>%     mutate(Ozone_shift = shadow_shift(Ozone)) }"},{"path":"http://naniar.njtierney.com/reference/stat_miss_point.html","id":null,"dir":"Reference","previous_headings":"","what":"stat_miss_point — stat_miss_point","title":"stat_miss_point — stat_miss_point","text":"stat_miss_point adds geometry displaying missingness geom_point","code":""},{"path":"http://naniar.njtierney.com/reference/stat_miss_point.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"stat_miss_point — stat_miss_point","text":"","code":"stat_miss_point(   mapping = NULL,   data = NULL,   prop_below = 0.1,   jitter = 0.05,   geom = \"point\",   position = \"identity\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE,   ... )"},{"path":"http://naniar.njtierney.com/reference/stat_miss_point.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"stat_miss_point — stat_miss_point","text":"mapping Set aesthetic mappings created ggplot2::aes() ggplot2::aes_(). specified inherit.aes = TRUE (default), combined default mapping top level plot. need supply mapping mapping defined plot. data data frame. specified, overrides default data frame defined top level plot. prop_below degree shift values. default 0.1 jitter amount jitter add. default 0.05 geom, stat Override default connection geom_point stat_point. position Position adjustment, either string, result call position adjustment function na.rm FALSE (default), removes missing values warning. TRUE silently removes missing values. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders. ... arguments passed ggplot2::layer(). three types arguments can use : Aesthetics: set aesthetic fixed value, like color = \"red\" size = 3. arguments layer, example override default stat associated layer. arguments passed stat.","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":null,"dir":"Reference","previous_headings":"","what":"Unbind (remove) shadow from data, and vice versa — unbinders","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"Remove shadow variables (end _NA) data, vice versa. also remove nabular class data.","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"","code":"unbind_shadow(data)  unbind_data(data)"},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"data data.frame containing shadow columns (created bind_shadow())","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"data.frame without shadow columns using unbind_shadow(), without original data, using unbind_data().","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"","code":"# bind shadow columns aq_sh <- bind_shadow(airquality)  # print data aq_sh #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA   # remove shadow columns unbind_shadow(aq_sh) #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190   7.4    67     5     1 #>  2    36     118   8      72     5     2 #>  3    12     149  12.6    74     5     3 #>  4    18     313  11.5    62     5     4 #>  5    NA      NA  14.3    56     5     5 #>  6    28      NA  14.9    66     5     6 #>  7    23     299   8.6    65     5     7 #>  8    19      99  13.8    59     5     8 #>  9     8      19  20.1    61     5     9 #> 10    NA     194   8.6    69     5    10 #> # ℹ 143 more rows  # remove data unbind_data(aq_sh) #> # A tibble: 153 × 6 #>    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA #>                          #>  1 !NA      !NA        !NA     !NA     !NA      !NA    #>  2 !NA      !NA        !NA     !NA     !NA      !NA    #>  3 !NA      !NA        !NA     !NA     !NA      !NA    #>  4 !NA      !NA        !NA     !NA     !NA      !NA    #>  5 NA       NA         !NA     !NA     !NA      !NA    #>  6 !NA      NA         !NA     !NA     !NA      !NA    #>  7 !NA      !NA        !NA     !NA     !NA      !NA    #>  8 !NA      !NA        !NA     !NA     !NA      !NA    #>  9 !NA      !NA        !NA     !NA     !NA      !NA    #> 10 NA       !NA        !NA     !NA     !NA      !NA    #> # ℹ 143 more rows  # errors when you don't use data with shadows if (FALSE) {  unbind_data(airquality)  unbind_shadow(airquality) }"},{"path":"http://naniar.njtierney.com/reference/where.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a call into two components with a useful verb name — where","title":"Split a call into two components with a useful verb name — where","text":"function used inside recode_shadow help evaluate formula call effectively. .special function designed use recode_shadow, use outside ","code":""},{"path":"http://naniar.njtierney.com/reference/where.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a call into two components with a useful verb name — where","text":"","code":".where(...)"},{"path":"http://naniar.njtierney.com/reference/where.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a call into two components with a useful verb name — where","text":"... case_when style formula","code":""},{"path":"http://naniar.njtierney.com/reference/where.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a call into two components with a useful verb name — where","text":"list \"condition\" \"suffix\" arguments","code":""},{"path":"http://naniar.njtierney.com/reference/where.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a call into two components with a useful verb name — where","text":"","code":"if (FALSE) { df <- tibble::tribble( ~wind, ~temp, -99,    45, 68,    NA, 72,    25 )  dfs <- bind_shadow(df)  recode_shadow(dfs,               temp = .where(wind == -99 ~ \"bananas\"))  }"},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Which rows and cols contain missings? — where_na","title":"Which rows and cols contain missings? — where_na","text":"Internal function short (.na(x), arr.ind = TRUE). Creates array index locations missing values dataframe.","code":""},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which rows and cols contain missings? — where_na","text":"","code":"where_na(x)"},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which rows and cols contain missings? — where_na","text":"x dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which rows and cols contain missings? — where_na","text":"matrix columns \"row\" \"col\", refer row column identify position missing value dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which rows and cols contain missings? — where_na","text":"","code":"where_na(airquality) #>       row col #>  [1,]   5   1 #>  [2,]  10   1 #>  [3,]  25   1 #>  [4,]  26   1 #>  [5,]  27   1 #>  [6,]  32   1 #>  [7,]  33   1 #>  [8,]  34   1 #>  [9,]  35   1 #> [10,]  36   1 #> [11,]  37   1 #> [12,]  39   1 #> [13,]  42   1 #> [14,]  43   1 #> [15,]  45   1 #> [16,]  46   1 #> [17,]  52   1 #> [18,]  53   1 #> [19,]  54   1 #> [20,]  55   1 #> [21,]  56   1 #> [22,]  57   1 #> [23,]  58   1 #> [24,]  59   1 #> [25,]  60   1 #> [26,]  61   1 #> [27,]  65   1 #> [28,]  72   1 #> [29,]  75   1 #> [30,]  83   1 #> [31,]  84   1 #> [32,] 102   1 #> [33,] 103   1 #> [34,] 107   1 #> [35,] 115   1 #> [36,] 119   1 #> [37,] 150   1 #> [38,]   5   2 #> [39,]   6   2 #> [40,]  11   2 #> [41,]  27   2 #> [42,]  96   2 #> [43,]  97   2 #> [44,]  98   2 where_na(oceanbuoys$sea_temp_c) #> [1] 463 481 637"},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":null,"dir":"Reference","previous_headings":"","what":"Which variables are shades? — which_are_shade","title":"Which variables are shades? — which_are_shade","text":"function tells us variables contain shade information","code":""},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which variables are shades? — which_are_shade","text":"","code":"which_are_shade(.tbl)"},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which variables are shades? — which_are_shade","text":".tbl data.frame tbl","code":""},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which variables are shades? — which_are_shade","text":"numeric - column numbers contain shade information","code":""},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which variables are shades? — which_are_shade","text":"","code":"df_shadow <- bind_shadow(airquality)  which_are_shade(df_shadow) #>   Ozone_NA Solar.R_NA    Wind_NA    Temp_NA   Month_NA     Day_NA  #>          7          8          9         10         11         12"},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Which elements contain missings? — which_na","title":"Which elements contain missings? — which_na","text":"Equivalent (.na()) - returns integer locations missing values.","code":""},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which elements contain missings? — which_na","text":"","code":"which_na(x)"},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which elements contain missings? — which_na","text":"x dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which elements contain missings? — which_na","text":"integer locations missing values.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which elements contain missings? — which_na","text":"","code":"which_na(airquality) #>  [1]   5  10  25  26  27  32  33  34  35  36  37  39  42  43  45  46  52  53  54 #> [20]  55  56  57  58  59  60  61  65  72  75  83  84 102 103 107 115 119 150 158 #> [39] 159 164 180 249 250 251"},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-110-prince-caspian","dir":"Changelog","previous_headings":"","what":"naniar 1.1.0 “Prince Caspian”","title":"naniar 1.1.0 “Prince Caspian”","text":"CRAN release: 2024-03-05","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-1-1-0","dir":"Changelog","previous_headings":"","what":"New","title":"naniar 1.1.0 “Prince Caspian”","text":"Implement impute_fixed, impute_zero, impute_factor. notably implement “scoped variants” previously implemented - example, impute_fixed_if etc. favour using new across workflow within dplyr, easier maintain. #261 Add digit argument miss_var_summary help display %missing data correctly small fraction missingness. #284 Implemented impute_mode - resolves #213. geom_miss_point() works shape argument #290 Fix bug all_complete, implemented !anyNA(x) (complete.cases(x)). Correctly implement any_na() (any_miss()) any_complete(). Rework examples demonstrate workflow finding complete variables.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-1-1-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"naniar 1.1.0 “Prince Caspian”","text":"Fix bug shadow_long working gathering variables mixed type. Fix involves specifying value transform, defaults character. #314 Implement Date, POSIXct POSIXlt methods impute_below() - #158 Provide replace_na_with, complement replace_with_na - #129 Fix bug gg_miss_fct used deprecated function forcats - #342","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"misc-1-1-0","dir":"Changelog","previous_headings":"","what":"Misc","title":"naniar 1.1.0 “Prince Caspian”","text":"Use cli::cli_abort cli::cli_warn instead stop warn (#326) Use expect_snapshot instead expect_error (#326)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Changes","title":"naniar 1.1.0 “Prince Caspian”","text":"Soft deprecated shadow_shift - #193 Soft deprecate miss_case_cumsum() miss_var_cumsum() - #257","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-100","dir":"Changelog","previous_headings":"","what":"naniar 1.0.0","title":"naniar 1.0.0","text":"CRAN release: 2023-02-02 Version 1.0.0 naniar signify release associated publication associated JSS paper, doi:10.18637/jss.v105.i07. also small changes implemented release, described . still lot naniar, release signify changes upcoming, establish stable release, changes upcoming go formal deprecation process .","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-1-0-0","dir":"Changelog","previous_headings":"","what":"New","title":"naniar 1.0.0","text":"DOI CITATION new JSS publication registered publication CRAN. Replaced tidyr::gather tidyr::pivot_longer - resolves #301 added set_n_miss set_prop_miss functions - resolved #298","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-1-0-0","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"naniar 1.0.0","text":"Fix bug gg_miss_var() warning appears due change remove legend #288.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"misc-1-0-0","dir":"Changelog","previous_headings":"","what":"Misc","title":"naniar 1.0.0","text":"Removed gdtools naniar longer needed 302. added imports, vctrs cli - free dependencies used within already used tidyverse already.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-061-20210513-incandescent-lightbulbs-killed-the-arc-lamps","dir":"Changelog","previous_headings":"","what":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","title":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","text":"CRAN release: 2021-05-14","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-6-1","dir":"Changelog","previous_headings":"","what":"New features","title":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","text":"naniar now provides mcar_test() Little’s (1988) statistical test missing completely random (MCAR) data. null hypothesis test data MCAR, test statistic chi-squared value. Given high statistic value low p-value, can conclude data missing completely random. Thanks Andrew Heiss PR. common_na_strings gains \"#N/\".","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-6-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","text":"Fix bug miss_var_span() (#270) number missings + number complete values added number rows data. due remainder used calculating number complete values. Fix bug recode_shadow() (#272) adding special missing value two subsequent operations fails.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-060-20200817-spur-of-the-lamp-post","dir":"Changelog","previous_headings":"","what":"naniar 0.6.0 (2020/08/17) “Spur of the lamp post”","title":"naniar 0.6.0 (2020/08/17) “Spur of the lamp post”","text":"CRAN release: 2020-09-02 Provide warning replace_with_na columns provided don’t exist (see #160). Thank michael-dewar help .","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"naniar 0.6.0 (2020/08/17) “Spur of the lamp post”","text":"Drop “nabular” “shadow” classes (#268) used nabular() bind_shadow(). removes functions, as_shadow(), is_shadow(), is_nabular(), new_nabular(), new_shadow(). mostly used internally expected users used functions. used, please file issue can implement .","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-052-20200628-silver-apple","dir":"Changelog","previous_headings":"","what":"naniar 0.5.2 (2020/06/28) “Silver Apple”","title":"naniar 0.5.2 (2020/06/28) “Silver Apple”","text":"CRAN release: 2020-06-29","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-5-2","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.5.2 (2020/06/28) “Silver Apple”","text":"Improvements code miss_var_summary(), miss_var_table(), prop_miss_var(), resulting 3-10x speedup.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-051-20200410-uncle-andrews-applewood-wardrobe","dir":"Changelog","previous_headings":"","what":"naniar 0.5.1 (2020/04/10) “Uncle Andrew’s Applewood Wardrobe”","title":"naniar 0.5.1 (2020/04/10) “Uncle Andrew’s Applewood Wardrobe”","text":"CRAN release: 2020-04-30","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.5.1 (2020/04/10) “Uncle Andrew’s Applewood Wardrobe”","text":"Fixes warnings errors tibble subsequent downstream impacts simputation.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-050-20200220-the-end-of-this-story-and-the-beginning-of-all-of-the-others","dir":"Changelog","previous_headings":"","what":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"CRAN release: 2020-02-28","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"miss_var_prop() complete_var_prop() miss_var_pct() complete_var_pct() miss_case_prop() complete_case_prop() miss_case_pct() complete_case_pct() Instead use: prop_miss_var(), prop_complete_var(), pct_miss_var(), pct_complete_var(), prop_miss_case(), prop_complete_case(), pct_miss_case(), pct_complete_case(). (see 242) replace_to_na() made defunct, please use replace_with_na() instead. (see 242)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"miss_var_cumsum miss_case_cumsum now exported use map_dfc instead map_df Fix various extra warnings improve test coverage","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-5-0","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"Address bug number missings row calculated properly - see 238 232. solution involved using rowSums(.na(x)), 3 times faster. Resolve bug gg_miss_fct() warning given non explicit NA values - see 241. skip vdiffr tests github actions use tibble() data_frame()","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-042-20190215-the-planting-of-the-tree","dir":"Changelog","previous_headings":"","what":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","title":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","text":"CRAN release: 2019-02-15","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"improvements-0-4-2","dir":"Changelog","previous_headings":"","what":"Improvements","title":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","text":"geom_miss_point() ggplot2 layer can now converted interactive web-based version ggplotly() function plotly package. order work, naniar now exports geom2trace.GeomMissPoint() function (users never need call geom2trace.GeomMissPoint() directly – ggplotly() calls ). adds WORDLIST spelling thanks usethis::use_spell_check() fix documentation @seealso bug (#228) (@sfirke)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"dependency-fixes-0-4-2","dir":"Changelog","previous_headings":"","what":"Dependency fixes","title":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","text":"Thanks PR (#223) @romainfrancois: fixes two problems identified part reverse dependency checks dplyr 0.8.0 release candidate. https://github.com/tidyverse/dplyr/blob/revdep_dplyr_0_8_0_RC/revdep/problems.md#naniar n() must imported prefixed like function. PR, ’ve changed 1:n() dplyr::row_number() naniar seems prefix dplyr functions. update_shadow restoring class attributes, changed restores attributes, causing problems data grouped_df. likely problem , dplyr 0.8.0 stricter grouped data frame.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-041-20181214","dir":"Changelog","previous_headings":"","what":"naniar 0.4.1 (2018/12/14)","title":"naniar 0.4.1 (2018/12/14)","text":"CRAN release: 2018-11-20","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-4-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.4.1 (2018/12/14)","text":"pkgdown updates: update favicon logo, set gh-pages deployment use scalar integer new_tibble","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-041-20181120-aslans-song","dir":"Changelog","previous_headings":"","what":"naniar 0.4.1 (2018/11/20) “Aslan’s Song”","title":"naniar 0.4.1 (2018/11/20) “Aslan’s Song”","text":"CRAN release: 2018-11-20","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-change-0-4-1","dir":"Changelog","previous_headings":"","what":"Minor Change","title":"naniar 0.4.1 (2018/11/20) “Aslan’s Song”","text":"Fixes new_tibble #220 - Thanks Kirill Müller. Refactoring capture arguments rlang #218 - thanks Lionel Henry.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-feature-0-4-0","dir":"Changelog","previous_headings":"","what":"New Feature","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Add custom label support missings missings functions add_label_missings add_label_shadow() add_any_miss(). can now `add_label_missings(data, missing = “custom_missing_label”, complete = “custom_complete_label”) impute_median() scoped variants any_shade() returns logical TRUE FALSE depending shade values nabular() alias bind_shadow() tie nabular term work. is_nabular() checks input nabular. geom_miss_point() now gains arguments shadow_shift()/impute_below() altering amount jitter proportion (prop_below). Added two new vignettes, “Exploring Imputed Values”, “Special Missing Values” miss_var_summary miss_case_summary now longer provide cumulative sum missingness summaries - summary can added back data option add_cumsum = TRUE. #186 Added gg_miss_upset replace workflow :","code":"data %>%    as_shadow_upset() %>%   UpSetR::upset()"},{"path":"http://naniar.njtierney.com/news/index.html","id":"major-change-0-4-0","dir":"Changelog","previous_headings":"","what":"Major Change","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"recode_shadow now works! function allows recode missing values special missing values. special missing values stored shadow part dataframe, ends _NA. implemented shade appropriate throughout naniar, also added verifiers, is_shade, are_shade, which_are_shade, removed which_are_shadow. as_shadow bind_shadow now return data class shadow. feed recode_shadow methods flexibly adding new types missing data. Note future shadow might changed nabble something similar.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-feature-0-4-0","dir":"Changelog","previous_headings":"","what":"Minor feature","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Functions add_label_shadow() add_label_missings() gain arguments can label according missingness / shadowy-ness given variables. new function which_are_shadow(), tell values shadows. new function long_shadow(), converts data shadow/nabular form long format suitable plotting. Related #165 Added tests miss_scan_count","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"gg_miss_upset gets better default presentation ordering largest intersections, also improved error message data 1 variables missing values. shadow_shift gains informative error message doesn’t know class. Changed common_na_string include escape characters “?”, “”, ”.” used replacement searching functions don’t return wildcard results characters ”?”, ””, “.”. miss_case_table miss_var_table now final column names pct_vars, pct_cases instead pct_miss - fixes #178.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Deprecated old names scalar missingness summaries, favour consistent syntax #171. old new : old names made defunct 0.5.0, removed completely 0.6.0. impute_below changed alias shadow_shift - operates single vector. impute_below_all operates columns dataframe (specified #159)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fix-0-4-0","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Ensured miss_scan_count actually return’d something. gg_miss_var(airquality) now prints ggplot - typo meant print plot","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-031-20180610-strawberrys-adventure","dir":"Changelog","previous_headings":"","what":"naniar 0.3.1 (2018/06/10) “Strawberry’s Adventure”","title":"naniar 0.3.1 (2018/06/10) “Strawberry’s Adventure”","text":"CRAN release: 2018-06-08","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-change-0-3-1","dir":"Changelog","previous_headings":"","what":"Minor Change","title":"naniar 0.3.1 (2018/06/10) “Strawberry’s Adventure”","text":"patch release removes tidyselect package Imports, unnecessary. Fixes #174","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-030-20180606-digory-and-his-uncle-are-both-in-trouble","dir":"Changelog","previous_headings":"","what":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","title":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","text":"CRAN release: 2018-06-07","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","text":"Added all_miss() / all_na() equivalent (.na(x)) Added any_complete() equivalent (complete.cases(x)) Added any_miss() equivalent anyNA(x) Added common_na_numbers finalised common_na_strings - provide list commonly used NA values #168 Added miss_var_which, lists variable names missings Added as_shadow_upset gets data format suitable plotting UpSetR plot: Added imputation functions assist exploring missingness structure visualisation: impute_below Perfoms shadow_shift, performs columns. means imputes missing values 10% range data (powered shadow_shift), facilitate graphical exloration data. Closes #145 also scoped variants work specific named columns: impute_below_at, columns satisfy predicate function: impute_below_if. impute_mean, imputes mean value, scoped variants impute_mean_at, impute_mean_if. impute_below shadow_shift gain arguments prop_below jitter control degree shift, also extent jitter. Added complete_{case/var}_{pct/prop}, complement miss_{var/case}_{pct/prop} #150 Added unbind_shadow unbind_data helpers remove shadow columns data, data shadows, respectively. Added is_shadow are_shadow determine something contains shadow column. simimlar rlang::is_na rland::are_na, is_shadow returns logical vector length 1, are_shadow returns logical vector length number names data.frame. might revisited later point (see any_shade add_label_shadow). Aesthetics now map expected geom_miss_point(). means can write things like geom_miss_point(aes(colour = Month)) works appropriately. Fixed Luke Smith Pull request #144, fixing #137.","code":"airquality %>%   as_shadow_upset() %>%   UpSetR::upset()"},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","text":"miss_var_summary miss_case_summary now return use order = TRUE default, cases variables missings presented descending order. Fixes #163 Changes Visualisation: Changed default colours used gg_miss_case gg_miss_var lorikeet purple (ochRe package: https://github.com/ropenscilabs/ochRe) y axis label now … Default presentation order_cases = TRUE. Gains show_pct option consistent gg_miss_var #153 gg_miss_which rotated 90 degrees easier read variable names gg_miss_fct uses minimal theme tilts axis labels #118. imported is_na are_na rlang. Added common_na_strings, list common NA values #168. Added detail alternative methods replacing NA vignette “replacing values NA”.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-020-20180208-the-first-joke-and-other-matters","dir":"Changelog","previous_headings":"","what":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"CRAN release: 2018-02-09","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Speed improvements. Thanks help, contributions, discussion Romain François Jim Hester, naniar now greatly improved speed calculating missingness row. speedups continue improve future releases. New “scoped variants” replace_with_na, thankyou Colin Fay work : replace_with_na_all replaces NAs across dataframe meet specified condition (using syntax ~.x == -99) replace_with_na_at replaces NAs across specified variables replace_with_na_if replaces NAs variables satisfy predicate function (e.g., .character) added which_na - replacement (.na(x)) miss_scan_count. makes easier users search particular occurrences values across variables. #119 n_miss_row calculates number missing values row, returning vector. also 3 functions similar spirit: n_complete_row, prop_miss_row, prop_complete_row, return vector number complete obserations, proportion missings row, proportion complete obserations row add_miss_cluster new function calculates cluster missingness row, using hclust. can useful exploratory modelling missingness, similar Tierney et al 2015: “doi: 10.1136/bmjopen-2014-007450” Barnett et al. 2017: “doi: 10.1136/bmjopen-2017-017284” Now exported where_na - function returns positions NA values. dataframe returns matrix row col positions NAs, vector returns vector positions NAs. (#105)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Updated vignette “Gallery Missing Data Visualisations” include facet features order_cases. bind_shadow gains only_miss argument. set FALSE (default) bind dataframe variables duplicated shadow. Setting TRUE bind variables variables contain missing values. Cleaned visualisation gg_miss_case clearer less cluttered ( #117), also added n order_cases option order cases. Added facet argument gg_miss_var, gg_miss_case, gg_miss_span. makes easier users visualise plots across values another variable. future consider adding facet shorthand plotting function, moment seemed ones benefit feature.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fix-0-2-0","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"oceanbuoys now numeric type year, latitude, longitude, previously factor. See related issue Improved handling shadow_shift Inf -Inf values (see #117)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-change-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking change","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Deprecated replace_to_na, replace_with_na, natural phrase (“replace coffee tea” vs “replace coffee tea”). made defunct next version. cast_shadow longer works called cast_shadow(data). action used return variables, shadow variables variables contained missing values. inconsistent use cast_shadow(data, var1, var2). new option added bind_shadow controls - discussed . See details issue 65. Change behaviour cast_shadow default option return variables contain missings. different bind_shadow, binds complete shadow matrix dataframe. way think shadow cast variables contain missing values, whereas bind binding complete shadow data. may change future default option bind_shadow.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-2-0-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Update vignettes floating menu better figure size. minor changes graphics gg_miss_fct - change legend title “Percent Missing” “% Miss”.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-010-20170809-the-founding-of-naniar","dir":"Changelog","previous_headings":"","what":"# naniar 0.1.0 (2017/08/09) “The Founding of naniar”","title":"# naniar 0.1.0 (2017/08/09) “The Founding of naniar”","text":"CRAN release: 2017-08-09 first release naniar onto CRAN, updates naniar happen reasonably regularly approximately every 1-2 months","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"name-change-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"Name change","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"careful consideration, changed back naniar","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"major-change-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"Major Change","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"three new functions : miss_case_cumsum / miss_var_cumsum / replace_to_na two new visualisations : gg_var_cumsum & gg_case_cumsum","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-feature-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"New Feature","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"miss_case_cumsum() miss_case_summary() miss_case_table() miss_prop_summary() miss_var_cumsum() miss_var_run() miss_var_span() miss_var_summary() miss_var_table()","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"Reviewed documentation functions improved wording, grammar, style. Converted roxygen roxygen markdown updated vignettes readme added new vignette “naniar-visualisation”, give quick overview visualisations provided naniar. changed label_missing* label_miss consistent rest naniar Add pct prop helpers (#78) removed miss_df_pct - literally pct_miss prop_miss. break larger files smaller, manageable files (#83) gg_miss_var gets show_pct argument show percentage missing values (Thanks Jennifer helpful feedback! :))","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-0-9-9995-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"miss_var_summary & miss_case_summary now consistent output (one ordered n_missing, ). prevent error miss_case_pct enquo_x now x Now ByteCompile TRUE add Colin auth","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-0069100-20170321","dir":"Changelog","previous_headings":"","what":"# naniar 0.0.6.9100 (2017/03/21)","title":"# naniar 0.0.6.9100 (2017/03/21)","text":"Added prop_miss complement prop_complete. n_miss returns number missing values, prop_miss returns proportion missing values. Likewise, prop_complete returns proportion complete values.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"defunct-functions-0-0-6-9100","dir":"Changelog","previous_headings":"","what":"Defunct functions","title":"# naniar 0.0.6.9100 (2017/03/21)","text":"stated 0.0.5.9000, address Issue #38, moving towards format miss_type_value/fun, makes sense tabbing functions. left hand side functions made defunct favour right hand side. - percent_missing_case() –> miss_case_pct() - percent_missing_var() –> miss_var_pct() - percent_missing_df() –> miss_df_pct() - summary_missing_case() –> miss_case_summary() - summary_missing_var() –> miss_var_summary() - table_missing_case() –> miss_case_table() - table_missing_var() –> miss_var_table()","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"deprecated-functions-0-0-5-9000","dir":"Changelog","previous_headings":"","what":"Deprecated functions","title":"# naniar 0.0.5.9000 (2016/01/08)","text":"address Issue #38, moving towards format miss_type_value/fun, makes sense tabbing functions. miss_* = want explore missing values miss_case_* = want explore missing cases miss_case_pct = want find percentage cases containing missing value miss_case_summary = want find number / percentage missings case miss_case_table = want tabulation number / percentage cases missing consistent easier reason . Thus, renamed following functions: - percent_missing_case() –> miss_case_pct() - percent_missing_var() –> miss_var_pct() - percent_missing_df() –> miss_df_pct() - summary_missing_case() –> miss_case_summary() - summary_missing_var() –> miss_var_summary() - table_missing_case() –> miss_case_table() - table_missing_var() –> miss_var_table() made defunct next release, 0.0.6.9000 (“Wood Worlds”).","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-0-4-9000","dir":"Changelog","previous_headings":"","what":"New features","title":"# naniar 0.0.4.9000 (2016/12/31)","text":"n_complete complement n_miss, counts number complete values vector, matrix, dataframe.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-0-4-9000","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"# naniar 0.0.4.9000 (2016/12/31)","text":"shadow_shift now handles cases 1 complete value vector.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"other-changes-0-0-4-9000","dir":"Changelog","previous_headings":"","what":"Other changes","title":"# naniar 0.0.4.9000 (2016/12/31)","text":"added much comprehensive testing testthat.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-0039901-20161218","dir":"Changelog","previous_headings":"","what":"# naniar 0.0.3.9901 (2016/12/18)","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"burst effort package done refactoring thought hard package going go. meant make decision rename package ggmissing naniar. name may strike strange reflects fact many changes happening, working creating nice utopia (like Narnia CS Lewis) helps us make easier work missing data","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-under-development-0-0-3-9901","dir":"Changelog","previous_headings":"","what":"New Features (under development)","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"add_n_miss add_prop_miss helpers add columns dataframe containing number proportion missing values. example provided use decision trees explore missing data structure “doi: 10.1136/bmjopen-2014-007450” geom_miss_point() now supports transparency, thanks @seasmith (Luke Smith) shadows. mainly around bind_shadow gather_shadow, helper functions assist creating","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-0-3-9901","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"geom_missing_point() broke new release ggplot2 2.2.0, now fixed ensuring inherits GeomPoint, rather just new Geom. Thanks Mitchell O’hara-Wild help . missing data summaries table_missing_var table_missing_case also now return sensible numbers variable names. possible function names change future, kind verbose. semantic versioning incorrectly entered DESCRIPTION file 0.2.9000, changed 0.0.2.9000, 0.0.3.9000 now indicate new changes, hopefully won’t come back bite later. think accidentally visdat point well. Live learn.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"other-changes-0-0-3-9901","dir":"Changelog","previous_headings":"","what":"Other changes","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"gathered related functions single R files rather leaving . correctly imported %>% operator magrittr, removed lot chaff around @importFrom - really don’t need use @importFrom often.","code":""}]
+[{"path":"http://naniar.njtierney.com/CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available http://contributor-covenant.org/version/1/0/0/","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"please-contribute","dir":"","previous_headings":"","what":"Please contribute!","title":"CONTRIBUTING","text":"love collaboration.","code":""},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"bugs","dir":"","previous_headings":"","what":"Bugs?","title":"CONTRIBUTING","text":"Submit issue Issues page","code":""},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"code-contributions","dir":"","previous_headings":"","what":"Code contributions","title":"CONTRIBUTING","text":"Fork repo Github account Clone version account machine account, e.g,. git clone https://github.com//{repo}.git Make sure track progress upstream (.e., version {repo} {owner}/{repo}) git remote add upstream https://github.com/{owner}/{repo}.git. making changes make sure pull changes upstream either git fetch upstream merge later git pull upstream fetch merge one step Make changes (bonus points making changes new feature branch) Push account Submit pull request home base (likely master branch, check make sure) {owner}/{repo}","code":""},{"path":"http://naniar.njtierney.com/CONTRIBUTING.html","id":"prefer-to-email","dir":"","previous_headings":"","what":"Prefer to Email?","title":"CONTRIBUTING","text":"able better help post issue otherwise, can find contact details DESCRIPTION file repo.","code":""},{"path":[]},{"path":[]},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"using-impute_below","dir":"Articles","previous_headings":"","what":"Using impute_below","title":"Exploring Imputed Values","text":"impute_below imputes values minimum data, noise reduce overplotting. amount data imputed , amount jitter, can changed changing arguments prop_below jitter.","code":"library(dplyr) #>  #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #>  #>     filter, lag #> The following objects are masked from 'package:base': #>  #>     intersect, setdiff, setequal, union library(naniar)  airquality %>%   impute_below_at(vars(Ozone)) %>%   select(Ozone, Solar.R) %>%   head() #>       Ozone Solar.R #> 1  41.00000     190 #> 2  36.00000     118 #> 3  12.00000     149 #> 4  18.00000     313 #> 5 -19.72321      NA #> 6  28.00000      NA"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"using-impute_mean","dir":"Articles","previous_headings":"","what":"Using impute_mean","title":"Exploring Imputed Values","text":"mean can imputed using impute_mean, useful explore structure missingness, recommended use analysis. Similar simputation, impute_ function returns data values imputed. Imputation functions naniar implement “scoped variants” imputation: _all, _at _if. means: _all operates columns _at operates specific columns, _if operates columns meet condition (.numeric .character). impute_ functions used -- e.g., impute_mean, work single vector, data.frame. examples impute_mean now given: impute data like , identify imputed values - need track . can track imputed values using nabular format data.","code":"impute_mean(oceanbuoys$air_temp_c) %>% head() #> [1] 27.15 27.02 27.00 26.93 26.84 26.94  impute_mean_at(oceanbuoys, .vars = vars(air_temp_c)) %>% head() #> # A tibble: 6 × 8 #>    year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                   #> 1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #> 2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #> 3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #> 4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #> 5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #> 6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60  impute_mean_if(oceanbuoys, .predicate = is.integer) %>% head() #> # A tibble: 6 × 8 #>    year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                   #> 1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #> 2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #> 3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #> 4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #> 5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #> 6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60  impute_mean_all(oceanbuoys) %>% head() #> # A tibble: 6 × 8 #>    year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                   #> 1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #> 2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #> 3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #> 4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #> 5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #> 6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"track-imputed-values-using-nabular-data","dir":"Articles","previous_headings":"Using impute_mean","what":"Track imputed values using nabular data","title":"Exploring Imputed Values","text":"can track missing values combining verbs bind_shadow, impute_, add_label_shadow. can refer missing values shadow variable, _NA. add_label_shadow function adds additional column called any_missing, tells us observation missing value.","code":""},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"imputing-values-using-simputation","dir":"Articles","previous_headings":"Using impute_mean > Track imputed values using nabular data","what":"Imputing values using simputation","title":"Exploring Imputed Values","text":"can impute data using easy--use simputation package, track missingness using bind_shadow add_label_shadow: can show previously missing (now imputed!) data scatterplot ggplot2 setting color aesthetic ggplot any_missing:  , want look one variable, can look density plot one variable, using fill = any_missing  can also compare imputed values complete cases grouping any_missing, summarising.","code":"library(simputation) #>  #> Attaching package: 'simputation' #> The following object is masked from 'package:naniar': #>  #>     impute_median ocean_imp <- oceanbuoys %>%   bind_shadow() %>%   impute_lm(air_temp_c ~ wind_ew + wind_ns) %>%   impute_lm(humidity ~  wind_ew + wind_ns) %>%   impute_lm(sea_temp_c ~  wind_ew + wind_ns) %>%   add_label_shadow() library(ggplot2) ggplot(ocean_imp,        aes(x = air_temp_c,            y = humidity,            color = any_missing)) +    geom_point() +   scale_color_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\") ggplot(ocean_imp,        aes(x = air_temp_c,            fill = any_missing)) +    geom_density(alpha = 0.3) +    scale_fill_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\")  ggplot(ocean_imp,        aes(x = humidity,            fill = any_missing)) +    geom_density(alpha = 0.3) +    scale_fill_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\") ocean_imp %>%   group_by(any_missing) %>%   summarise_at(.vars = vars(air_temp_c),                .funs = list(                  min = ~ min(.x, na.rm = TRUE),                   mean = ~ mean(.x, na.rm = TRUE),                   median = ~ median(.x, na.rm = TRUE),                   max = ~ max(.x, na.rm = TRUE)               )) #> # A tibble: 2 × 5 #>   any_missing   min  mean median   max #>               #> 1 Missing      21.4  23.9   24.4  25.2 #> 2 Not Missing  22.1  25.3   25.8  28.5"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"improving-imputations","dir":"Articles","previous_headings":"","what":"Improving imputations","title":"Exploring Imputed Values","text":"One thing notice imputations aren’t good - can improve upon imputation including variables year latitude longitude:","code":"ocean_imp_yr <- oceanbuoys %>%   bind_shadow() %>%   impute_lm(air_temp_c ~ wind_ew + wind_ns + year + longitude + latitude) %>%   impute_lm(humidity ~  wind_ew + wind_ns + year + longitude + latitude) %>%   impute_lm(sea_temp_c ~  wind_ew + wind_ns + year + longitude + latitude) %>%   add_label_shadow() ggplot(ocean_imp_yr,        aes(x = air_temp_c,            y = humidity,            color = any_missing)) +    geom_point() +   scale_color_brewer(palette = \"Dark2\") +   theme(legend.position = \"bottom\")"},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"other-imputation-approaches","dir":"Articles","previous_headings":"","what":"Other imputation approaches","title":"Exploring Imputed Values","text":"imputation packages return data tidy","code":""},{"path":"http://naniar.njtierney.com/articles/exploring-imputed-values.html","id":"hmisc-aregimpute","dir":"Articles","previous_headings":"Other imputation approaches","what":"Hmisc aregImpute","title":"Exploring Imputed Values","text":"can explore using single imputation Hmisc::aregImpute(), allows multiple imputation bootstrapping, additive regression, predictive mean matching. going explore predicting mean matching, single imputation. now going get data nabular form, insert imputed values: future concise way insert imputed values data, moment method recommend single imputation. can explore imputed values like :","code":"library(Hmisc) #>  #> Attaching package: 'Hmisc' #> The following object is masked from 'package:simputation': #>  #>     impute #> The following objects are masked from 'package:dplyr': #>  #>     src, summarize #> The following objects are masked from 'package:base': #>  #>     format.pval, units  aq_imp <- aregImpute(~Ozone + Temp + Wind + Solar.R,                      n.impute = 1,                      type = \"pmm\",                      data = airquality) #> Iteration 1 Iteration 2 Iteration 3 Iteration 4   aq_imp #>  #> Multiple Imputation using Bootstrap and PMM #>  #> aregImpute(formula = ~Ozone + Temp + Wind + Solar.R, data = airquality,  #>     n.impute = 1, type = \"pmm\") #>  #> n: 153   p: 4    Imputations: 1      nk: 3  #>  #> Number of NAs: #>   Ozone    Temp    Wind Solar.R  #>      37       0       0       7  #>  #>         type d.f. #> Ozone      s    2 #> Temp       s    2 #> Wind       s    2 #> Solar.R    s    1 #>  #> Transformation of Target Variables Forced to be Linear #>  #> R-squares for Predicting Non-Missing Values for Each Variable #> Using Last Imputations of Predictors #>   Ozone Solar.R  #>   0.667   0.224 # nabular form! aq_nab <- nabular(airquality) %>%  add_label_shadow()  # insert imputed values aq_nab$Ozone[is.na(aq_nab$Ozone)] <- aq_imp$imputed$Ozone aq_nab$Solar.R[is.na(aq_nab$Solar.R)] <- aq_imp$imputed$Solar.R ggplot(aq_nab,        aes(x = Ozone,            y = Solar.R,            colour = any_missing)) +    geom_point()"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Getting Started with naniar","text":"Missing values ubiquitous data need carefully explored handled initial stages analysis. vignette describe tools package naniar exploring missing data structures minimal deviation common workflows ggplot tidy data (Wickham, 2014, Wickham, 2009). Sometimes researchers analysts introduce describe mechanism missingness. example, might explain data weather station might malfunction extreme weather events, record temperature data gusts speeds high. seems like nice simple, logical explanation. However, like good explanations, one simple, process get probably , likely involved time liked developing exploratory data analyses models. someone presents really nice plot nice sensible explanation, initial thought might : worked quickly, easy! problem easy solve, accidentally solve - couldn’t solve . However, think manage get first go, like turning around throwing rock lake landing cup boat. Unlikely. thought mind, vignette aims work following three questions, using tools developed naniar another package, visdat. Namely, : Start looking missing data? Explore missingness mechanisms? Model missingness?","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"how-do-we-start-looking-at-missing-data","dir":"Articles","previous_headings":"","what":"How do we start looking at missing data?","title":"Getting Started with naniar","text":"start dataset, might something look general summary, using functions : summary() str() skimr::skim, dplyr::glimpse() works really well ’ve got small amount data, data, generally limited much can read. start looking missing data, ’ll need look data, even mean? package visdat helps get handle . visdat provides visualisation entire data frame , heavily inspired csv-fingerprint, functions like missmap, Amelia. two main functions visdat package: vis_dat, vis_miss","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"vis_dat","dir":"Articles","previous_headings":"How do we start looking at missing data?","what":"vis_dat","title":"Getting Started with naniar","text":"vis_dat visualises whole dataframe , provides information class data input R, well whether data missing .","code":"library(visdat) vis_dat(airquality)"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"vis_miss","dir":"Articles","previous_headings":"How do we start looking at missing data? > vis_dat","what":"vis_miss","title":"Getting Started with naniar","text":"function vis_miss provides summary whether data missing . also provides amount missings columns.  , Ozone Solar.R missing data, Ozone 24.2% missing data Solar.R 4.6%. variables missing data. read functions available visdat see vignette “Using visdat”","code":"vis_miss(airquality)"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"exploring-missingness-relationships","dir":"Articles","previous_headings":"","what":"Exploring missingness relationships","title":"Getting Started with naniar","text":"can identify key variables missing using vis_miss, exploration, need explore relationship amongst variables data: Ozone, Solar.R Wind Temp Month Day Typically, exploring data, might want explore variables Solar.R Ozone, plot scatterplot solar radiation ozone, something like :  problem ggplot handle missings default, removes missing values. makes hard explore. also presents strange question “visualise something ?”. One approach visualising missing data comes ggobi MANET, replace “NA” values values 10% lower minimum value variable. process performed visualised geom_miss_point() ggplot2 geom. , illustrate exploring relationship Ozone Solar radiation airquality dataset.  proper ggplot geom, supports standard features ggplot2, facets,  different themes","code":"library(ggplot2) ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_point() ## Warning: Removed 42 rows containing missing values or values outside the scale range ## (`geom_point()`). ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_point() ## Warning: Removed 42 rows containing missing values or values outside the scale range ## (`geom_point()`). library(naniar)  ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_miss_point() ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_miss_point() +    facet_wrap(~Month) ggplot(airquality,         aes(x = Solar.R,             y = Ozone)) +    geom_miss_point() +    facet_wrap(~Month) +    theme_dark()"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"visualising-missings-in-variables","dir":"Articles","previous_headings":"Exploring missingness relationships","what":"Visualising missings in variables","title":"Getting Started with naniar","text":"Another approach visualising missings dataset use gg_miss_var plot:  plots created gg_miss family basic theme, can customise , add arguments like :   add facets plots, can use facet argument:  visualisations available naniar (starting gg_miss_) - can see “Gallery Missing Data Visualisations” vignette.. important note every visualisation missing data naniar, accompanying function get dataframe plot . important plot return dataframe - also need make data available use user isn’t locked plot. can find summary plots , miss_var_summary providing dataframe gg_miss_var() based .","code":"gg_miss_var(airquality) gg_miss_var(airquality) + theme_bw() gg_miss_var(airquality) + labs(y = \"Look at all the missing ones\") gg_miss_var(airquality, facet = Month)"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"replacing-existing-values-with-na","dir":"Articles","previous_headings":"","what":"Replacing existing values with NA","title":"Getting Started with naniar","text":"dealing missing values, might want replace values missing values (NA). useful cases know origin data can certain values missing. example, might know values “N/”, “N ”, “Available”, -99, -1 supposed missing. naniar provides functions specifically work type problem using function replace_with_na. function compliment tidyr::replace_na, replaces NA value specified value, whereas naniar::replace_with_na replaces value NA: tidyr::replace_na: Missing values turns value (NA –> -99) naniar::replace_with_na: Value becomes missing value (-99 –> NA) can read vignette “Replacing values NA”","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"tidy-missing-data-the-shadow-matrix","dir":"Articles","previous_headings":"","what":"Tidy Missing Data: The Shadow Matrix","title":"Getting Started with naniar","text":"Representing missing data structure tidy format achieved using shadow matrix, introduced Swayne Buja. shadow matrix dimension data, consists binary indicators missingness data values, missing represented “NA”, missing represented “!NA”. Although may represented 1 0, respectively. representation can seen figure , adding suffix “_NA” variables. structure can also extended allow additional factor levels created. example 0 indicates data presence, 1 indicates missing values, 2 indicates imputed value, 3 might indicate particular type class missingness, reasons missingness might known inferred. data matrix can also augmented include shadow matrix, facilitates visualisation univariate bivariate missing data visualisations. Another format display long form, facilitates heatmap style visualisations. approach can helpful giving overview variables contain missingness. Methods can also applied rearrange rows columns find clusters, identify interesting features data may previously hidden unclear.  Illustration data structures facilitating visualisation missings missings shadow functions provide way keep track missing values. as_shadow function creates dataframe set columns, column names added suffix _NA bind_shadow attaches shadow current dataframe, format call “nabular”, portmanteau NA tabular. can also use nabular thing: provides consistent syntax referring variables missing values. Nabular data provides useful pattern explore missing values, grouping missing/complete one variable looking mean summary values. show mean, sd, variance, min max values Solar.R Ozone present, missing. , can plot distribution Temperature, plotting values temperature Ozone missing, missing.  can also explore value air temperature humidity based missingness .   Binding shadow also great benefits combined imputation.","code":"as_shadow(airquality) ## # A tibble: 153 × 6 ##    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA ##                          ##  1 !NA      !NA        !NA     !NA     !NA      !NA    ##  2 !NA      !NA        !NA     !NA     !NA      !NA    ##  3 !NA      !NA        !NA     !NA     !NA      !NA    ##  4 !NA      !NA        !NA     !NA     !NA      !NA    ##  5 NA       NA         !NA     !NA     !NA      !NA    ##  6 !NA      NA         !NA     !NA     !NA      !NA    ##  7 !NA      !NA        !NA     !NA     !NA      !NA    ##  8 !NA      !NA        !NA     !NA     !NA      !NA    ##  9 !NA      !NA        !NA     !NA     !NA      !NA    ## 10 NA       !NA        !NA     !NA     !NA      !NA    ## # ℹ 143 more rows aq_shadow <- bind_shadow(airquality) aq_nab <- nabular(airquality)  library(dplyr) ##  ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ##  ##     filter, lag ## The following objects are masked from 'package:base': ##  ##     intersect, setdiff, setequal, union glimpse(aq_shadow) ## Rows: 153 ## Columns: 12 ## $ Ozone       41, 36, 12, 18, NA, 28, 23, 19, 8, NA, 7, 16, 11, 14, 18, 1… ## $ Solar.R     190, 118, 149, 313, NA, NA, 299, 99, 19, 194, NA, 256, 290,… ## $ Wind        7.4, 8.0, 12.6, 11.5, 14.3, 14.9, 8.6, 13.8, 20.1, 8.6, 6.9… ## $ Temp        67, 72, 74, 62, 56, 66, 65, 59, 61, 69, 74, 69, 66, 68, 58,… ## $ Month       5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,… ## $ Day         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, … ## $ Ozone_NA    !NA, !NA, !NA, !NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !NA, !… ## $ Solar.R_NA  !NA, !NA, !NA, !NA, NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !N… ## $ Wind_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Temp_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Month_NA    !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Day_NA      !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… glimpse(aq_nab) ## Rows: 153 ## Columns: 12 ## $ Ozone       41, 36, 12, 18, NA, 28, 23, 19, 8, NA, 7, 16, 11, 14, 18, 1… ## $ Solar.R     190, 118, 149, 313, NA, NA, 299, 99, 19, 194, NA, 256, 290,… ## $ Wind        7.4, 8.0, 12.6, 11.5, 14.3, 14.9, 8.6, 13.8, 20.1, 8.6, 6.9… ## $ Temp        67, 72, 74, 62, 56, 66, 65, 59, 61, 69, 74, 69, 66, 68, 58,… ## $ Month       5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,… ## $ Day         1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, … ## $ Ozone_NA    !NA, !NA, !NA, !NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !NA, !… ## $ Solar.R_NA  !NA, !NA, !NA, !NA, NA, NA, !NA, !NA, !NA, !NA, NA, !NA, !N… ## $ Wind_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Temp_NA     !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Month_NA    !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… ## $ Day_NA      !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA, !NA,… all.equal(aq_shadow, aq_nab) ## [1] TRUE airquality %>%   bind_shadow() %>%   group_by(Ozone_NA) %>%   summarise_at(.vars = \"Solar.R\",                .funs = c(\"mean\", \"sd\", \"var\", \"min\", \"max\"),                na.rm = TRUE) ## # A tibble: 2 × 6 ##   Ozone_NA  mean    sd   var   min   max ##            ## 1 !NA       185.  91.2 8309.     7   334 ## 2 NA        190.  87.7 7690.    31   332 ggplot(aq_shadow,        aes(x = Temp,            colour = Ozone_NA)) +    geom_density() # what if we explore the value of air temperature and humidity based on # the missingness of each   oceanbuoys %>%     bind_shadow() %>%     ggplot(aes(x = air_temp_c,                fill = humidity_NA)) +         geom_histogram() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. ## Warning: Removed 81 rows containing non-finite outside the scale range ## (`stat_bin()`). oceanbuoys %>%     bind_shadow() %>%     ggplot(aes(x = humidity,                fill = air_temp_c_NA)) +         geom_histogram() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. ## Warning: Removed 93 rows containing non-finite outside the scale range ## (`stat_bin()`)."},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"visualising-imputed-values","dir":"Articles","previous_headings":"","what":"Visualising imputed values","title":"Getting Started with naniar","text":"easy--use simputation package, impute values Ozone, visualise data:  Note longer get errors regarding missing observations - imputed! comes cost: also longer information imputations - now sort invisible. Using shadow matrix keep track missings , can actually keep track imputations, colouring previously missing Ozone.","code":"library(simputation) ##  ## Attaching package: 'simputation' ## The following object is masked from 'package:naniar': ##  ##     impute_median library(dplyr)  airquality %>%   impute_lm(Ozone ~ Temp + Wind) %>%   ggplot(aes(x = Temp,              y = Ozone)) +    geom_point() aq_shadow %>%   as.data.frame() %>%    impute_lm(Ozone ~ Temp + Wind) %>%   ggplot(aes(x = Temp,              y = Ozone,              colour = Ozone_NA)) +    geom_point()"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"numerical-summaries-of-missing-values","dir":"Articles","previous_headings":"Visualising imputed values","what":"Numerical summaries of missing values","title":"Getting Started with naniar","text":"naniar also provide numerical summaries missing data. Two convenient counters complete values missings n_miss() n_complete(). work dataframes vectors, similar dplyr::n_distinct() syntax numerical sumamries naniar miss_, case, var refer cases variables. summary, table, run, span, cumsum options explore missing data. prop_miss_case pct_miss_case return numeric value describing proportion percent missing values dataframe. miss_case_summary() returns numeric value describes number missings given case (aka row), percent missings row. miss_case_table() tabulates number missing values case / row. , shows number missings case: 111 cases 0 missings, comprises 72% data. 40 cases 1 missing, make 26% data. 2 cases 2 missing - make 1% data. Similar pct_miss_case(), prop_miss_case(), pct_miss_var() prop_miss_var() returns percent proportion variables contain missing value. miss_var_summary() returns number missing values variable, percent missing variable. Finally, miss_var_table(). describes number missings variable. 4 variables 0 missings, comprising 66.67% variables dataset. 1 variable 7 missings 1 variable 37 missings also summary functions exploring missings occur particular span period dataset, number missings single run: miss_var_run(), miss_var_span() miss_var_run() can particularly useful time series data, allows provide summaries number missings complete values single run. function miss_var_run() provides data.frame run length missings complete values. explore function use built-dataset, pedestrian, contains hourly counts pedestrians four locations around Melbourne, Australia, 2016. use miss_var_run(), specify variable want explore runs missingness , case, hourly_counts: miss_var_span() used determine number missings specified repeating span rows variable dataframe. Similar miss_var_run(), specify variable wish explore, also specify size span span_every argument.","code":"dplyr::n_distinct(airquality) ## [1] 153 dplyr::n_distinct(airquality$Ozone) ## [1] 68 n_miss(airquality) ## [1] 44 n_miss(airquality$Ozone) ## [1] 37 n_complete(airquality) ## [1] 874 n_complete(airquality$Ozone) ## [1] 116 prop_miss_case(airquality) ## [1] 0.2745098 pct_miss_case(airquality) ## [1] 27.45098 miss_case_summary(airquality) ## # A tibble: 153 × 3 ##     case n_miss pct_miss ##           ##  1     5      2     33.3 ##  2    27      2     33.3 ##  3     6      1     16.7 ##  4    10      1     16.7 ##  5    11      1     16.7 ##  6    25      1     16.7 ##  7    26      1     16.7 ##  8    32      1     16.7 ##  9    33      1     16.7 ## 10    34      1     16.7 ## # ℹ 143 more rows miss_case_table(airquality) ## # A tibble: 3 × 3 ##   n_miss_in_case n_cases pct_cases ##                     ## 1              0     111     72.5  ## 2              1      40     26.1  ## 3              2       2      1.31 prop_miss_var(airquality) ## [1] 0.3333333 pct_miss_var(airquality) ## [1] 33.33333 miss_var_summary(airquality) ## # A tibble: 6 × 3 ##   variable n_miss pct_miss ##             ## 1 Ozone        37    24.2  ## 2 Solar.R       7     4.58 ## 3 Wind          0     0    ## 4 Temp          0     0    ## 5 Month         0     0    ## 6 Day           0     0 miss_var_table(airquality) ## # A tibble: 3 × 3 ##   n_miss_in_var n_vars pct_vars ##                  ## 1             0      4     66.7 ## 2             7      1     16.7 ## 3            37      1     16.7 miss_var_run(pedestrian,              hourly_counts) ## # A tibble: 35 × 2 ##    run_length is_na    ##              ##  1       6628 complete ##  2          1 missing  ##  3       5250 complete ##  4        624 missing  ##  5       3652 complete ##  6          1 missing  ##  7       1290 complete ##  8        744 missing  ##  9       7420 complete ## 10          1 missing  ## # ℹ 25 more rows miss_var_span(pedestrian,               hourly_counts,               span_every = 100) ## # A tibble: 377 × 6 ##    span_counter n_miss n_complete prop_miss prop_complete n_in_span ##                                       ##  1            1      0        100         0             1       100 ##  2            2      0        100         0             1       100 ##  3            3      0        100         0             1       100 ##  4            4      0        100         0             1       100 ##  5            5      0        100         0             1       100 ##  6            6      0        100         0             1       100 ##  7            7      0        100         0             1       100 ##  8            8      0        100         0             1       100 ##  9            9      0        100         0             1       100 ## 10           10      0        100         0             1       100 ## # ℹ 367 more rows"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"using-group_by-with-naniar","dir":"Articles","previous_headings":"","what":"Using group_by with naniar","title":"Getting Started with naniar","text":"Every miss_* summary function returns dataframe can used dplyr group_by(). example, like look number missing values variables pedestrian data. see hourly_counts. can explore month, filder variable hourly_counts, since one missing values.","code":"pedestrian %>% miss_var_summary() ## # A tibble: 9 × 3 ##   variable      n_miss pct_miss ##                  ## 1 hourly_counts   2548     6.76 ## 2 date_time          0     0    ## 3 year               0     0    ## 4 month              0     0    ## 5 month_day          0     0    ## 6 week_day           0     0    ## 7 hour               0     0    ## 8 sensor_id          0     0    ## 9 sensor_name        0     0 pedestrian %>%  group_by(month) %>%  miss_var_summary() %>%  filter(variable == \"hourly_counts\") ## # A tibble: 12 × 4 ## # Groups:   month [12] ##    month     variable      n_miss pct_miss ##                        ##  1 January   hourly_counts      0     0    ##  2 February  hourly_counts      0     0    ##  3 March     hourly_counts      0     0    ##  4 April     hourly_counts    552    19.2  ##  5 May       hourly_counts     72     2.42 ##  6 June      hourly_counts      0     0    ##  7 July      hourly_counts      0     0    ##  8 August    hourly_counts    408    13.7  ##  9 September hourly_counts      0     0    ## 10 October   hourly_counts    412     7.44 ## 11 November  hourly_counts    888    30.8  ## 12 December  hourly_counts    216     7.26"},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"modelling-missingness","dir":"Articles","previous_headings":"","what":"Modelling missingness","title":"Getting Started with naniar","text":"final question proposed vignette : Can model missingness? Sometimes can impractical explore variables missing data. One approach, however, model missing data using methods Tierney et el. (2015). , approach predict proportion missingness given case, using variables. little helper function add column proportion cases rows missing - add_prop_miss(). created column named “prop_miss”, proportion missing values row. can use model like decision trees predict variables values important predicting proportion missingness:  can see produces quite complex tree - can pruned back depth decision tree controlled.","code":"airquality %>%   add_prop_miss() %>%   head() ##   Ozone Solar.R Wind Temp Month Day prop_miss_all ## 1    41     190  7.4   67     5   1     0.0000000 ## 2    36     118  8.0   72     5   2     0.0000000 ## 3    12     149 12.6   74     5   3     0.0000000 ## 4    18     313 11.5   62     5   4     0.0000000 ## 5    NA      NA 14.3   56     5   5     0.3333333 ## 6    28      NA 14.9   66     5   6     0.1666667 library(rpart) library(rpart.plot)  airquality %>%   add_prop_miss() %>%   rpart(prop_miss_all ~ ., data = .) %>%   prp(type = 4, extra = 101, prefix = \"Prop. Miss = \") ## Warning: Cannot retrieve the data used to build the model (so cannot determine roundint and is.binary for the variables). ## To silence this warning: ##     Call prp with roundint=FALSE, ##     or rebuild the rpart model with model=TRUE."},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"summary","dir":"Articles","previous_headings":"","what":"Summary","title":"Getting Started with naniar","text":"tools naniar help us identify missingness , maintaining tidy workflow. care mechanisms patterns can help us understand potential mechanisms, equipment failures, identify possible solutions based upon evidence.","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"future-development","dir":"Articles","previous_headings":"","what":"Future development","title":"Getting Started with naniar","text":"Make naniar work big data tools like sparklyr, sparklingwater. develop methods handling visualising imputations, multiple imputation. plans extend geom_miss_ family include: Categorical variables Bivariate plots: scatterplots, density overlays Provide tools assessing goodness fit classical approaches MCAR, MAR, MNAR (graphical inference nullabor package)","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"thank-you","dir":"Articles","previous_headings":"","what":"Thank you","title":"Getting Started with naniar","text":"Firstly, thanks Di Cook giving initial inspiration package laying rich theory literature work naniar built upon. Naming credit (!) goes Miles McBain. Among various things, Miles also worked overload missing data make work geom. Thanks also Colin Fay helping understand tidy evaluation features replace_with_na, miss_*_cumsum, .","code":""},{"path":"http://naniar.njtierney.com/articles/getting-started-w-naniar.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Getting Started with naniar","text":"MANET: https://www.rosuda.org/MANET/ ggobi: https://en.wikipedia.org/wiki/GGobi visdat: https://github.com/ropensci/visdat Tierney NJ, Harden FA, Harden MJ, Mengersen, KA, Using decision trees understand structure missing data BMJ Open 2015;5:e007450. doi: 10.1136/bmjopen-2014-007450","code":""},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"Gallery of Missing Data Visualisations","text":"One first plots recommend start first exploring missing data, vis_miss() plot, re-exported visdat.  plot provides specific visualiation amount missing data, showing black location missing values, also providing information overall percentage missing values overall (legend), variable.","code":"library(naniar)  vis_miss(airquality)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"exploring-patterns-with-upsetr","dir":"Articles","previous_headings":"Getting started","what":"Exploring patterns with UpSetR","title":"Gallery of Missing Data Visualisations","text":"upset plot UpSetR package can used visualise patterns missingness, rather combinations missingness across cases. see combinations missingness intersections missingness amongst variables, use gg_miss_upset function:  tells us: Ozone Solar.R missing values Ozone missing values 2 cases Solar.R Ozone missing values together can explore complex data, riskfactors:  default option gg_miss_upset taken UpSetR::upset - use 5 sets 40 interactions. , setting nsets = 5 means look 5 variables combinations. number combinations rather intersections controlled nintersects. , example look number missing variables using n_var_miss:  40 intersections, 40 combinations variables explored. number sets intersections can changed passing arguments nsets = 10 look 10 sets variables, nintersects = 50 look 50 intersections.  Setting nintersects NA plot sets intersections.","code":"gg_miss_upset(airquality) gg_miss_upset(riskfactors) # how many missings? n_var_miss(riskfactors) ## [1] 24 gg_miss_upset(riskfactors, nsets = n_var_miss(riskfactors)) gg_miss_upset(riskfactors,                nsets = 10,               nintersects = 50) gg_miss_upset(riskfactors,                nsets = 10,               nintersects = NA)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"exploring-missingness-mechanisms","dir":"Articles","previous_headings":"","what":"Exploring Missingness Mechanisms","title":"Gallery of Missing Data Visualisations","text":"different ways explore different missing data mechanisms relationships. One way incorporates method shifting missing values can visualised axes regular values, colours missing missing points. implemented geom_miss_point().","code":""},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"geom_miss_point","dir":"Articles","previous_headings":"Exploring Missingness Mechanisms","what":"geom_miss_point","title":"Gallery of Missing Data Visualisations","text":"","code":"library(ggplot2) # using regular geom_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) + geom_point() ## Warning: Removed 42 rows containing missing values or values outside the scale range ## (`geom_point()`). library(naniar)  # using  geom_miss_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() # Facets! ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() +   facet_wrap(~Month) # Themes ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() +   theme_dark()"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"general-visual-summaries-of-missing-data","dir":"Articles","previous_headings":"","what":"General visual summaries of missing data","title":"Gallery of Missing Data Visualisations","text":"function provide quick summaries missingness data, start gg_miss_ - easy remember tab-complete.","code":""},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-in-variables-with-gg_miss_var","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness in variables with gg_miss_var","title":"Gallery of Missing Data Visualisations","text":"plot shows number missing values variable dataset. powered miss_var_summary() function.   wish, can also change whether show % missing instead show_pct = TRUE.  can also plot number missings variable grouped another variable using facet argument.","code":"gg_miss_var(airquality) library(ggplot2) gg_miss_var(airquality) + labs(y = \"Look at all the missing ones\") gg_miss_var(airquality, show_pct = TRUE) gg_miss_var(airquality,             facet = Month)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-in-cases-with-gg_miss_case","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness in cases with gg_miss_case","title":"Gallery of Missing Data Visualisations","text":"plot shows number missing values case. powered miss_case_summary() function.   can also order number cases using order_cases = TRUE  can also explore missingness cases variable using facet = Month","code":"gg_miss_case(airquality) gg_miss_case(airquality) + labs(x = \"Number of Cases\") gg_miss_case(airquality, order_cases = TRUE) gg_miss_case(airquality, facet = Month)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-across-factors-with-gg_miss_fct","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness across factors with gg_miss_fct","title":"Gallery of Missing Data Visualisations","text":"plot shows number missings column, broken categorical variable dataset. powered dplyr::group_by statement followed miss_var_summary().   gg_miss_fct can also used explore missingness along time, like :   (Thanks Maria Paula Caldas inspiration visualisation, discussed )","code":"gg_miss_fct(x = riskfactors, fct = marital) library(ggplot2) gg_miss_fct(x = riskfactors, fct = marital) + labs(title = \"NA in Risk Factors and Marital status\") # using group_by library(dplyr) ##  ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ##  ##     filter, lag ## The following objects are masked from 'package:base': ##  ##     intersect, setdiff, setequal, union riskfactors %>%   group_by(marital) %>%   miss_var_summary() ## # A tibble: 231 × 4 ## # Groups:   marital [7] ##    marital variable      n_miss pct_miss ##                      ##  1 Married smoke_stop       120    91.6  ##  2 Married pregnant         117    89.3  ##  3 Married smoke_last        84    64.1  ##  4 Married smoke_days        73    55.7  ##  5 Married drink_average     68    51.9  ##  6 Married health_poor       67    51.1  ##  7 Married drink_days        67    51.1  ##  8 Married weight_lbs         6     4.58 ##  9 Married bmi                6     4.58 ## 10 Married diet_fruit         4     3.05 ## # ℹ 221 more rows gg_miss_fct(oceanbuoys, year) # to load who data library(tidyr) gg_miss_fct(who, year)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"missingness-along-a-repeating-span-with-gg_miss_span","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"Missingness along a repeating span with gg_miss_span","title":"Gallery of Missing Data Visualisations","text":"plot shows number missings given span, breaksize, single selected variable. case look span hourly_counts pedestrian dataset. powered miss_var_span function    can also explore miss_var_span group facet argument.","code":"# data method  miss_var_span(pedestrian, hourly_counts, span_every = 3000) ## # A tibble: 13 × 6 ##    span_counter n_miss n_complete prop_miss prop_complete n_in_span ##                                       ##  1            1      0       3000  0                1          3000 ##  2            2      0       3000  0                1          3000 ##  3            3      1       2999  0.000333         1.00       3000 ##  4            4    121       2879  0.0403           0.960      3000 ##  5            5    503       2497  0.168            0.832      3000 ##  6            6    555       2445  0.185            0.815      3000 ##  7            7    190       2810  0.0633           0.937      3000 ##  8            8      0       3000  0                1          3000 ##  9            9      1       2999  0.000333         1.00       3000 ## 10           10      0       3000  0                1          3000 ## 11           11      0       3000  0                1          3000 ## 12           12    745       2255  0.248            0.752      3000 ## 13           13    432       1268  0.254            0.746      1700 gg_miss_span(pedestrian, hourly_counts, span_every = 3000) # works with the rest of ggplot gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + labs(x = \"custom\") gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + theme_dark() gg_miss_span(pedestrian,               hourly_counts,               span_every = 3000,               facet = sensor_name)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"gg_miss_case_cumsum","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"gg_miss_case_cumsum","title":"Gallery of Missing Data Visualisations","text":"plot shows cumulative sum missing values, reading rows dataset top bottom. powered miss_case_cumsum() function.","code":"gg_miss_case_cumsum(airquality) library(ggplot2) gg_miss_case_cumsum(riskfactors, breaks = 50) + theme_bw()"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"gg_miss_var_cumsum","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"gg_miss_var_cumsum","title":"Gallery of Missing Data Visualisations","text":"plot shows cumulative sum missing values, reading columns left right dataframe. powered miss_var_cumsum() function.","code":"gg_miss_var_cumsum(airquality)"},{"path":"http://naniar.njtierney.com/articles/naniar-visualisation.html","id":"gg_miss_which","dir":"Articles","previous_headings":"General visual summaries of missing data","what":"gg_miss_which","title":"Gallery of Missing Data Visualisations","text":"plot shows set rectangles indicate whether missing element column .","code":"gg_miss_which(airquality)"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"example-data","dir":"Articles","previous_headings":"","what":"Example data","title":"Replacing values with NA","text":"First, introduce small fictional dataset, df, contains common features dataset sorts missing values might encounter. includes multiple specifications missing values, “N/”, “N ”, “Available”. also common numeric codes, like -98, -99, -1.","code":"df <- tibble::tribble(   ~name,           ~x,  ~y,              ~z,     \"N/A\",           1,   \"N/A\",           -100,    \"N A\",           3,   \"NOt available\", -99,   \"N / A\",         NA,  \"29\",              -98,   \"Not Available\", -99, \"25\",              -101,   \"John Smith\",    -98, \"28\",              -1)"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"using-replace_with_na","dir":"Articles","previous_headings":"Example data","what":"Using replace_with_na","title":"Replacing values with NA","text":"want replace value -99 x column missing value? First, let’s load naniar: Now, specify fact want replace -99 missing value. use replace argument, specify named list, contains names variable value take replace NA. say want replace -98 well? want replace -99 -98 numeric columns, x z? Using replace_with_na() works well know exact value replaced, variables want replace, providing many variables. ’ve got many variables want observe?","code":"library(naniar) df %>% replace_with_na(replace = list(x = -99)) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available   -99 #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1 df %>%   replace_with_na(replace = list(x = c(-99, -98))) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available   -99 #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith       NA 28               -1 df %>%   replace_with_na(replace = list(x = c(-99,-98),                              z = c(-99, -98))) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29               NA #> 4 Not Available    NA 25             -101 #> 5 John Smith       NA 28               -1"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"extending-replace_with_na","dir":"Articles","previous_headings":"Example data","what":"Extending replace_with_na","title":"Replacing values with NA","text":"Sometimes many value want replace. example, -99 -98 , also variants “NA”, “N/”, “N / ”, “Available”. might also certain variables want affected rules, might complex rules, like, “affect variables numeric, character, rule”. account cases borrowed dplyr’s scoped variants created functions: replace_with_na_all() Replaces NA variables. replace_with_na_at() Replaces NA subset variables specified character quotes (e.g., c(“var1”, “var2”)). replace_with_na_if() Replaces NA based applying operation subset variables predicate function (.numeric, .character, etc) returns TRUE. now consider simple examples use functions, can better understand use .","code":""},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"using-replace_with_na_all","dir":"Articles","previous_headings":"Example data","what":"Using replace_with_na_all","title":"Replacing values with NA","text":"Use replace_with_na_all() want replace values meet condition across entire dataset. syntax little different, follows rules rlang’s expression simple functions. means function starts ~, referencing variable, use .x. example, want replace cases -99 dataset, write: Likewise, set (annoying) repeating strings like various spellings “NA”, suggest first lay offending cases: write ~.x %% na_strings - reads “value occur list NA strings”. can also use built-strings numbers naniar: common_na_numbers common_na_strings can replace values matching strings numbers like :","code":"df %>% replace_with_na_all(condition = ~.x == -99) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1 # write out all the offending strings na_strings <- c(\"NA\", \"N A\", \"N / A\", \"N/A\", \"N/ A\", \"Not Available\", \"NOt available\") df %>%   replace_with_na_all(condition = ~.x %in% na_strings) #> # A tibble: 5 × 4 #>   name           x y         z #>            #> 1 NA             1 NA     -100 #> 2 NA             3 NA      -99 #> 3 NA            NA 29      -98 #> 4 NA           -99 25     -101 #> 5 John Smith   -98 28       -1 common_na_numbers #> [1]    -9   -99  -999 -9999  9999    66    77    88 common_na_strings #>  [1] \"missing\" \"NA\"      \"N A\"     \"N/A\"     \"#N/A\"    \"NA \"     \" NA\"     #>  [8] \"N /A\"    \"N / A\"   \" N / A\"  \"N / A \"  \"na\"      \"n a\"     \"n/a\"     #> [15] \"na \"     \" na\"     \"n /a\"    \"n / a\"   \" a / a\"  \"n / a \"  \"NULL\"    #> [22] \"null\"    \"\"        \"\\\\?\"     \"\\\\*\"     \"\\\\.\" df %>%   replace_with_na_all(condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 NA                1 NA             -100 #> 2 NA                3 NOt available   -99 #> 3 NA               NA 29              -98 #> 4 Not Available   -99 25             -101 #> 5 John Smith      -98 28               -1"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"replace_with_na_at","dir":"Articles","previous_headings":"Example data > Using replace_with_na_all","what":"replace_with_na_at","title":"Replacing values with NA","text":"similar _all, instead case can specify variables want affected rule state. useful cases want specify rule affects selected number variables. Although can achieve regular replace_with_na(), concise use, replace_with_na_at(). Additionally, can specify rules function, example, make value NA exponent number less 1:","code":"df %>%    replace_with_na_at(.vars = c(\"x\",\"z\"),                      condition = ~.x == -99) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1 df %>%    replace_with_na_at(.vars = c(\"x\",\"z\"),                      condition = ~ exp(.x) < 1) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A              NA #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29               NA #> 4 Not Available    NA 25               NA #> 5 John Smith       NA 28               NA"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"replace_with_na_if","dir":"Articles","previous_headings":"Example data > Using replace_with_na_all","what":"replace_with_na_if","title":"Replacing values with NA","text":"may cases can identify variables based test - .character() - character variables? .numeric() - numeric double? given value inside type data. example, means able apply rule many variables meet pre-specified condition. can particular use many variables don’t want list , also know particular problem variables particular class.","code":"df %>%   replace_with_na_if(.predicate = is.character,                      condition = ~.x %in% (\"N/A\")) #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 NA                1 NA             -100 #> 2 N A               3 NOt available   -99 #> 3 N / A            NA 29              -98 #> 4 Not Available   -99 25             -101 #> 5 John Smith      -98 28               -1  # or df %>%   replace_with_na_if(.predicate = is.character,                      condition = ~.x %in% (na_strings)) #> # A tibble: 5 × 4 #>   name           x y         z #>            #> 1 NA             1 NA     -100 #> 2 NA             3 NA      -99 #> 3 NA            NA 29      -98 #> 4 NA           -99 25     -101 #> 5 John Smith   -98 28       -1"},{"path":"http://naniar.njtierney.com/articles/replace-with-na.html","id":"notes-on-alternative-ways-to-handle-replacing-with-nas","dir":"Articles","previous_headings":"","what":"Notes on alternative ways to handle replacing with NAs","title":"Replacing values with NA","text":"alternative ways handle replacing values NA tidyverse, na_if using readr. ultimately expressive replace_with_na() functions, useful one kind value replace missing, know missing values upon reading data. dplyr::na_if function allows replace exact values - similar replace_with_na(), one single column data frame. use examples. Note, however, na_if() can take arguments length one. means capture statements like also handle complex equations, want refer values columns, values less greater another value. catch NAs readr reading data, can use na argument inside readr replace certain values NA. example: convert values na_strings missing values. useful use happen know NA types upon reading data. However, always practical data analysis pipeline.","code":"# instead of: df_1 <- df %>% replace_with_na_all(condition = ~.x == -99) df_1 #> # A tibble: 5 × 4 #>   name              x y                 z #>                       #> 1 N/A               1 N/A            -100 #> 2 N A               3 NOt available    NA #> 3 N / A            NA 29              -98 #> 4 Not Available    NA 25             -101 #> 5 John Smith      -98 28               -1  df_2 <- df %>% dplyr::mutate(   x = dplyr::na_if(x, -99),   y = dplyr::na_if(z, -99) ) df_2 #> # A tibble: 5 × 4 #>   name              x     y     z #>               #> 1 N/A               1  -100  -100 #> 2 N A               3    NA   -99 #> 3 N / A            NA   -98   -98 #> 4 Not Available    NA  -101  -101 #> 5 John Smith      -98    -1    -1  # are they the same? all.equal(df_1, df_2) #> [1] \"Component \\\"y\\\": Modes: character, numeric\"                        #> [2] \"Component \\\"y\\\": target is character, current is numeric\"          #> [3] \"Component \\\"z\\\": 'is.NA' value mismatch: 0 in current 1 in target\" na_strings <- c(\"NA\", \"N A\", \"N / A\", \"N/A\", \"N/ A\", \"Not Available\", \"NOt available\") df_3 <- df %>% replace_with_na_all(condition = ~.x %in% na_strings) # Not run: df_4 <- df %>% dplyr::na_if(x = ., y = na_strings) # Error in check_length(y, x, fmt_args(\"y\"), glue(\"same as {fmt_args(~x)}\")) :    # argument \"y\" is missing, with no default # not run dat_raw <- readr::read_csv(\"original.csv\", na = na_strings)"},{"path":"http://naniar.njtierney.com/articles/special-missing-values.html","id":"terminology","dir":"Articles","previous_headings":"","what":"Terminology","title":"Special Missing Values","text":"Missing data can represented binary matrix “missing” “missing”, naniar call “shadow matrix”, term borrowed Swayne Buja, 1998. shadow matrix three key features facilitate analysis Coordinated names: Variables shadow matrix gain name data, suffix “_NA”. Special missing values: Values shadow matrix can “special” missing values, indicated NA_suffix, “suffix” short message type missings. Cohesiveness: Binding shadow matrix column-wise original data creates cohesive “nabular” data form, useful visualization summaries. create nabular data binding shadow data: keeps data values tied missingness, great benefits exploring missing imputed values data. See vignettes Getting Started naniar Exploring Imputations naniar details.","code":"library(naniar) as_shadow(oceanbuoys) #> # A tibble: 736 × 8 #>    year_NA latitude_NA longitude_NA sea_temp_c_NA air_temp_c_NA humidity_NA #>                                               #>  1 !NA     !NA         !NA          !NA           !NA           !NA         #>  2 !NA     !NA         !NA          !NA           !NA           !NA         #>  3 !NA     !NA         !NA          !NA           !NA           !NA         #>  4 !NA     !NA         !NA          !NA           !NA           !NA         #>  5 !NA     !NA         !NA          !NA           !NA           !NA         #>  6 !NA     !NA         !NA          !NA           !NA           !NA         #>  7 !NA     !NA         !NA          !NA           !NA           !NA         #>  8 !NA     !NA         !NA          !NA           !NA           !NA         #>  9 !NA     !NA         !NA          !NA           !NA           !NA         #> 10 !NA     !NA         !NA          !NA           !NA           !NA         #> # ℹ 726 more rows #> # ℹ 2 more variables: wind_ew_NA , wind_ns_NA  bind_shadow(oceanbuoys) #> # A tibble: 736 × 16 #>     year latitude longitude sea_temp_c air_temp_c humidity wind_ew wind_ns #>                                    #>  1  1997        0      -110       27.6       27.1     79.6   -6.40    5.40 #>  2  1997        0      -110       27.5       27.0     75.8   -5.30    5.30 #>  3  1997        0      -110       27.6       27       76.5   -5.10    4.5  #>  4  1997        0      -110       27.6       26.9     76.2   -4.90    2.5  #>  5  1997        0      -110       27.6       26.8     76.4   -3.5     4.10 #>  6  1997        0      -110       27.8       26.9     76.7   -4.40    1.60 #>  7  1997        0      -110       28.0       27.0     76.5   -2       3.5  #>  8  1997        0      -110       28.0       27.1     78.3   -3.70    4.5  #>  9  1997        0      -110       28.0       27.2     78.6   -4.20    5    #> 10  1997        0      -110       28.0       27.2     76.9   -3.60    3.5  #> # ℹ 726 more rows #> # ℹ 8 more variables: year_NA , latitude_NA , longitude_NA , #> #   sea_temp_c_NA , air_temp_c_NA , humidity_NA , #> #   wind_ew_NA , wind_ns_NA "},{"path":"http://naniar.njtierney.com/articles/special-missing-values.html","id":"recoding-missing-values","dir":"Articles","previous_headings":"","what":"Recoding missing values","title":"Special Missing Values","text":"demonstrate recoding missing values, use toy dataset, dat: recode value -99 missing value “broken_machine”, first create nabular data bind_shadow: Special types missingness encoded shadow part nabular data, using recode_shadow function, can recode missing values like : reads “recode shadow wind wind equal -99, give label”broken_machine”. .function used help make intent clearer, reads much like dplyr::case_when() function, takes care encoding extra factor levels missing data. extra types missingness recoded shadow part nabular data additional factor levels: additional types missingness recorded across shadow variables, even variables don’t contain special missing value. ensures flavours missingness known. summarise, use recode_shadow, user provides following information: variable want effect (recode_shadow(var = ...)) condition want implement (.(condition ~ ...)) suffix new type missing value (.(condition ~ suffix)) hood, special missing value recoded new factor level shadow matrix, every column aware possible new values missingness. examples using recode_shadow workflow discussed detail near future, moment, recommended workflow: Use recode_shadow() actual data Replacing previous actual values using replace_with_na() (see vignette replacing values NA) Explore missings special cases considered Explore imputed values, looking special cases","code":"df <- tibble::tribble( ~wind, ~temp, -99,    45, 68,    NA, 72,    25 )  df #> # A tibble: 3 × 2 #>    wind  temp #>     #> 1   -99    45 #> 2    68    NA #> 3    72    25 dfs <- bind_shadow(df)  dfs #> # A tibble: 3 × 4 #>    wind  temp wind_NA temp_NA #>           #> 1   -99    45 !NA     !NA     #> 2    68    NA !NA     NA      #> 3    72    25 !NA     !NA dfs_recode <- dfs %>%    recode_shadow(wind = .where(wind == -99 ~ \"broken_machine\")) levels(dfs_recode$wind_NA) #> [1] \"!NA\"               \"NA\"                \"NA_broken_machine\" levels(dfs_recode$temp_NA) #> [1] \"!NA\"               \"NA\"                \"NA_broken_machine\""},{"path":"http://naniar.njtierney.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nicholas Tierney. Author, maintainer. Di Cook. Author. Miles McBain. Author. Colin Fay. Author. Mitchell O'Hara-Wild. Contributor. Jim Hester. Contributor. Luke Smith. Contributor. Andrew Heiss. Contributor.","code":""},{"path":"http://naniar.njtierney.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tierney N, Cook D (2023). “Expanding Tidy Data Principles Facilitate Missing Data Exploration, Visualization Assessment Imputations.” Journal Statistical Software, 105(7), 1–31. doi:10.18637/jss.v105.i07.","code":"@Article{,   title = {Expanding Tidy Data Principles to Facilitate Missing Data Exploration, Visualization and Assessment of Imputations},   author = {Nicholas Tierney and Dianne Cook},   journal = {Journal of Statistical Software},   year = {2023},   volume = {105},   number = {7},   pages = {1--31},   doi = {10.18637/jss.v105.i07}, }"},{"path":"http://naniar.njtierney.com/index.html","id":"naniar-","dir":"","previous_headings":"","what":"Data Structures, Summaries, and Visualisations for Missing Data","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides principled, tidy ways summarise, visualise, manipulate missing data minimal deviations workflows ggplot2 tidy data. providing: bind_shadow() nabular() n_miss() n_complete() pct_miss()pct_complete() miss_var_summary() miss_var_table() miss_case_summary(), miss_case_table() mcar_test() Little’s (1988) missing completely random (MCAR) test geom_miss_point() gg_miss_var() gg_miss_case() gg_miss_fct() details workflow theory underpinning naniar, read vignette Getting started naniar. short primer data visualisation available naniar, read vignette Gallery Missing Data Visualisations. full details package, including","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"can install naniar CRAN: can install development version github using remotes:","code":"install.packages(\"naniar\") # install.packages(\"remotes\") remotes::install_github(\"njtierney/naniar\")"},{"path":"http://naniar.njtierney.com/index.html","id":"a-short-overview-of-naniar","dir":"","previous_headings":"","what":"A short overview of naniar","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Visualising missing data might sound little strange - visualise something ? One approach visualising missing data comes ggobi manet, replaces NA values values 10% lower minimum value variable. visualisation provided geom_miss_point() ggplot2 geom, illustrate exploring relationship Ozone Solar radiation airquality dataset.  ggplot2 handle missing values, get warning message missing values. can instead use geom_miss_point() display missing data  geom_miss_point() shifted missing values now 10% minimum value. missing values different colour missingness becomes pre-attentive. ggplot2 geom, supports features like faceting ggplot features.","code":"library(ggplot2)  ggplot(data = airquality,        aes(x = Ozone,            y = Solar.R)) +   geom_point() #> Warning: Removed 42 rows containing missing values or values outside the scale range #> (`geom_point()`). library(naniar)  ggplot(data = airquality,        aes(x = Ozone,            y = Solar.R)) +   geom_miss_point() p1 <- ggplot(data = airquality,        aes(x = Ozone,            y = Solar.R)) +    geom_miss_point() +    facet_wrap(~Month, ncol = 2) +    theme(legend.position = \"bottom\")  p1"},{"path":"http://naniar.njtierney.com/index.html","id":"data-structures","dir":"","previous_headings":"","what":"Data Structures","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides data structure working missing data, shadow matrix (Swayne Buja, 1998). shadow matrix dimension data, consists binary indicators missingness data values, missing represented “NA”, missing represented “!NA”, variable names kep , added suffix “_NA” variables. Binding shadow data data help keep better track missing values. format called “nabular”, portmanteau NA tabular. can bind shadow data using bind_shadow nabular: Using nabular format helps manage missing values dataset make easy visualisations split missingness:  even visualise imputations  perform upset plot - plot combinations missingness across cases, using gg_miss_upset function  naniar following consistent principles easy read, thanks tools tidyverse. naniar also provides handy visualations variable:  number missings given variable repeating span  can read visualisations naniar vignette Gallery missing data visualisations using naniar. naniar also provides handy helpers calculating number, proportion, percentage missing complete observations:","code":"head(airquality) #>   Ozone Solar.R Wind Temp Month Day #> 1    41     190  7.4   67     5   1 #> 2    36     118  8.0   72     5   2 #> 3    12     149 12.6   74     5   3 #> 4    18     313 11.5   62     5   4 #> 5    NA      NA 14.3   56     5   5 #> 6    28      NA 14.9   66     5   6  as_shadow(airquality) #> # A tibble: 153 × 6 #>    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA #>                          #>  1 !NA      !NA        !NA     !NA     !NA      !NA    #>  2 !NA      !NA        !NA     !NA     !NA      !NA    #>  3 !NA      !NA        !NA     !NA     !NA      !NA    #>  4 !NA      !NA        !NA     !NA     !NA      !NA    #>  5 NA       NA         !NA     !NA     !NA      !NA    #>  6 !NA      NA         !NA     !NA     !NA      !NA    #>  7 !NA      !NA        !NA     !NA     !NA      !NA    #>  8 !NA      !NA        !NA     !NA     !NA      !NA    #>  9 !NA      !NA        !NA     !NA     !NA      !NA    #> 10 NA       !NA        !NA     !NA     !NA      !NA    #> # ℹ 143 more rows bind_shadow(airquality) #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA  nabular(airquality) #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA  airquality %>%   bind_shadow() %>%   ggplot(aes(x = Temp,              fill = Ozone_NA)) +    geom_density(alpha = 0.5) airquality %>%   bind_shadow() %>%   as.data.frame() %>%     simputation::impute_lm(Ozone ~ Temp + Solar.R) %>%   ggplot(aes(x = Solar.R,              y = Ozone,              colour = Ozone_NA)) +    geom_point() #> Warning: Removed 7 rows containing missing values or values outside the scale range #> (`geom_point()`). gg_miss_upset(airquality) gg_miss_var(airquality) gg_miss_span(pedestrian,              var = hourly_counts,              span_every = 1500) n_miss(airquality) #> [1] 44 n_complete(airquality) #> [1] 874 prop_miss(airquality) #> [1] 0.04793028 prop_complete(airquality) #> [1] 0.9520697 pct_miss(airquality) #> [1] 4.793028 pct_complete(airquality) #> [1] 95.20697"},{"path":"http://naniar.njtierney.com/index.html","id":"numerical-summaries-for-missing-data","dir":"","previous_headings":"","what":"Numerical summaries for missing data","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides numerical summaries missing data, follow consistent rule uses syntax begining miss_. Summaries focussing variables single selected variable, start miss_var_, summaries cases (initial collected row order data), start miss_case_. functions return dataframes also work dplyr’s group_by(). example, can look number percent missings case variable miss_var_summary(), miss_case_summary(), return output ordered number missing values. also group_by() work number missings variable across levels within . can read functions vignette “Getting Started naniar”.","code":"miss_var_summary(airquality) #> # A tibble: 6 × 3 #>   variable n_miss pct_miss #>             #> 1 Ozone        37    24.2  #> 2 Solar.R       7     4.58 #> 3 Wind          0     0    #> 4 Temp          0     0    #> 5 Month         0     0    #> 6 Day           0     0 miss_case_summary(airquality) #> # A tibble: 153 × 3 #>     case n_miss pct_miss #>           #>  1     5      2     33.3 #>  2    27      2     33.3 #>  3     6      1     16.7 #>  4    10      1     16.7 #>  5    11      1     16.7 #>  6    25      1     16.7 #>  7    26      1     16.7 #>  8    32      1     16.7 #>  9    33      1     16.7 #> 10    34      1     16.7 #> # ℹ 143 more rows library(dplyr) #>  #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #>  #>     filter, lag #> The following objects are masked from 'package:base': #>  #>     intersect, setdiff, setequal, union airquality %>%   group_by(Month) %>%   miss_var_summary() #> # A tibble: 25 × 4 #> # Groups:   Month [5] #>    Month variable n_miss pct_miss #>               #>  1     5 Ozone         5     16.1 #>  2     5 Solar.R       4     12.9 #>  3     5 Wind          0      0   #>  4     5 Temp          0      0   #>  5     5 Day           0      0   #>  6     6 Ozone        21     70   #>  7     6 Solar.R       0      0   #>  8     6 Wind          0      0   #>  9     6 Temp          0      0   #> 10     6 Day           0      0   #> # ℹ 15 more rows"},{"path":"http://naniar.njtierney.com/index.html","id":"statistical-tests-of-missingness","dir":"","previous_headings":"","what":"Statistical tests of missingness","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar provides mcar_test() Little’s (1988) statistical test missing completely random (MCAR) data. null hypothesis test data MCAR, test statistic chi-squared value. Given high statistic value low p-value, can conclude airquality data missing completely random:","code":"mcar_test(airquality) #> # A tibble: 1 × 4 #>   statistic    df p.value missing.patterns #>                        #> 1      35.1    14 0.00142                4"},{"path":"http://naniar.njtierney.com/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"future-work","dir":"","previous_headings":"","what":"Future Work","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Extend geom_miss_* family include categorical variables, Bivariate plots: scatterplots, density overlays SQL translation databases Big Data tools (sparklyr, sparklingwater) Work well imputation engines / processes Provide tools assessing goodness fit classical approaches MCAR, MAR, MNAR (graphical inference nullabor package)","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"Firstly, thanks Di Cook giving initial inspiration package laying rich theory literature work naniar built upon. Naming credit (!) goes Miles McBain. Among various things, Miles also worked overload missing data make work geom. Thanks also Colin Fay helping understand tidy evaluation features replace_to_na, miss_*_cumsum, .","code":""},{"path":"http://naniar.njtierney.com/index.html","id":"a-note-on-the-name","dir":"","previous_headings":"","what":"A note on the name","title":"Data Structures, Summaries, and Visualisations for Missing Data","text":"naniar previously named ggmissing initially provided ggplot geom visualisations. ggmissing changed naniar reflect fact package going bigger scope, just related ggplot2. Specifically, package designed provide suite tools generating visualisations missing values imputations, manipulate, summarise missing data. …naniar? Well, think useful think missing values data like dimension, perhaps like C.S. Lewis’s Narnia - different world, hidden away. go inside, sometimes seems like ’ve spent time time passed quickly, opposite. Also, NAniar = na r, desire, naniar may sound like “noneoya” nz/aussie accent. Full credit @MilesMcbain name, @Hadley rearranged spelling.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column describing presence of any missing values — add_any_miss","title":"Add a column describing presence of any missing values — add_any_miss","text":"adds column named \"any_miss\" (default) describes whether missings variables (default), whether specified columns, specified using variables names dplyr verbs, starts_with, contains, ends_with, etc. default added column called \"any_miss_all\", variables specified, otherwise, variables specified, label \"any_miss_vars\" indicate variables used create labels.","code":""},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column describing presence of any missing values — add_any_miss","text":"","code":"add_any_miss(   data,   ...,   label = \"any_miss\",   missing = \"missing\",   complete = \"complete\" )"},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column describing presence of any missing values — add_any_miss","text":"data data.frame ... Variable names use instead whole dataset. default looks whole dataset. Otherwise, one unquoted expressions separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. default add \"_all\" label left blank, otherwise add \"_vars\" distinguish used variables. label label column, defaults \"any_miss\". default additional variables listed label col \"any_miss_all\", otherwise \"any_miss_vars\", variables specified. missing character label values missing - defaults \"missing\" complete character character label values complete - defaults \"complete\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a column describing presence of any missing values — add_any_miss","text":"data.frame data column labelling whether row (variables) missing values - indicated \"missing\" \"complete\".","code":""},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a column describing presence of any missing values — add_any_miss","text":"default prefix \"any_miss\" used, can changed label argument.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_any_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column describing presence of any missing values — add_any_miss","text":"","code":"airquality %>% add_any_miss() #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_miss_all #>                    #>  1    41     190   7.4    67     5     1 complete     #>  2    36     118   8      72     5     2 complete     #>  3    12     149  12.6    74     5     3 complete     #>  4    18     313  11.5    62     5     4 complete     #>  5    NA      NA  14.3    56     5     5 missing      #>  6    28      NA  14.9    66     5     6 missing      #>  7    23     299   8.6    65     5     7 complete     #>  8    19      99  13.8    59     5     8 complete     #>  9     8      19  20.1    61     5     9 complete     #> 10    NA     194   8.6    69     5    10 missing      #> # ℹ 143 more rows airquality %>% add_any_miss(Ozone, Solar.R) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_miss_vars #>                     #>  1    41     190   7.4    67     5     1 complete      #>  2    36     118   8      72     5     2 complete      #>  3    12     149  12.6    74     5     3 complete      #>  4    18     313  11.5    62     5     4 complete      #>  5    NA      NA  14.3    56     5     5 missing       #>  6    28      NA  14.9    66     5     6 missing       #>  7    23     299   8.6    65     5     7 complete      #>  8    19      99  13.8    59     5     8 complete      #>  9     8      19  20.1    61     5     9 complete      #> 10    NA     194   8.6    69     5    10 missing       #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column describing if there are any missings in the dataset — add_label_missings","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"Add column describing missings dataset","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"","code":"add_label_missings(data, ..., missing = \"Missing\", complete = \"Not Missing\")"},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"data data.frame ... extra variable label missing character label values missing - defaults \"Missing\" complete character character label values complete - defaults \"Missing\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"data.frame column \"any_missing\" either \"Missing\" \"Missing\" purposes plotting / exploration / nice print methods","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_label_missings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column describing if there are any missings in the dataset — add_label_missings","text":"","code":"airquality %>% add_label_missings() #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_missing #>                   #>  1    41     190   7.4    67     5     1 Not Missing #>  2    36     118   8      72     5     2 Not Missing #>  3    12     149  12.6    74     5     3 Not Missing #>  4    18     313  11.5    62     5     4 Not Missing #>  5    NA      NA  14.3    56     5     5 Missing     #>  6    28      NA  14.9    66     5     6 Missing     #>  7    23     299   8.6    65     5     7 Not Missing #>  8    19      99  13.8    59     5     8 Not Missing #>  9     8      19  20.1    61     5     9 Not Missing #> 10    NA     194   8.6    69     5    10 Missing     #> # ℹ 143 more rows airquality %>% add_label_missings(Ozone, Solar.R) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_missing #>                   #>  1    41     190   7.4    67     5     1 Not Missing #>  2    36     118   8      72     5     2 Not Missing #>  3    12     149  12.6    74     5     3 Not Missing #>  4    18     313  11.5    62     5     4 Not Missing #>  5    NA      NA  14.3    56     5     5 Missing     #>  6    28      NA  14.9    66     5     6 Missing     #>  7    23     299   8.6    65     5     7 Not Missing #>  8    19      99  13.8    59     5     8 Not Missing #>  9     8      19  20.1    61     5     9 Not Missing #> 10    NA     194   8.6    69     5    10 Missing     #> # ℹ 143 more rows airquality %>% add_label_missings(Ozone, Solar.R, missing = \"yes\", complete = \"no\") #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day any_missing #>                   #>  1    41     190   7.4    67     5     1 no          #>  2    36     118   8      72     5     2 no          #>  3    12     149  12.6    74     5     3 no          #>  4    18     313  11.5    62     5     4 no          #>  5    NA      NA  14.3    56     5     5 yes         #>  6    28      NA  14.9    66     5     6 yes         #>  7    23     299   8.6    65     5     7 no          #>  8    19      99  13.8    59     5     8 no          #>  9     8      19  20.1    61     5     9 no          #> 10    NA     194   8.6    69     5    10 yes         #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column describing whether there is a shadow — add_label_shadow","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"Instead focussing labelling whether missings, instead focus whether shadows created. can useful data imputed need determine rows contained missing values shadow bound dataset.","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"","code":"add_label_shadow(data, ..., missing = \"Missing\", complete = \"Not Missing\")"},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"data data.frame ... extra variable label missing character label values missing - defaults \"Missing\" complete character character label values complete - defaults \"Missing\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"data.frame column, \"any_missing\", describes whether rows shadow value.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_label_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column describing whether there is a shadow — add_label_shadow","text":"","code":"airquality %>%   add_shadow(Ozone, Solar.R) %>%   add_label_shadow() #> # A tibble: 153 × 9 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA any_missing #>                             #>  1    41     190   7.4    67     5     1 !NA      !NA        Not Missing #>  2    36     118   8      72     5     2 !NA      !NA        Not Missing #>  3    12     149  12.6    74     5     3 !NA      !NA        Not Missing #>  4    18     313  11.5    62     5     4 !NA      !NA        Not Missing #>  5    NA      NA  14.3    56     5     5 NA       NA         Missing     #>  6    28      NA  14.9    66     5     6 !NA      NA         Missing     #>  7    23     299   8.6    65     5     7 !NA      !NA        Not Missing #>  8    19      99  13.8    59     5     8 !NA      !NA        Not Missing #>  9     8      19  20.1    61     5     9 !NA      !NA        Not Missing #> 10    NA     194   8.6    69     5    10 NA       !NA        Missing     #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a column that tells us which ","title":"Add a column that tells us which ","text":"way extract cluster missingness group belongs . example, use vis_miss(airquality, cluster = TRUE), can see clustering data, way identify cluster. Future work incorporate seriation package allow better control clustering user.","code":""},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a column that tells us which ","text":"","code":"add_miss_cluster(data, cluster_method = \"mcquitty\", n_clusters = 2)"},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a column that tells us which ","text":"data dataframe cluster_method character vector agglomeration method use, default \"mcquitty\". Options taken stats::hclust helpfile, options include: \"ward.D\", \"ward.D2\", \"single\", \"complete\", \"average\" (= UPGMA), \"mcquitty\" (= WPGMA), \"median\" (= WPGMC) \"centroid\" (= UPGMC). n_clusters numeric number clusters expect. Defaults 2.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_miss_cluster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a column that tells us which ","text":"","code":"add_miss_cluster(airquality) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day miss_cluster #>                    #>  1    41     190   7.4    67     5     1            1 #>  2    36     118   8      72     5     2            1 #>  3    12     149  12.6    74     5     3            1 #>  4    18     313  11.5    62     5     4            1 #>  5    NA      NA  14.3    56     5     5            2 #>  6    28      NA  14.9    66     5     6            1 #>  7    23     299   8.6    65     5     7            1 #>  8    19      99  13.8    59     5     8            1 #>  9     8      19  20.1    61     5     9            1 #> 10    NA     194   8.6    69     5    10            2 #> # ℹ 143 more rows add_miss_cluster(airquality, n_clusters = 3) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day miss_cluster #>                    #>  1    41     190   7.4    67     5     1            1 #>  2    36     118   8      72     5     2            1 #>  3    12     149  12.6    74     5     3            1 #>  4    18     313  11.5    62     5     4            1 #>  5    NA      NA  14.3    56     5     5            2 #>  6    28      NA  14.9    66     5     6            1 #>  7    23     299   8.6    65     5     7            1 #>  8    19      99  13.8    59     5     8            1 #>  9     8      19  20.1    61     5     9            1 #> 10    NA     194   8.6    69     5    10            3 #> # ℹ 143 more rows add_miss_cluster(airquality, cluster_method = \"ward.D\", n_clusters = 3) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day miss_cluster #>                    #>  1    41     190   7.4    67     5     1            1 #>  2    36     118   8      72     5     2            1 #>  3    12     149  12.6    74     5     3            1 #>  4    18     313  11.5    62     5     4            1 #>  5    NA      NA  14.3    56     5     5            2 #>  6    28      NA  14.9    66     5     6            2 #>  7    23     299   8.6    65     5     7            1 #>  8    19      99  13.8    59     5     8            1 #>  9     8      19  20.1    61     5     9            1 #> 10    NA     194   8.6    69     5    10            3 #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Add column containing number of missing data values — add_n_miss","title":"Add column containing number of missing data values — add_n_miss","text":"can useful data analysis add number missing data points dataframe. add_n_miss adds column named \"n_miss\", contains number missing values row.","code":""},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add column containing number of missing data values — add_n_miss","text":"","code":"add_n_miss(data, ..., label = \"n_miss\")"},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add column containing number of missing data values — add_n_miss","text":"data dataframe ... Variable names use instead whole dataset. default looks whole dataset. Otherwise, one unquoted expressions separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. default add \"_all\" label left blank, otherwise add \"_vars\" distinguish used variables. label character default \"n_miss\".","code":""},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add column containing number of missing data values — add_n_miss","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_n_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add column containing number of missing data values — add_n_miss","text":"","code":"airquality %>% add_n_miss() #>     Ozone Solar.R Wind Temp Month Day n_miss_all #> 1      41     190  7.4   67     5   1          0 #> 2      36     118  8.0   72     5   2          0 #> 3      12     149 12.6   74     5   3          0 #> 4      18     313 11.5   62     5   4          0 #> 5      NA      NA 14.3   56     5   5          2 #> 6      28      NA 14.9   66     5   6          1 #> 7      23     299  8.6   65     5   7          0 #> 8      19      99 13.8   59     5   8          0 #> 9       8      19 20.1   61     5   9          0 #> 10     NA     194  8.6   69     5  10          1 #> 11      7      NA  6.9   74     5  11          1 #> 12     16     256  9.7   69     5  12          0 #> 13     11     290  9.2   66     5  13          0 #> 14     14     274 10.9   68     5  14          0 #> 15     18      65 13.2   58     5  15          0 #> 16     14     334 11.5   64     5  16          0 #> 17     34     307 12.0   66     5  17          0 #> 18      6      78 18.4   57     5  18          0 #> 19     30     322 11.5   68     5  19          0 #> 20     11      44  9.7   62     5  20          0 #> 21      1       8  9.7   59     5  21          0 #> 22     11     320 16.6   73     5  22          0 #> 23      4      25  9.7   61     5  23          0 #> 24     32      92 12.0   61     5  24          0 #> 25     NA      66 16.6   57     5  25          1 #> 26     NA     266 14.9   58     5  26          1 #> 27     NA      NA  8.0   57     5  27          2 #> 28     23      13 12.0   67     5  28          0 #> 29     45     252 14.9   81     5  29          0 #> 30    115     223  5.7   79     5  30          0 #> 31     37     279  7.4   76     5  31          0 #> 32     NA     286  8.6   78     6   1          1 #> 33     NA     287  9.7   74     6   2          1 #> 34     NA     242 16.1   67     6   3          1 #> 35     NA     186  9.2   84     6   4          1 #> 36     NA     220  8.6   85     6   5          1 #> 37     NA     264 14.3   79     6   6          1 #> 38     29     127  9.7   82     6   7          0 #> 39     NA     273  6.9   87     6   8          1 #> 40     71     291 13.8   90     6   9          0 #> 41     39     323 11.5   87     6  10          0 #> 42     NA     259 10.9   93     6  11          1 #> 43     NA     250  9.2   92     6  12          1 #> 44     23     148  8.0   82     6  13          0 #> 45     NA     332 13.8   80     6  14          1 #> 46     NA     322 11.5   79     6  15          1 #> 47     21     191 14.9   77     6  16          0 #> 48     37     284 20.7   72     6  17          0 #> 49     20      37  9.2   65     6  18          0 #> 50     12     120 11.5   73     6  19          0 #> 51     13     137 10.3   76     6  20          0 #> 52     NA     150  6.3   77     6  21          1 #> 53     NA      59  1.7   76     6  22          1 #> 54     NA      91  4.6   76     6  23          1 #> 55     NA     250  6.3   76     6  24          1 #> 56     NA     135  8.0   75     6  25          1 #> 57     NA     127  8.0   78     6  26          1 #> 58     NA      47 10.3   73     6  27          1 #> 59     NA      98 11.5   80     6  28          1 #> 60     NA      31 14.9   77     6  29          1 #> 61     NA     138  8.0   83     6  30          1 #> 62    135     269  4.1   84     7   1          0 #> 63     49     248  9.2   85     7   2          0 #> 64     32     236  9.2   81     7   3          0 #> 65     NA     101 10.9   84     7   4          1 #> 66     64     175  4.6   83     7   5          0 #> 67     40     314 10.9   83     7   6          0 #> 68     77     276  5.1   88     7   7          0 #> 69     97     267  6.3   92     7   8          0 #> 70     97     272  5.7   92     7   9          0 #> 71     85     175  7.4   89     7  10          0 #> 72     NA     139  8.6   82     7  11          1 #> 73     10     264 14.3   73     7  12          0 #> 74     27     175 14.9   81     7  13          0 #> 75     NA     291 14.9   91     7  14          1 #> 76      7      48 14.3   80     7  15          0 #> 77     48     260  6.9   81     7  16          0 #> 78     35     274 10.3   82     7  17          0 #> 79     61     285  6.3   84     7  18          0 #> 80     79     187  5.1   87     7  19          0 #> 81     63     220 11.5   85     7  20          0 #> 82     16       7  6.9   74     7  21          0 #> 83     NA     258  9.7   81     7  22          1 #> 84     NA     295 11.5   82     7  23          1 #> 85     80     294  8.6   86     7  24          0 #> 86    108     223  8.0   85     7  25          0 #> 87     20      81  8.6   82     7  26          0 #> 88     52      82 12.0   86     7  27          0 #> 89     82     213  7.4   88     7  28          0 #> 90     50     275  7.4   86     7  29          0 #> 91     64     253  7.4   83     7  30          0 #> 92     59     254  9.2   81     7  31          0 #> 93     39      83  6.9   81     8   1          0 #> 94      9      24 13.8   81     8   2          0 #> 95     16      77  7.4   82     8   3          0 #> 96     78      NA  6.9   86     8   4          1 #> 97     35      NA  7.4   85     8   5          1 #> 98     66      NA  4.6   87     8   6          1 #> 99    122     255  4.0   89     8   7          0 #> 100    89     229 10.3   90     8   8          0 #> 101   110     207  8.0   90     8   9          0 #> 102    NA     222  8.6   92     8  10          1 #> 103    NA     137 11.5   86     8  11          1 #> 104    44     192 11.5   86     8  12          0 #> 105    28     273 11.5   82     8  13          0 #> 106    65     157  9.7   80     8  14          0 #> 107    NA      64 11.5   79     8  15          1 #> 108    22      71 10.3   77     8  16          0 #> 109    59      51  6.3   79     8  17          0 #> 110    23     115  7.4   76     8  18          0 #> 111    31     244 10.9   78     8  19          0 #> 112    44     190 10.3   78     8  20          0 #> 113    21     259 15.5   77     8  21          0 #> 114     9      36 14.3   72     8  22          0 #> 115    NA     255 12.6   75     8  23          1 #> 116    45     212  9.7   79     8  24          0 #> 117   168     238  3.4   81     8  25          0 #> 118    73     215  8.0   86     8  26          0 #> 119    NA     153  5.7   88     8  27          1 #> 120    76     203  9.7   97     8  28          0 #> 121   118     225  2.3   94     8  29          0 #> 122    84     237  6.3   96     8  30          0 #> 123    85     188  6.3   94     8  31          0 #> 124    96     167  6.9   91     9   1          0 #> 125    78     197  5.1   92     9   2          0 #> 126    73     183  2.8   93     9   3          0 #> 127    91     189  4.6   93     9   4          0 #> 128    47      95  7.4   87     9   5          0 #> 129    32      92 15.5   84     9   6          0 #> 130    20     252 10.9   80     9   7          0 #> 131    23     220 10.3   78     9   8          0 #> 132    21     230 10.9   75     9   9          0 #> 133    24     259  9.7   73     9  10          0 #> 134    44     236 14.9   81     9  11          0 #> 135    21     259 15.5   76     9  12          0 #> 136    28     238  6.3   77     9  13          0 #> 137     9      24 10.9   71     9  14          0 #> 138    13     112 11.5   71     9  15          0 #> 139    46     237  6.9   78     9  16          0 #> 140    18     224 13.8   67     9  17          0 #> 141    13      27 10.3   76     9  18          0 #> 142    24     238 10.3   68     9  19          0 #> 143    16     201  8.0   82     9  20          0 #> 144    13     238 12.6   64     9  21          0 #> 145    23      14  9.2   71     9  22          0 #> 146    36     139 10.3   81     9  23          0 #> 147     7      49 10.3   69     9  24          0 #> 148    14      20 16.6   63     9  25          0 #> 149    30     193  6.9   70     9  26          0 #> 150    NA     145 13.2   77     9  27          1 #> 151    14     191 14.3   75     9  28          0 #> 152    18     131  8.0   76     9  29          0 #> 153    20     223 11.5   68     9  30          0 airquality %>% add_n_miss(Ozone, Solar.R) #>     Ozone Solar.R Wind Temp Month Day n_miss_vars #> 1      41     190  7.4   67     5   1           0 #> 2      36     118  8.0   72     5   2           0 #> 3      12     149 12.6   74     5   3           0 #> 4      18     313 11.5   62     5   4           0 #> 5      NA      NA 14.3   56     5   5           2 #> 6      28      NA 14.9   66     5   6           1 #> 7      23     299  8.6   65     5   7           0 #> 8      19      99 13.8   59     5   8           0 #> 9       8      19 20.1   61     5   9           0 #> 10     NA     194  8.6   69     5  10           1 #> 11      7      NA  6.9   74     5  11           1 #> 12     16     256  9.7   69     5  12           0 #> 13     11     290  9.2   66     5  13           0 #> 14     14     274 10.9   68     5  14           0 #> 15     18      65 13.2   58     5  15           0 #> 16     14     334 11.5   64     5  16           0 #> 17     34     307 12.0   66     5  17           0 #> 18      6      78 18.4   57     5  18           0 #> 19     30     322 11.5   68     5  19           0 #> 20     11      44  9.7   62     5  20           0 #> 21      1       8  9.7   59     5  21           0 #> 22     11     320 16.6   73     5  22           0 #> 23      4      25  9.7   61     5  23           0 #> 24     32      92 12.0   61     5  24           0 #> 25     NA      66 16.6   57     5  25           1 #> 26     NA     266 14.9   58     5  26           1 #> 27     NA      NA  8.0   57     5  27           2 #> 28     23      13 12.0   67     5  28           0 #> 29     45     252 14.9   81     5  29           0 #> 30    115     223  5.7   79     5  30           0 #> 31     37     279  7.4   76     5  31           0 #> 32     NA     286  8.6   78     6   1           1 #> 33     NA     287  9.7   74     6   2           1 #> 34     NA     242 16.1   67     6   3           1 #> 35     NA     186  9.2   84     6   4           1 #> 36     NA     220  8.6   85     6   5           1 #> 37     NA     264 14.3   79     6   6           1 #> 38     29     127  9.7   82     6   7           0 #> 39     NA     273  6.9   87     6   8           1 #> 40     71     291 13.8   90     6   9           0 #> 41     39     323 11.5   87     6  10           0 #> 42     NA     259 10.9   93     6  11           1 #> 43     NA     250  9.2   92     6  12           1 #> 44     23     148  8.0   82     6  13           0 #> 45     NA     332 13.8   80     6  14           1 #> 46     NA     322 11.5   79     6  15           1 #> 47     21     191 14.9   77     6  16           0 #> 48     37     284 20.7   72     6  17           0 #> 49     20      37  9.2   65     6  18           0 #> 50     12     120 11.5   73     6  19           0 #> 51     13     137 10.3   76     6  20           0 #> 52     NA     150  6.3   77     6  21           1 #> 53     NA      59  1.7   76     6  22           1 #> 54     NA      91  4.6   76     6  23           1 #> 55     NA     250  6.3   76     6  24           1 #> 56     NA     135  8.0   75     6  25           1 #> 57     NA     127  8.0   78     6  26           1 #> 58     NA      47 10.3   73     6  27           1 #> 59     NA      98 11.5   80     6  28           1 #> 60     NA      31 14.9   77     6  29           1 #> 61     NA     138  8.0   83     6  30           1 #> 62    135     269  4.1   84     7   1           0 #> 63     49     248  9.2   85     7   2           0 #> 64     32     236  9.2   81     7   3           0 #> 65     NA     101 10.9   84     7   4           1 #> 66     64     175  4.6   83     7   5           0 #> 67     40     314 10.9   83     7   6           0 #> 68     77     276  5.1   88     7   7           0 #> 69     97     267  6.3   92     7   8           0 #> 70     97     272  5.7   92     7   9           0 #> 71     85     175  7.4   89     7  10           0 #> 72     NA     139  8.6   82     7  11           1 #> 73     10     264 14.3   73     7  12           0 #> 74     27     175 14.9   81     7  13           0 #> 75     NA     291 14.9   91     7  14           1 #> 76      7      48 14.3   80     7  15           0 #> 77     48     260  6.9   81     7  16           0 #> 78     35     274 10.3   82     7  17           0 #> 79     61     285  6.3   84     7  18           0 #> 80     79     187  5.1   87     7  19           0 #> 81     63     220 11.5   85     7  20           0 #> 82     16       7  6.9   74     7  21           0 #> 83     NA     258  9.7   81     7  22           1 #> 84     NA     295 11.5   82     7  23           1 #> 85     80     294  8.6   86     7  24           0 #> 86    108     223  8.0   85     7  25           0 #> 87     20      81  8.6   82     7  26           0 #> 88     52      82 12.0   86     7  27           0 #> 89     82     213  7.4   88     7  28           0 #> 90     50     275  7.4   86     7  29           0 #> 91     64     253  7.4   83     7  30           0 #> 92     59     254  9.2   81     7  31           0 #> 93     39      83  6.9   81     8   1           0 #> 94      9      24 13.8   81     8   2           0 #> 95     16      77  7.4   82     8   3           0 #> 96     78      NA  6.9   86     8   4           1 #> 97     35      NA  7.4   85     8   5           1 #> 98     66      NA  4.6   87     8   6           1 #> 99    122     255  4.0   89     8   7           0 #> 100    89     229 10.3   90     8   8           0 #> 101   110     207  8.0   90     8   9           0 #> 102    NA     222  8.6   92     8  10           1 #> 103    NA     137 11.5   86     8  11           1 #> 104    44     192 11.5   86     8  12           0 #> 105    28     273 11.5   82     8  13           0 #> 106    65     157  9.7   80     8  14           0 #> 107    NA      64 11.5   79     8  15           1 #> 108    22      71 10.3   77     8  16           0 #> 109    59      51  6.3   79     8  17           0 #> 110    23     115  7.4   76     8  18           0 #> 111    31     244 10.9   78     8  19           0 #> 112    44     190 10.3   78     8  20           0 #> 113    21     259 15.5   77     8  21           0 #> 114     9      36 14.3   72     8  22           0 #> 115    NA     255 12.6   75     8  23           1 #> 116    45     212  9.7   79     8  24           0 #> 117   168     238  3.4   81     8  25           0 #> 118    73     215  8.0   86     8  26           0 #> 119    NA     153  5.7   88     8  27           1 #> 120    76     203  9.7   97     8  28           0 #> 121   118     225  2.3   94     8  29           0 #> 122    84     237  6.3   96     8  30           0 #> 123    85     188  6.3   94     8  31           0 #> 124    96     167  6.9   91     9   1           0 #> 125    78     197  5.1   92     9   2           0 #> 126    73     183  2.8   93     9   3           0 #> 127    91     189  4.6   93     9   4           0 #> 128    47      95  7.4   87     9   5           0 #> 129    32      92 15.5   84     9   6           0 #> 130    20     252 10.9   80     9   7           0 #> 131    23     220 10.3   78     9   8           0 #> 132    21     230 10.9   75     9   9           0 #> 133    24     259  9.7   73     9  10           0 #> 134    44     236 14.9   81     9  11           0 #> 135    21     259 15.5   76     9  12           0 #> 136    28     238  6.3   77     9  13           0 #> 137     9      24 10.9   71     9  14           0 #> 138    13     112 11.5   71     9  15           0 #> 139    46     237  6.9   78     9  16           0 #> 140    18     224 13.8   67     9  17           0 #> 141    13      27 10.3   76     9  18           0 #> 142    24     238 10.3   68     9  19           0 #> 143    16     201  8.0   82     9  20           0 #> 144    13     238 12.6   64     9  21           0 #> 145    23      14  9.2   71     9  22           0 #> 146    36     139 10.3   81     9  23           0 #> 147     7      49 10.3   69     9  24           0 #> 148    14      20 16.6   63     9  25           0 #> 149    30     193  6.9   70     9  26           0 #> 150    NA     145 13.2   77     9  27           1 #> 151    14     191 14.3   75     9  28           0 #> 152    18     131  8.0   76     9  29           0 #> 153    20     223 11.5   68     9  30           0 airquality %>% add_n_miss(dplyr::contains(\"o\")) #>     Ozone Solar.R Wind Temp Month Day n_miss_vars #> 1      41     190  7.4   67     5   1           0 #> 2      36     118  8.0   72     5   2           0 #> 3      12     149 12.6   74     5   3           0 #> 4      18     313 11.5   62     5   4           0 #> 5      NA      NA 14.3   56     5   5           2 #> 6      28      NA 14.9   66     5   6           1 #> 7      23     299  8.6   65     5   7           0 #> 8      19      99 13.8   59     5   8           0 #> 9       8      19 20.1   61     5   9           0 #> 10     NA     194  8.6   69     5  10           1 #> 11      7      NA  6.9   74     5  11           1 #> 12     16     256  9.7   69     5  12           0 #> 13     11     290  9.2   66     5  13           0 #> 14     14     274 10.9   68     5  14           0 #> 15     18      65 13.2   58     5  15           0 #> 16     14     334 11.5   64     5  16           0 #> 17     34     307 12.0   66     5  17           0 #> 18      6      78 18.4   57     5  18           0 #> 19     30     322 11.5   68     5  19           0 #> 20     11      44  9.7   62     5  20           0 #> 21      1       8  9.7   59     5  21           0 #> 22     11     320 16.6   73     5  22           0 #> 23      4      25  9.7   61     5  23           0 #> 24     32      92 12.0   61     5  24           0 #> 25     NA      66 16.6   57     5  25           1 #> 26     NA     266 14.9   58     5  26           1 #> 27     NA      NA  8.0   57     5  27           2 #> 28     23      13 12.0   67     5  28           0 #> 29     45     252 14.9   81     5  29           0 #> 30    115     223  5.7   79     5  30           0 #> 31     37     279  7.4   76     5  31           0 #> 32     NA     286  8.6   78     6   1           1 #> 33     NA     287  9.7   74     6   2           1 #> 34     NA     242 16.1   67     6   3           1 #> 35     NA     186  9.2   84     6   4           1 #> 36     NA     220  8.6   85     6   5           1 #> 37     NA     264 14.3   79     6   6           1 #> 38     29     127  9.7   82     6   7           0 #> 39     NA     273  6.9   87     6   8           1 #> 40     71     291 13.8   90     6   9           0 #> 41     39     323 11.5   87     6  10           0 #> 42     NA     259 10.9   93     6  11           1 #> 43     NA     250  9.2   92     6  12           1 #> 44     23     148  8.0   82     6  13           0 #> 45     NA     332 13.8   80     6  14           1 #> 46     NA     322 11.5   79     6  15           1 #> 47     21     191 14.9   77     6  16           0 #> 48     37     284 20.7   72     6  17           0 #> 49     20      37  9.2   65     6  18           0 #> 50     12     120 11.5   73     6  19           0 #> 51     13     137 10.3   76     6  20           0 #> 52     NA     150  6.3   77     6  21           1 #> 53     NA      59  1.7   76     6  22           1 #> 54     NA      91  4.6   76     6  23           1 #> 55     NA     250  6.3   76     6  24           1 #> 56     NA     135  8.0   75     6  25           1 #> 57     NA     127  8.0   78     6  26           1 #> 58     NA      47 10.3   73     6  27           1 #> 59     NA      98 11.5   80     6  28           1 #> 60     NA      31 14.9   77     6  29           1 #> 61     NA     138  8.0   83     6  30           1 #> 62    135     269  4.1   84     7   1           0 #> 63     49     248  9.2   85     7   2           0 #> 64     32     236  9.2   81     7   3           0 #> 65     NA     101 10.9   84     7   4           1 #> 66     64     175  4.6   83     7   5           0 #> 67     40     314 10.9   83     7   6           0 #> 68     77     276  5.1   88     7   7           0 #> 69     97     267  6.3   92     7   8           0 #> 70     97     272  5.7   92     7   9           0 #> 71     85     175  7.4   89     7  10           0 #> 72     NA     139  8.6   82     7  11           1 #> 73     10     264 14.3   73     7  12           0 #> 74     27     175 14.9   81     7  13           0 #> 75     NA     291 14.9   91     7  14           1 #> 76      7      48 14.3   80     7  15           0 #> 77     48     260  6.9   81     7  16           0 #> 78     35     274 10.3   82     7  17           0 #> 79     61     285  6.3   84     7  18           0 #> 80     79     187  5.1   87     7  19           0 #> 81     63     220 11.5   85     7  20           0 #> 82     16       7  6.9   74     7  21           0 #> 83     NA     258  9.7   81     7  22           1 #> 84     NA     295 11.5   82     7  23           1 #> 85     80     294  8.6   86     7  24           0 #> 86    108     223  8.0   85     7  25           0 #> 87     20      81  8.6   82     7  26           0 #> 88     52      82 12.0   86     7  27           0 #> 89     82     213  7.4   88     7  28           0 #> 90     50     275  7.4   86     7  29           0 #> 91     64     253  7.4   83     7  30           0 #> 92     59     254  9.2   81     7  31           0 #> 93     39      83  6.9   81     8   1           0 #> 94      9      24 13.8   81     8   2           0 #> 95     16      77  7.4   82     8   3           0 #> 96     78      NA  6.9   86     8   4           1 #> 97     35      NA  7.4   85     8   5           1 #> 98     66      NA  4.6   87     8   6           1 #> 99    122     255  4.0   89     8   7           0 #> 100    89     229 10.3   90     8   8           0 #> 101   110     207  8.0   90     8   9           0 #> 102    NA     222  8.6   92     8  10           1 #> 103    NA     137 11.5   86     8  11           1 #> 104    44     192 11.5   86     8  12           0 #> 105    28     273 11.5   82     8  13           0 #> 106    65     157  9.7   80     8  14           0 #> 107    NA      64 11.5   79     8  15           1 #> 108    22      71 10.3   77     8  16           0 #> 109    59      51  6.3   79     8  17           0 #> 110    23     115  7.4   76     8  18           0 #> 111    31     244 10.9   78     8  19           0 #> 112    44     190 10.3   78     8  20           0 #> 113    21     259 15.5   77     8  21           0 #> 114     9      36 14.3   72     8  22           0 #> 115    NA     255 12.6   75     8  23           1 #> 116    45     212  9.7   79     8  24           0 #> 117   168     238  3.4   81     8  25           0 #> 118    73     215  8.0   86     8  26           0 #> 119    NA     153  5.7   88     8  27           1 #> 120    76     203  9.7   97     8  28           0 #> 121   118     225  2.3   94     8  29           0 #> 122    84     237  6.3   96     8  30           0 #> 123    85     188  6.3   94     8  31           0 #> 124    96     167  6.9   91     9   1           0 #> 125    78     197  5.1   92     9   2           0 #> 126    73     183  2.8   93     9   3           0 #> 127    91     189  4.6   93     9   4           0 #> 128    47      95  7.4   87     9   5           0 #> 129    32      92 15.5   84     9   6           0 #> 130    20     252 10.9   80     9   7           0 #> 131    23     220 10.3   78     9   8           0 #> 132    21     230 10.9   75     9   9           0 #> 133    24     259  9.7   73     9  10           0 #> 134    44     236 14.9   81     9  11           0 #> 135    21     259 15.5   76     9  12           0 #> 136    28     238  6.3   77     9  13           0 #> 137     9      24 10.9   71     9  14           0 #> 138    13     112 11.5   71     9  15           0 #> 139    46     237  6.9   78     9  16           0 #> 140    18     224 13.8   67     9  17           0 #> 141    13      27 10.3   76     9  18           0 #> 142    24     238 10.3   68     9  19           0 #> 143    16     201  8.0   82     9  20           0 #> 144    13     238 12.6   64     9  21           0 #> 145    23      14  9.2   71     9  22           0 #> 146    36     139 10.3   81     9  23           0 #> 147     7      49 10.3   69     9  24           0 #> 148    14      20 16.6   63     9  25           0 #> 149    30     193  6.9   70     9  26           0 #> 150    NA     145 13.2   77     9  27           1 #> 151    14     191 14.3   75     9  28           0 #> 152    18     131  8.0   76     9  29           0 #> 153    20     223 11.5   68     9  30           0"},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Add column containing proportion of missing data values — add_prop_miss","title":"Add column containing proportion of missing data values — add_prop_miss","text":"can useful data analysis add proportion missing data values dataframe. add_prop_miss adds column named \"prop_miss\", contains proportion missing values row. can specify variables like show missingness .","code":""},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add column containing proportion of missing data values — add_prop_miss","text":"","code":"add_prop_miss(data, ..., label = \"prop_miss\")"},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add column containing proportion of missing data values — add_prop_miss","text":"data dataframe ... Variable names use instead whole dataset. default looks whole dataset. Otherwise, one unquoted expressions separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. default add \"_all\" label left blank, otherwise add \"_vars\" distinguish used variables. label character string need name variable","code":""},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add column containing proportion of missing data values — add_prop_miss","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_prop_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add column containing proportion of missing data values — add_prop_miss","text":"","code":"airquality %>% add_prop_miss() #>     Ozone Solar.R Wind Temp Month Day prop_miss_all #> 1      41     190  7.4   67     5   1     0.0000000 #> 2      36     118  8.0   72     5   2     0.0000000 #> 3      12     149 12.6   74     5   3     0.0000000 #> 4      18     313 11.5   62     5   4     0.0000000 #> 5      NA      NA 14.3   56     5   5     0.3333333 #> 6      28      NA 14.9   66     5   6     0.1666667 #> 7      23     299  8.6   65     5   7     0.0000000 #> 8      19      99 13.8   59     5   8     0.0000000 #> 9       8      19 20.1   61     5   9     0.0000000 #> 10     NA     194  8.6   69     5  10     0.1666667 #> 11      7      NA  6.9   74     5  11     0.1666667 #> 12     16     256  9.7   69     5  12     0.0000000 #> 13     11     290  9.2   66     5  13     0.0000000 #> 14     14     274 10.9   68     5  14     0.0000000 #> 15     18      65 13.2   58     5  15     0.0000000 #> 16     14     334 11.5   64     5  16     0.0000000 #> 17     34     307 12.0   66     5  17     0.0000000 #> 18      6      78 18.4   57     5  18     0.0000000 #> 19     30     322 11.5   68     5  19     0.0000000 #> 20     11      44  9.7   62     5  20     0.0000000 #> 21      1       8  9.7   59     5  21     0.0000000 #> 22     11     320 16.6   73     5  22     0.0000000 #> 23      4      25  9.7   61     5  23     0.0000000 #> 24     32      92 12.0   61     5  24     0.0000000 #> 25     NA      66 16.6   57     5  25     0.1666667 #> 26     NA     266 14.9   58     5  26     0.1666667 #> 27     NA      NA  8.0   57     5  27     0.3333333 #> 28     23      13 12.0   67     5  28     0.0000000 #> 29     45     252 14.9   81     5  29     0.0000000 #> 30    115     223  5.7   79     5  30     0.0000000 #> 31     37     279  7.4   76     5  31     0.0000000 #> 32     NA     286  8.6   78     6   1     0.1666667 #> 33     NA     287  9.7   74     6   2     0.1666667 #> 34     NA     242 16.1   67     6   3     0.1666667 #> 35     NA     186  9.2   84     6   4     0.1666667 #> 36     NA     220  8.6   85     6   5     0.1666667 #> 37     NA     264 14.3   79     6   6     0.1666667 #> 38     29     127  9.7   82     6   7     0.0000000 #> 39     NA     273  6.9   87     6   8     0.1666667 #> 40     71     291 13.8   90     6   9     0.0000000 #> 41     39     323 11.5   87     6  10     0.0000000 #> 42     NA     259 10.9   93     6  11     0.1666667 #> 43     NA     250  9.2   92     6  12     0.1666667 #> 44     23     148  8.0   82     6  13     0.0000000 #> 45     NA     332 13.8   80     6  14     0.1666667 #> 46     NA     322 11.5   79     6  15     0.1666667 #> 47     21     191 14.9   77     6  16     0.0000000 #> 48     37     284 20.7   72     6  17     0.0000000 #> 49     20      37  9.2   65     6  18     0.0000000 #> 50     12     120 11.5   73     6  19     0.0000000 #> 51     13     137 10.3   76     6  20     0.0000000 #> 52     NA     150  6.3   77     6  21     0.1666667 #> 53     NA      59  1.7   76     6  22     0.1666667 #> 54     NA      91  4.6   76     6  23     0.1666667 #> 55     NA     250  6.3   76     6  24     0.1666667 #> 56     NA     135  8.0   75     6  25     0.1666667 #> 57     NA     127  8.0   78     6  26     0.1666667 #> 58     NA      47 10.3   73     6  27     0.1666667 #> 59     NA      98 11.5   80     6  28     0.1666667 #> 60     NA      31 14.9   77     6  29     0.1666667 #> 61     NA     138  8.0   83     6  30     0.1666667 #> 62    135     269  4.1   84     7   1     0.0000000 #> 63     49     248  9.2   85     7   2     0.0000000 #> 64     32     236  9.2   81     7   3     0.0000000 #> 65     NA     101 10.9   84     7   4     0.1666667 #> 66     64     175  4.6   83     7   5     0.0000000 #> 67     40     314 10.9   83     7   6     0.0000000 #> 68     77     276  5.1   88     7   7     0.0000000 #> 69     97     267  6.3   92     7   8     0.0000000 #> 70     97     272  5.7   92     7   9     0.0000000 #> 71     85     175  7.4   89     7  10     0.0000000 #> 72     NA     139  8.6   82     7  11     0.1666667 #> 73     10     264 14.3   73     7  12     0.0000000 #> 74     27     175 14.9   81     7  13     0.0000000 #> 75     NA     291 14.9   91     7  14     0.1666667 #> 76      7      48 14.3   80     7  15     0.0000000 #> 77     48     260  6.9   81     7  16     0.0000000 #> 78     35     274 10.3   82     7  17     0.0000000 #> 79     61     285  6.3   84     7  18     0.0000000 #> 80     79     187  5.1   87     7  19     0.0000000 #> 81     63     220 11.5   85     7  20     0.0000000 #> 82     16       7  6.9   74     7  21     0.0000000 #> 83     NA     258  9.7   81     7  22     0.1666667 #> 84     NA     295 11.5   82     7  23     0.1666667 #> 85     80     294  8.6   86     7  24     0.0000000 #> 86    108     223  8.0   85     7  25     0.0000000 #> 87     20      81  8.6   82     7  26     0.0000000 #> 88     52      82 12.0   86     7  27     0.0000000 #> 89     82     213  7.4   88     7  28     0.0000000 #> 90     50     275  7.4   86     7  29     0.0000000 #> 91     64     253  7.4   83     7  30     0.0000000 #> 92     59     254  9.2   81     7  31     0.0000000 #> 93     39      83  6.9   81     8   1     0.0000000 #> 94      9      24 13.8   81     8   2     0.0000000 #> 95     16      77  7.4   82     8   3     0.0000000 #> 96     78      NA  6.9   86     8   4     0.1666667 #> 97     35      NA  7.4   85     8   5     0.1666667 #> 98     66      NA  4.6   87     8   6     0.1666667 #> 99    122     255  4.0   89     8   7     0.0000000 #> 100    89     229 10.3   90     8   8     0.0000000 #> 101   110     207  8.0   90     8   9     0.0000000 #> 102    NA     222  8.6   92     8  10     0.1666667 #> 103    NA     137 11.5   86     8  11     0.1666667 #> 104    44     192 11.5   86     8  12     0.0000000 #> 105    28     273 11.5   82     8  13     0.0000000 #> 106    65     157  9.7   80     8  14     0.0000000 #> 107    NA      64 11.5   79     8  15     0.1666667 #> 108    22      71 10.3   77     8  16     0.0000000 #> 109    59      51  6.3   79     8  17     0.0000000 #> 110    23     115  7.4   76     8  18     0.0000000 #> 111    31     244 10.9   78     8  19     0.0000000 #> 112    44     190 10.3   78     8  20     0.0000000 #> 113    21     259 15.5   77     8  21     0.0000000 #> 114     9      36 14.3   72     8  22     0.0000000 #> 115    NA     255 12.6   75     8  23     0.1666667 #> 116    45     212  9.7   79     8  24     0.0000000 #> 117   168     238  3.4   81     8  25     0.0000000 #> 118    73     215  8.0   86     8  26     0.0000000 #> 119    NA     153  5.7   88     8  27     0.1666667 #> 120    76     203  9.7   97     8  28     0.0000000 #> 121   118     225  2.3   94     8  29     0.0000000 #> 122    84     237  6.3   96     8  30     0.0000000 #> 123    85     188  6.3   94     8  31     0.0000000 #> 124    96     167  6.9   91     9   1     0.0000000 #> 125    78     197  5.1   92     9   2     0.0000000 #> 126    73     183  2.8   93     9   3     0.0000000 #> 127    91     189  4.6   93     9   4     0.0000000 #> 128    47      95  7.4   87     9   5     0.0000000 #> 129    32      92 15.5   84     9   6     0.0000000 #> 130    20     252 10.9   80     9   7     0.0000000 #> 131    23     220 10.3   78     9   8     0.0000000 #> 132    21     230 10.9   75     9   9     0.0000000 #> 133    24     259  9.7   73     9  10     0.0000000 #> 134    44     236 14.9   81     9  11     0.0000000 #> 135    21     259 15.5   76     9  12     0.0000000 #> 136    28     238  6.3   77     9  13     0.0000000 #> 137     9      24 10.9   71     9  14     0.0000000 #> 138    13     112 11.5   71     9  15     0.0000000 #> 139    46     237  6.9   78     9  16     0.0000000 #> 140    18     224 13.8   67     9  17     0.0000000 #> 141    13      27 10.3   76     9  18     0.0000000 #> 142    24     238 10.3   68     9  19     0.0000000 #> 143    16     201  8.0   82     9  20     0.0000000 #> 144    13     238 12.6   64     9  21     0.0000000 #> 145    23      14  9.2   71     9  22     0.0000000 #> 146    36     139 10.3   81     9  23     0.0000000 #> 147     7      49 10.3   69     9  24     0.0000000 #> 148    14      20 16.6   63     9  25     0.0000000 #> 149    30     193  6.9   70     9  26     0.0000000 #> 150    NA     145 13.2   77     9  27     0.1666667 #> 151    14     191 14.3   75     9  28     0.0000000 #> 152    18     131  8.0   76     9  29     0.0000000 #> 153    20     223 11.5   68     9  30     0.0000000 airquality %>% add_prop_miss(Solar.R, Ozone) #>     Ozone Solar.R Wind Temp Month Day prop_miss_vars #> 1      41     190  7.4   67     5   1            0.0 #> 2      36     118  8.0   72     5   2            0.0 #> 3      12     149 12.6   74     5   3            0.0 #> 4      18     313 11.5   62     5   4            0.0 #> 5      NA      NA 14.3   56     5   5            1.0 #> 6      28      NA 14.9   66     5   6            0.5 #> 7      23     299  8.6   65     5   7            0.0 #> 8      19      99 13.8   59     5   8            0.0 #> 9       8      19 20.1   61     5   9            0.0 #> 10     NA     194  8.6   69     5  10            0.5 #> 11      7      NA  6.9   74     5  11            0.5 #> 12     16     256  9.7   69     5  12            0.0 #> 13     11     290  9.2   66     5  13            0.0 #> 14     14     274 10.9   68     5  14            0.0 #> 15     18      65 13.2   58     5  15            0.0 #> 16     14     334 11.5   64     5  16            0.0 #> 17     34     307 12.0   66     5  17            0.0 #> 18      6      78 18.4   57     5  18            0.0 #> 19     30     322 11.5   68     5  19            0.0 #> 20     11      44  9.7   62     5  20            0.0 #> 21      1       8  9.7   59     5  21            0.0 #> 22     11     320 16.6   73     5  22            0.0 #> 23      4      25  9.7   61     5  23            0.0 #> 24     32      92 12.0   61     5  24            0.0 #> 25     NA      66 16.6   57     5  25            0.5 #> 26     NA     266 14.9   58     5  26            0.5 #> 27     NA      NA  8.0   57     5  27            1.0 #> 28     23      13 12.0   67     5  28            0.0 #> 29     45     252 14.9   81     5  29            0.0 #> 30    115     223  5.7   79     5  30            0.0 #> 31     37     279  7.4   76     5  31            0.0 #> 32     NA     286  8.6   78     6   1            0.5 #> 33     NA     287  9.7   74     6   2            0.5 #> 34     NA     242 16.1   67     6   3            0.5 #> 35     NA     186  9.2   84     6   4            0.5 #> 36     NA     220  8.6   85     6   5            0.5 #> 37     NA     264 14.3   79     6   6            0.5 #> 38     29     127  9.7   82     6   7            0.0 #> 39     NA     273  6.9   87     6   8            0.5 #> 40     71     291 13.8   90     6   9            0.0 #> 41     39     323 11.5   87     6  10            0.0 #> 42     NA     259 10.9   93     6  11            0.5 #> 43     NA     250  9.2   92     6  12            0.5 #> 44     23     148  8.0   82     6  13            0.0 #> 45     NA     332 13.8   80     6  14            0.5 #> 46     NA     322 11.5   79     6  15            0.5 #> 47     21     191 14.9   77     6  16            0.0 #> 48     37     284 20.7   72     6  17            0.0 #> 49     20      37  9.2   65     6  18            0.0 #> 50     12     120 11.5   73     6  19            0.0 #> 51     13     137 10.3   76     6  20            0.0 #> 52     NA     150  6.3   77     6  21            0.5 #> 53     NA      59  1.7   76     6  22            0.5 #> 54     NA      91  4.6   76     6  23            0.5 #> 55     NA     250  6.3   76     6  24            0.5 #> 56     NA     135  8.0   75     6  25            0.5 #> 57     NA     127  8.0   78     6  26            0.5 #> 58     NA      47 10.3   73     6  27            0.5 #> 59     NA      98 11.5   80     6  28            0.5 #> 60     NA      31 14.9   77     6  29            0.5 #> 61     NA     138  8.0   83     6  30            0.5 #> 62    135     269  4.1   84     7   1            0.0 #> 63     49     248  9.2   85     7   2            0.0 #> 64     32     236  9.2   81     7   3            0.0 #> 65     NA     101 10.9   84     7   4            0.5 #> 66     64     175  4.6   83     7   5            0.0 #> 67     40     314 10.9   83     7   6            0.0 #> 68     77     276  5.1   88     7   7            0.0 #> 69     97     267  6.3   92     7   8            0.0 #> 70     97     272  5.7   92     7   9            0.0 #> 71     85     175  7.4   89     7  10            0.0 #> 72     NA     139  8.6   82     7  11            0.5 #> 73     10     264 14.3   73     7  12            0.0 #> 74     27     175 14.9   81     7  13            0.0 #> 75     NA     291 14.9   91     7  14            0.5 #> 76      7      48 14.3   80     7  15            0.0 #> 77     48     260  6.9   81     7  16            0.0 #> 78     35     274 10.3   82     7  17            0.0 #> 79     61     285  6.3   84     7  18            0.0 #> 80     79     187  5.1   87     7  19            0.0 #> 81     63     220 11.5   85     7  20            0.0 #> 82     16       7  6.9   74     7  21            0.0 #> 83     NA     258  9.7   81     7  22            0.5 #> 84     NA     295 11.5   82     7  23            0.5 #> 85     80     294  8.6   86     7  24            0.0 #> 86    108     223  8.0   85     7  25            0.0 #> 87     20      81  8.6   82     7  26            0.0 #> 88     52      82 12.0   86     7  27            0.0 #> 89     82     213  7.4   88     7  28            0.0 #> 90     50     275  7.4   86     7  29            0.0 #> 91     64     253  7.4   83     7  30            0.0 #> 92     59     254  9.2   81     7  31            0.0 #> 93     39      83  6.9   81     8   1            0.0 #> 94      9      24 13.8   81     8   2            0.0 #> 95     16      77  7.4   82     8   3            0.0 #> 96     78      NA  6.9   86     8   4            0.5 #> 97     35      NA  7.4   85     8   5            0.5 #> 98     66      NA  4.6   87     8   6            0.5 #> 99    122     255  4.0   89     8   7            0.0 #> 100    89     229 10.3   90     8   8            0.0 #> 101   110     207  8.0   90     8   9            0.0 #> 102    NA     222  8.6   92     8  10            0.5 #> 103    NA     137 11.5   86     8  11            0.5 #> 104    44     192 11.5   86     8  12            0.0 #> 105    28     273 11.5   82     8  13            0.0 #> 106    65     157  9.7   80     8  14            0.0 #> 107    NA      64 11.5   79     8  15            0.5 #> 108    22      71 10.3   77     8  16            0.0 #> 109    59      51  6.3   79     8  17            0.0 #> 110    23     115  7.4   76     8  18            0.0 #> 111    31     244 10.9   78     8  19            0.0 #> 112    44     190 10.3   78     8  20            0.0 #> 113    21     259 15.5   77     8  21            0.0 #> 114     9      36 14.3   72     8  22            0.0 #> 115    NA     255 12.6   75     8  23            0.5 #> 116    45     212  9.7   79     8  24            0.0 #> 117   168     238  3.4   81     8  25            0.0 #> 118    73     215  8.0   86     8  26            0.0 #> 119    NA     153  5.7   88     8  27            0.5 #> 120    76     203  9.7   97     8  28            0.0 #> 121   118     225  2.3   94     8  29            0.0 #> 122    84     237  6.3   96     8  30            0.0 #> 123    85     188  6.3   94     8  31            0.0 #> 124    96     167  6.9   91     9   1            0.0 #> 125    78     197  5.1   92     9   2            0.0 #> 126    73     183  2.8   93     9   3            0.0 #> 127    91     189  4.6   93     9   4            0.0 #> 128    47      95  7.4   87     9   5            0.0 #> 129    32      92 15.5   84     9   6            0.0 #> 130    20     252 10.9   80     9   7            0.0 #> 131    23     220 10.3   78     9   8            0.0 #> 132    21     230 10.9   75     9   9            0.0 #> 133    24     259  9.7   73     9  10            0.0 #> 134    44     236 14.9   81     9  11            0.0 #> 135    21     259 15.5   76     9  12            0.0 #> 136    28     238  6.3   77     9  13            0.0 #> 137     9      24 10.9   71     9  14            0.0 #> 138    13     112 11.5   71     9  15            0.0 #> 139    46     237  6.9   78     9  16            0.0 #> 140    18     224 13.8   67     9  17            0.0 #> 141    13      27 10.3   76     9  18            0.0 #> 142    24     238 10.3   68     9  19            0.0 #> 143    16     201  8.0   82     9  20            0.0 #> 144    13     238 12.6   64     9  21            0.0 #> 145    23      14  9.2   71     9  22            0.0 #> 146    36     139 10.3   81     9  23            0.0 #> 147     7      49 10.3   69     9  24            0.0 #> 148    14      20 16.6   63     9  25            0.0 #> 149    30     193  6.9   70     9  26            0.0 #> 150    NA     145 13.2   77     9  27            0.5 #> 151    14     191 14.3   75     9  28            0.0 #> 152    18     131  8.0   76     9  29            0.0 #> 153    20     223 11.5   68     9  30            0.0 airquality %>% add_prop_miss(Solar.R, Ozone, label = \"testing\") #>     Ozone Solar.R Wind Temp Month Day testing_vars #> 1      41     190  7.4   67     5   1          0.0 #> 2      36     118  8.0   72     5   2          0.0 #> 3      12     149 12.6   74     5   3          0.0 #> 4      18     313 11.5   62     5   4          0.0 #> 5      NA      NA 14.3   56     5   5          1.0 #> 6      28      NA 14.9   66     5   6          0.5 #> 7      23     299  8.6   65     5   7          0.0 #> 8      19      99 13.8   59     5   8          0.0 #> 9       8      19 20.1   61     5   9          0.0 #> 10     NA     194  8.6   69     5  10          0.5 #> 11      7      NA  6.9   74     5  11          0.5 #> 12     16     256  9.7   69     5  12          0.0 #> 13     11     290  9.2   66     5  13          0.0 #> 14     14     274 10.9   68     5  14          0.0 #> 15     18      65 13.2   58     5  15          0.0 #> 16     14     334 11.5   64     5  16          0.0 #> 17     34     307 12.0   66     5  17          0.0 #> 18      6      78 18.4   57     5  18          0.0 #> 19     30     322 11.5   68     5  19          0.0 #> 20     11      44  9.7   62     5  20          0.0 #> 21      1       8  9.7   59     5  21          0.0 #> 22     11     320 16.6   73     5  22          0.0 #> 23      4      25  9.7   61     5  23          0.0 #> 24     32      92 12.0   61     5  24          0.0 #> 25     NA      66 16.6   57     5  25          0.5 #> 26     NA     266 14.9   58     5  26          0.5 #> 27     NA      NA  8.0   57     5  27          1.0 #> 28     23      13 12.0   67     5  28          0.0 #> 29     45     252 14.9   81     5  29          0.0 #> 30    115     223  5.7   79     5  30          0.0 #> 31     37     279  7.4   76     5  31          0.0 #> 32     NA     286  8.6   78     6   1          0.5 #> 33     NA     287  9.7   74     6   2          0.5 #> 34     NA     242 16.1   67     6   3          0.5 #> 35     NA     186  9.2   84     6   4          0.5 #> 36     NA     220  8.6   85     6   5          0.5 #> 37     NA     264 14.3   79     6   6          0.5 #> 38     29     127  9.7   82     6   7          0.0 #> 39     NA     273  6.9   87     6   8          0.5 #> 40     71     291 13.8   90     6   9          0.0 #> 41     39     323 11.5   87     6  10          0.0 #> 42     NA     259 10.9   93     6  11          0.5 #> 43     NA     250  9.2   92     6  12          0.5 #> 44     23     148  8.0   82     6  13          0.0 #> 45     NA     332 13.8   80     6  14          0.5 #> 46     NA     322 11.5   79     6  15          0.5 #> 47     21     191 14.9   77     6  16          0.0 #> 48     37     284 20.7   72     6  17          0.0 #> 49     20      37  9.2   65     6  18          0.0 #> 50     12     120 11.5   73     6  19          0.0 #> 51     13     137 10.3   76     6  20          0.0 #> 52     NA     150  6.3   77     6  21          0.5 #> 53     NA      59  1.7   76     6  22          0.5 #> 54     NA      91  4.6   76     6  23          0.5 #> 55     NA     250  6.3   76     6  24          0.5 #> 56     NA     135  8.0   75     6  25          0.5 #> 57     NA     127  8.0   78     6  26          0.5 #> 58     NA      47 10.3   73     6  27          0.5 #> 59     NA      98 11.5   80     6  28          0.5 #> 60     NA      31 14.9   77     6  29          0.5 #> 61     NA     138  8.0   83     6  30          0.5 #> 62    135     269  4.1   84     7   1          0.0 #> 63     49     248  9.2   85     7   2          0.0 #> 64     32     236  9.2   81     7   3          0.0 #> 65     NA     101 10.9   84     7   4          0.5 #> 66     64     175  4.6   83     7   5          0.0 #> 67     40     314 10.9   83     7   6          0.0 #> 68     77     276  5.1   88     7   7          0.0 #> 69     97     267  6.3   92     7   8          0.0 #> 70     97     272  5.7   92     7   9          0.0 #> 71     85     175  7.4   89     7  10          0.0 #> 72     NA     139  8.6   82     7  11          0.5 #> 73     10     264 14.3   73     7  12          0.0 #> 74     27     175 14.9   81     7  13          0.0 #> 75     NA     291 14.9   91     7  14          0.5 #> 76      7      48 14.3   80     7  15          0.0 #> 77     48     260  6.9   81     7  16          0.0 #> 78     35     274 10.3   82     7  17          0.0 #> 79     61     285  6.3   84     7  18          0.0 #> 80     79     187  5.1   87     7  19          0.0 #> 81     63     220 11.5   85     7  20          0.0 #> 82     16       7  6.9   74     7  21          0.0 #> 83     NA     258  9.7   81     7  22          0.5 #> 84     NA     295 11.5   82     7  23          0.5 #> 85     80     294  8.6   86     7  24          0.0 #> 86    108     223  8.0   85     7  25          0.0 #> 87     20      81  8.6   82     7  26          0.0 #> 88     52      82 12.0   86     7  27          0.0 #> 89     82     213  7.4   88     7  28          0.0 #> 90     50     275  7.4   86     7  29          0.0 #> 91     64     253  7.4   83     7  30          0.0 #> 92     59     254  9.2   81     7  31          0.0 #> 93     39      83  6.9   81     8   1          0.0 #> 94      9      24 13.8   81     8   2          0.0 #> 95     16      77  7.4   82     8   3          0.0 #> 96     78      NA  6.9   86     8   4          0.5 #> 97     35      NA  7.4   85     8   5          0.5 #> 98     66      NA  4.6   87     8   6          0.5 #> 99    122     255  4.0   89     8   7          0.0 #> 100    89     229 10.3   90     8   8          0.0 #> 101   110     207  8.0   90     8   9          0.0 #> 102    NA     222  8.6   92     8  10          0.5 #> 103    NA     137 11.5   86     8  11          0.5 #> 104    44     192 11.5   86     8  12          0.0 #> 105    28     273 11.5   82     8  13          0.0 #> 106    65     157  9.7   80     8  14          0.0 #> 107    NA      64 11.5   79     8  15          0.5 #> 108    22      71 10.3   77     8  16          0.0 #> 109    59      51  6.3   79     8  17          0.0 #> 110    23     115  7.4   76     8  18          0.0 #> 111    31     244 10.9   78     8  19          0.0 #> 112    44     190 10.3   78     8  20          0.0 #> 113    21     259 15.5   77     8  21          0.0 #> 114     9      36 14.3   72     8  22          0.0 #> 115    NA     255 12.6   75     8  23          0.5 #> 116    45     212  9.7   79     8  24          0.0 #> 117   168     238  3.4   81     8  25          0.0 #> 118    73     215  8.0   86     8  26          0.0 #> 119    NA     153  5.7   88     8  27          0.5 #> 120    76     203  9.7   97     8  28          0.0 #> 121   118     225  2.3   94     8  29          0.0 #> 122    84     237  6.3   96     8  30          0.0 #> 123    85     188  6.3   94     8  31          0.0 #> 124    96     167  6.9   91     9   1          0.0 #> 125    78     197  5.1   92     9   2          0.0 #> 126    73     183  2.8   93     9   3          0.0 #> 127    91     189  4.6   93     9   4          0.0 #> 128    47      95  7.4   87     9   5          0.0 #> 129    32      92 15.5   84     9   6          0.0 #> 130    20     252 10.9   80     9   7          0.0 #> 131    23     220 10.3   78     9   8          0.0 #> 132    21     230 10.9   75     9   9          0.0 #> 133    24     259  9.7   73     9  10          0.0 #> 134    44     236 14.9   81     9  11          0.0 #> 135    21     259 15.5   76     9  12          0.0 #> 136    28     238  6.3   77     9  13          0.0 #> 137     9      24 10.9   71     9  14          0.0 #> 138    13     112 11.5   71     9  15          0.0 #> 139    46     237  6.9   78     9  16          0.0 #> 140    18     224 13.8   67     9  17          0.0 #> 141    13      27 10.3   76     9  18          0.0 #> 142    24     238 10.3   68     9  19          0.0 #> 143    16     201  8.0   82     9  20          0.0 #> 144    13     238 12.6   64     9  21          0.0 #> 145    23      14  9.2   71     9  22          0.0 #> 146    36     139 10.3   81     9  23          0.0 #> 147     7      49 10.3   69     9  24          0.0 #> 148    14      20 16.6   63     9  25          0.0 #> 149    30     193  6.9   70     9  26          0.0 #> 150    NA     145 13.2   77     9  27          0.5 #> 151    14     191 14.3   75     9  28          0.0 #> 152    18     131  8.0   76     9  29          0.0 #> 153    20     223 11.5   68     9  30          0.0  # this can be applied to model the proportion of missing data # as in Tierney et al \\doi{10.1136/bmjopen-2014-007450} # see \"Modelling missingness\" in vignette \"Getting Started with naniar\" # for details"},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow column to dataframe — add_shadow","title":"Add a shadow column to dataframe — add_shadow","text":"alternative bind_shadow(), can add specific individual shadow columns dataset. also respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow column to dataframe — add_shadow","text":"","code":"add_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow column to dataframe — add_shadow","text":"data data.frame ... One unquoted variable names, separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow column to dataframe — add_shadow","text":"data.frame","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow column to dataframe — add_shadow","text":"","code":"airquality %>% add_shadow(Ozone) #> # A tibble: 153 × 7 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA #>                #>  1    41     190   7.4    67     5     1 !NA      #>  2    36     118   8      72     5     2 !NA      #>  3    12     149  12.6    74     5     3 !NA      #>  4    18     313  11.5    62     5     4 !NA      #>  5    NA      NA  14.3    56     5     5 NA       #>  6    28      NA  14.9    66     5     6 !NA      #>  7    23     299   8.6    65     5     7 !NA      #>  8    19      99  13.8    59     5     8 !NA      #>  9     8      19  20.1    61     5     9 !NA      #> 10    NA     194   8.6    69     5    10 NA       #> # ℹ 143 more rows airquality %>% add_shadow(Ozone, Solar.R) #> # A tibble: 153 × 8 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA #>                      #>  1    41     190   7.4    67     5     1 !NA      !NA        #>  2    36     118   8      72     5     2 !NA      !NA        #>  3    12     149  12.6    74     5     3 !NA      !NA        #>  4    18     313  11.5    62     5     4 !NA      !NA        #>  5    NA      NA  14.3    56     5     5 NA       NA         #>  6    28      NA  14.9    66     5     6 !NA      NA         #>  7    23     299   8.6    65     5     7 !NA      !NA        #>  8    19      99  13.8    59     5     8 !NA      !NA        #>  9     8      19  20.1    61     5     9 !NA      !NA        #> 10    NA     194   8.6    69     5    10 NA       !NA        #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow shifted column to a dataset — add_shadow_shift","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"Shadow shift missing values using selected variables dataset, specifying variable names use dplyr vars dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"","code":"add_shadow_shift(data, ..., suffix = \"shift\")"},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"data data.frame ... One unquoted variable names separated commas. also respect dplyr verbs starts_with, contains, ends_with, etc. suffix suffix add variable, defaults \"shift\"","code":""},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"data added variable shifted named var_suffix","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/add_shadow_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow shifted column to a dataset — add_shadow_shift","text":"","code":"airquality %>% add_shadow_shift(Ozone, Solar.R) #> # A tibble: 153 × 8 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_shift Solar.R_shift #>                            #>  1    41     190   7.4    67     5     1        41           190   #>  2    36     118   8      72     5     2        36           118   #>  3    12     149  12.6    74     5     3        12           149   #>  4    18     313  11.5    62     5     4        18           313   #>  5    NA      NA  14.3    56     5     5       -19.7         -33.6 #>  6    28      NA  14.9    66     5     6        28           -33.1 #>  7    23     299   8.6    65     5     7        23           299   #>  8    19      99  13.8    59     5     8        19            99   #>  9     8      19  20.1    61     5     9         8            19   #> 10    NA     194   8.6    69     5    10       -18.5         194   #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a counter variable for a span of dataframe — add_span_counter","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"Adds variable, span_counter dataframe. Used internally facilitate counting missing values given span.","code":""},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"","code":"add_span_counter(data, span_size)"},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"data data.frame span_size integer","code":""},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"data.frame extra variable \"span_counter\".","code":""},{"path":"http://naniar.njtierney.com/reference/add_span_counter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a counter variable for a span of dataframe — add_span_counter","text":"","code":"if (FALSE) { # add_span_counter(pedestrian, span_size = 100) }"},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify if there are any or all missing or complete values — any-all-na-complete","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"useful exploring data search cases instances missing complete values. example, can help identify potentially remove keep columns data frame missing, complete. case, provide two functions: any_miss any_complete. Note any_miss alias, any_na. hood call anyNA. any_complete complement any_miss - returns TRUE complete values. Note dataframe any_complete look complete cases, complete rows, different complete variables. case, two functions: all_miss, all_complete.","code":""},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"","code":"any_na(x)  any_miss(x)  any_complete(x)  all_na(x)  all_miss(x)  all_complete(x)"},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"x object explore missings/complete values","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/any-all-na-complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify if there are any or all missing or complete values — any-all-na-complete","text":"","code":"# for vectors misses <- c(NA, NA, NA) complete <- c(1, 2, 3) mixture <- c(NA, 1, NA)  all_na(misses) #> [1] TRUE all_na(complete) #> [1] FALSE all_na(mixture) #> [1] FALSE all_complete(misses) #> [1] FALSE all_complete(complete) #> [1] TRUE all_complete(mixture) #> [1] FALSE  any_na(misses) #> [1] TRUE any_na(complete) #> [1] FALSE any_na(mixture) #> [1] TRUE  # for data frames all_na(airquality) #> [1] FALSE # an alias of all_na all_miss(airquality) #> [1] FALSE all_complete(airquality) #> [1] FALSE  any_na(airquality) #> [1] TRUE any_complete(airquality) #> [1] TRUE  # use in identifying columns with all missing/complete  library(dplyr) #>  #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #>  #>     filter, lag #> The following objects are masked from ‘package:base’: #>  #>     intersect, setdiff, setequal, union # for printing aq <- as_tibble(airquality) aq #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190   7.4    67     5     1 #>  2    36     118   8      72     5     2 #>  3    12     149  12.6    74     5     3 #>  4    18     313  11.5    62     5     4 #>  5    NA      NA  14.3    56     5     5 #>  6    28      NA  14.9    66     5     6 #>  7    23     299   8.6    65     5     7 #>  8    19      99  13.8    59     5     8 #>  9     8      19  20.1    61     5     9 #> 10    NA     194   8.6    69     5    10 #> # ℹ 143 more rows # select variables with all missing values aq %>% select(where(all_na)) #> # A tibble: 153 × 0 # there are none! #' # select columns with any NA values aq %>% select(where(any_na)) #> # A tibble: 153 × 2 #>    Ozone Solar.R #>        #>  1    41     190 #>  2    36     118 #>  3    12     149 #>  4    18     313 #>  5    NA      NA #>  6    28      NA #>  7    23     299 #>  8    19      99 #>  9     8      19 #> 10    NA     194 #> # ℹ 143 more rows # select only columns with all complete data aq %>% select(where(all_complete)) #> # A tibble: 153 × 4 #>     Wind  Temp Month   Day #>        #>  1   7.4    67     5     1 #>  2   8      72     5     2 #>  3  12.6    74     5     3 #>  4  11.5    62     5     4 #>  5  14.3    56     5     5 #>  6  14.9    66     5     6 #>  7   8.6    65     5     7 #>  8  13.8    59     5     8 #>  9  20.1    61     5     9 #> 10   8.6    69     5    10 #> # ℹ 143 more rows  # select columns where there are any complete cases (all the data) aq %>% select(where(any_complete)) #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190   7.4    67     5     1 #>  2    36     118   8      72     5     2 #>  3    12     149  12.6    74     5     3 #>  4    18     313  11.5    62     5     4 #>  5    NA      NA  14.3    56     5     5 #>  6    28      NA  14.9    66     5     6 #>  7    23     299   8.6    65     5     7 #>  8    19      99  13.8    59     5     8 #>  9     8      19  20.1    61     5     9 #> 10    NA     194   8.6    69     5    10 #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function to determine whether there are any missings — any_row_miss","title":"Helper function to determine whether there are any missings — any_row_miss","text":"Helper function determine whether missings","code":""},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function to determine whether there are any missings — any_row_miss","text":"","code":"any_row_miss(x)"},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function to determine whether there are any missings — any_row_miss","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/any_row_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function to determine whether there are any missings — any_row_miss","text":"logical vector TRUE = missing FALSE = complete","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Create shadows — as_shadow","title":"Create shadows — as_shadow","text":"Return tibble shadow matrix form, variables suffix _NA attached distinguish .","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create shadows — as_shadow","text":"","code":"as_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create shadows — as_shadow","text":"data dataframe ... selected variables use","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create shadows — as_shadow","text":"appended shadow column names","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create shadows — as_shadow","text":"Representing missing data structure achieved using shadow matrix, introduced Swayne Buja. shadow matrix dimension data, consists binary indicators missingness data values, missing represented \"NA\", missing represented \"!NA\". Although may represented 1 0, respectively.","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create shadows — as_shadow","text":"","code":"as_shadow(airquality) #> # A tibble: 153 × 6 #>    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA #>                          #>  1 !NA      !NA        !NA     !NA     !NA      !NA    #>  2 !NA      !NA        !NA     !NA     !NA      !NA    #>  3 !NA      !NA        !NA     !NA     !NA      !NA    #>  4 !NA      !NA        !NA     !NA     !NA      !NA    #>  5 NA       NA         !NA     !NA     !NA      !NA    #>  6 !NA      NA         !NA     !NA     !NA      !NA    #>  7 !NA      !NA        !NA     !NA     !NA      !NA    #>  8 !NA      !NA        !NA     !NA     !NA      !NA    #>  9 !NA      !NA        !NA     !NA     !NA      !NA    #> 10 NA       !NA        !NA     !NA     !NA      !NA    #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert data into shadow format for doing an upset plot — as_shadow_upset","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"Upset plots way visualising common sets, function transforms data format feeds directly upset plot","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"","code":"as_shadow_upset(data)"},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/as_shadow_upset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert data into shadow format for doing an upset plot — as_shadow_upset","text":"","code":"if (FALSE) {  library(UpSetR) airquality %>%   as_shadow_upset() %>%   upset() }"},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Bind a shadow dataframe to original data — bind_shadow","title":"Bind a shadow dataframe to original data — bind_shadow","text":"Binding shadow matrix regular dataframe helps visualise work missing data.","code":""},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bind a shadow dataframe to original data — bind_shadow","text":"","code":"bind_shadow(data, only_miss = FALSE, ...)"},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bind a shadow dataframe to original data — bind_shadow","text":"data dataframe only_miss logical - FALSE (default) bind dataframe variables duplicated shadow. Setting TRUE bind variables variables contain missing values. See examples details. ... extra options pass recode_shadow() - work progress.","code":""},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bind a shadow dataframe to original data — bind_shadow","text":"data added variable shifted suffix _NA","code":""},{"path":"http://naniar.njtierney.com/reference/bind_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bind a shadow dataframe to original data — bind_shadow","text":"","code":"bind_shadow(airquality) #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA   # bind only the variables that contain missing values bind_shadow(airquality, only_miss = TRUE) #> # A tibble: 153 × 8 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA #>                      #>  1    41     190   7.4    67     5     1 !NA      !NA        #>  2    36     118   8      72     5     2 !NA      !NA        #>  3    12     149  12.6    74     5     3 !NA      !NA        #>  4    18     313  11.5    62     5     4 !NA      !NA        #>  5    NA      NA  14.3    56     5     5 NA       NA         #>  6    28      NA  14.9    66     5     6 !NA      NA         #>  7    23     299   8.6    65     5     7 !NA      !NA        #>  8    19      99  13.8    59     5     8 !NA      !NA        #>  9     8      19  20.1    61     5     9 !NA      !NA        #> 10    NA     194   8.6    69     5    10 NA       !NA        #> # ℹ 143 more rows  aq_shadow <- bind_shadow(airquality)  if (FALSE) { # explore missing data visually library(ggplot2)  # using the bounded shadow to visualise Ozone according to whether Solar # Radiation is missing or not.  ggplot(data = aq_shadow,        aes(x = Ozone)) +        geom_histogram() +        facet_wrap(~Solar.R_NA,        ncol = 1) }"},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow column to a dataset — cast_shadow","title":"Add a shadow column to a dataset — cast_shadow","text":"Casting shadow shifted column performs equivalent pattern data %>% select(var) %>% impute_below(). convenience function makes easy perform certain visualisations, line principle user way flexibly return data formats containing information missing data. forms base building block functions cast_shadow_shift, cast_shadow_shift_label. also respects dplyr verbs starts_with, contains, ends_with, etc. select variables.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow column to a dataset — cast_shadow","text":"","code":"cast_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow column to a dataset — cast_shadow","text":"data data.frame ... One unquoted variable names separated commas. respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow column to a dataset — cast_shadow","text":"data added variable shifted suffix _NA","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/cast_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow column to a dataset — cast_shadow","text":"","code":"airquality %>% cast_shadow(Ozone, Solar.R) #> # A tibble: 153 × 4 #>    Ozone Solar.R Ozone_NA Solar.R_NA #>                  #>  1    41     190 !NA      !NA        #>  2    36     118 !NA      !NA        #>  3    12     149 !NA      !NA        #>  4    18     313 !NA      !NA        #>  5    NA      NA NA       NA         #>  6    28      NA !NA      NA         #>  7    23     299 !NA      !NA        #>  8    19      99 !NA      !NA        #>  9     8      19 !NA      !NA        #> 10    NA     194 NA       !NA        #> # ℹ 143 more rows if (FALSE) { library(ggplot2) library(magrittr) airquality  %>%   cast_shadow(Ozone,Solar.R) %>%   ggplot(aes(x = Ozone,              colour = Solar.R_NA)) +         geom_density() }"},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"Shift values add shadow column.  also respects dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"","code":"cast_shadow_shift(data, ...)"},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"data data.frame ... One unquoted variable names separated commas. respect dplyr verbs starts_with, contains, ends_with, etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"data.frame shadow shadow_shift vars","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow and a shadow_shift column to a dataset — cast_shadow_shift","text":"","code":"airquality %>% cast_shadow_shift(Ozone,Temp) #> # A tibble: 153 × 6 #>    Ozone  Temp Ozone_NA Temp_NA Ozone_shift Temp_shift #>                          #>  1    41    67 !NA      !NA            41           67 #>  2    36    72 !NA      !NA            36           72 #>  3    12    74 !NA      !NA            12           74 #>  4    18    62 !NA      !NA            18           62 #>  5    NA    56 NA       !NA           -19.7         56 #>  6    28    66 !NA      !NA            28           66 #>  7    23    65 !NA      !NA            23           65 #>  8    19    59 !NA      !NA            19           59 #>  9     8    61 !NA      !NA             8           61 #> 10    NA    69 NA       !NA           -18.5         69 #> # ℹ 143 more rows  airquality %>% cast_shadow_shift(dplyr::contains(\"o\")) #> # A tibble: 153 × 12 #>    Ozone Solar.R Month Ozone_NA Solar.R_NA Month_NA Ozone_shift Solar.R_shift #>                                       #>  1    41     190     5 !NA      !NA        !NA             41           190   #>  2    36     118     5 !NA      !NA        !NA             36           118   #>  3    12     149     5 !NA      !NA        !NA             12           149   #>  4    18     313     5 !NA      !NA        !NA             18           313   #>  5    NA      NA     5 NA       NA         !NA            -19.7         -33.6 #>  6    28      NA     5 !NA      NA         !NA             28           -33.1 #>  7    23     299     5 !NA      !NA        !NA             23           299   #>  8    19      99     5 !NA      !NA        !NA             19            99   #>  9     8      19     5 !NA      !NA        !NA              8            19   #> 10    NA     194     5 NA       !NA        !NA            -18.5         194   #> # ℹ 143 more rows #> # ℹ 4 more variables: Month_shift , Ozone_NA_shift , #> #   Solar.R_NA_shift , Month_NA_shift "},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"Shift values, add shadow, add missing label","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"","code":"cast_shadow_shift_label(data, ...)"},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"data data.frame ... One unquoted expressions separated commas. also respect dplyr verbs \"starts_with\", \"contains\", \"ends_with\", etc.","code":""},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"data.frame shadow shadow_shift vars, missing labels","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/cast_shadow_shift_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a shadow column and a shadow shifted column to a dataset — cast_shadow_shift_label","text":"","code":"airquality %>% cast_shadow_shift_label(Ozone, Solar.R) #> # A tibble: 153 × 7 #>    Ozone Solar.R Ozone_NA Solar.R_NA Ozone_shift Solar.R_shift any_missing #>                                         #>  1    41     190 !NA      !NA               41           190   Not Missing #>  2    36     118 !NA      !NA               36           118   Not Missing #>  3    12     149 !NA      !NA               12           149   Not Missing #>  4    18     313 !NA      !NA               18           313   Not Missing #>  5    NA      NA NA       NA               -19.7         -33.6 Missing     #>  6    28      NA !NA      NA                28           -33.1 Missing     #>  7    23     299 !NA      !NA               23           299   Not Missing #>  8    19      99 !NA      !NA               19            99   Not Missing #>  9     8      19 !NA      !NA                8            19   Not Missing #> 10    NA     194 NA       !NA              -18.5         194   Missing     #> # ℹ 143 more rows  # replicate the plot generated by geom_miss_point() if (FALSE) { library(ggplot2)  airquality %>%   cast_shadow_shift_label(Ozone,Solar.R) %>%   ggplot(aes(x = Ozone_shift,              y = Solar.R_shift,              colour = any_missing)) +         geom_point() }"},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":null,"dir":"Reference","previous_headings":"","what":"Common number values for NA — common_na_numbers","title":"Common number values for NA — common_na_numbers","text":"vector contains common number values NA (missing), aimed used inside naniar functions miss_scan_count() replace_with_na(). current list numbers can found printing common_na_numbers. useful way explore data possible missings, strongly warn using replace NA values without carefully looking incidence cases. Common NA strings data object common_na_strings.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Common number values for NA — common_na_numbers","text":"","code":"common_na_numbers"},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Common number values for NA — common_na_numbers","text":"object class numeric length 8.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Common number values for NA — common_na_numbers","text":"original discussion https://github.com/njtierney/naniar/issues/168","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_numbers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Common number values for NA — common_na_numbers","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  miss_scan_count(dat_ms, -99) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            1 #> 2 y            0 #> 3 z            1 miss_scan_count(dat_ms, c(\"-99\",\"-98\",\"N/A\")) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            1 #> 3 z            2 common_na_numbers #> [1]    -9   -99  -999 -9999  9999    66    77    88 miss_scan_count(dat_ms, common_na_numbers) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            0 #> 3 z            2"},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":null,"dir":"Reference","previous_headings":"","what":"Common string values for NA — common_na_strings","title":"Common string values for NA — common_na_strings","text":"vector contains common values NA (missing), aimed used inside naniar functions miss_scan_count() replace_with_na(). current list strings used can found printing common_na_strings. useful way explore data possible missings, strongly warn using replace NA values without carefully looking incidence cases. Please note common_na_strings uses \\\\ around \"?\", \".\" \"*\" characters protect using wildcard features grep. Common NA numbers data object common_na_numbers.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Common string values for NA — common_na_strings","text":"","code":"common_na_strings"},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Common string values for NA — common_na_strings","text":"object class character length 26.","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Common string values for NA — common_na_strings","text":"original discussion https://github.com/njtierney/naniar/issues/168","code":""},{"path":"http://naniar.njtierney.com/reference/common_na_strings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Common string values for NA — common_na_strings","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  miss_scan_count(dat_ms, -99) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            1 #> 2 y            0 #> 3 z            1 miss_scan_count(dat_ms, c(\"-99\",\"-98\",\"N/A\")) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            1 #> 3 z            2 common_na_strings #>  [1] \"missing\" \"NA\"      \"N A\"     \"N/A\"     \"#N/A\"    \"NA \"     \" NA\"     #>  [8] \"N /A\"    \"N / A\"   \" N / A\"  \"N / A \"  \"na\"      \"n a\"     \"n/a\"     #> [15] \"na \"     \" na\"     \"n /a\"    \"n / a\"   \" a / a\"  \"n / a \"  \"NULL\"    #> [22] \"null\"    \"\"        \"\\\\?\"     \"\\\\*\"     \"\\\\.\"     miss_scan_count(dat_ms, common_na_strings) #> # A tibble: 3 × 2 #>   Variable     n #>        #> 1 x            4 #> 2 y            4 #> 3 z            5 replace_with_na(dat_ms, replace = list(y = common_na_strings)) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1"},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Key drawing functions — draw_key","title":"Key drawing functions — draw_key","text":"Geom associated function draws key geom needs displayed legend. options built naniar.","code":""},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Key drawing functions — draw_key","text":"","code":"draw_key_missing_point(data, params, size)"},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Key drawing functions — draw_key","text":"data single row data frame containing scaled aesthetics display key params list additional parameters supplied geom. size Width height key mm.","code":""},{"path":"http://naniar.njtierney.com/reference/draw_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Key drawing functions — draw_key","text":"grid grob.","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Long form representation of a shadow matrix — gather_shadow","title":"Long form representation of a shadow matrix — gather_shadow","text":"gather_shadow long-form representation binding shadow matrix data, producing variables named case, variable, missing, missing contains missing value representation.","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Long form representation of a shadow matrix — gather_shadow","text":"","code":"gather_shadow(data)"},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Long form representation of a shadow matrix — gather_shadow","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Long form representation of a shadow matrix — gather_shadow","text":"dataframe long, format, containing information missings","code":""},{"path":"http://naniar.njtierney.com/reference/gather_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Long form representation of a shadow matrix — gather_shadow","text":"","code":"gather_shadow(airquality) #> # A tibble: 918 × 3 #>     case variable   missing #>              #>  1     1 Ozone_NA   !NA     #>  2     1 Solar.R_NA !NA     #>  3     1 Wind_NA    !NA     #>  4     1 Temp_NA    !NA     #>  5     1 Month_NA   !NA     #>  6     1 Day_NA     !NA     #>  7     2 Ozone_NA   !NA     #>  8     2 Solar.R_NA !NA     #>  9     2 Wind_NA    !NA     #> 10     2 Temp_NA    !NA     #> # ℹ 908 more rows"},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":null,"dir":"Reference","previous_headings":"","what":"geom_miss_point — geom_miss_point","title":"geom_miss_point — geom_miss_point","text":"geom_miss_point provides way transform plot missing values ggplot2. uses methods ggobi display missing data points 10\\ axis.","code":""},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"geom_miss_point — geom_miss_point","text":"","code":"geom_miss_point(   mapping = NULL,   data = NULL,   prop_below = 0.1,   jitter = 0.05,   stat = \"miss_point\",   position = \"identity\",   colour = ..missing..,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE,   ... )"},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"geom_miss_point — geom_miss_point","text":"mapping Set aesthetic mappings created ggplot2::aes() ggplot2::aes_(). specified inherit.aes = TRUE (default), combined default mapping top level plot. need supply mapping mapping defined plot. data data frame. specified, overrides default data frame defined top level plot. prop_below degree shift values. default 0.1 jitter amount jitter add. default 0.05 stat statistical transformation use data layer, string. position Position adjustment, either string, result call position adjustment function. colour colour chosen aesthetic na.rm FALSE (default), removes missing values warning. TRUE silently removes missing values. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders. ... arguments passed ggplot2::layer(). three types arguments can use : Aesthetics: set aesthetic fixed value, like color = \"red\" size = 3. arguments layer, example override default stat associated layer. arguments passed stat.","code":""},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"geom_miss_point — geom_miss_point","text":"Plot Missing Data Points","code":""},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"geom_miss_point — geom_miss_point","text":"Warning message na.rm = T supplied.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/geom_miss_point.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"geom_miss_point — geom_miss_point","text":"","code":"if (FALSE) { library(ggplot2)  # using regular geom_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) + geom_point()  # using  geom_miss_point() ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point()   # using facets  ggplot(airquality,        aes(x = Ozone,            y = Solar.R)) +  geom_miss_point() +  facet_wrap(~Month) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings per case (row) — gg_miss_case","title":"Plot the number of missings per case (row) — gg_miss_case","text":"visual analogue miss_case_summary. draws ggplot number missings case (row). default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings per case (row) — gg_miss_case","text":"","code":"gg_miss_case(x, facet, order_cases = TRUE, show_pct = FALSE)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings per case (row) — gg_miss_case","text":"x data.frame facet (optional) single bare variable name, want create faceted plot. order_cases logical Order rows missingness (default FALSE - order). show_pct logical Show percentage cases","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings per case (row) — gg_miss_case","text":"ggplot object depicting number missings given case.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings per case (row) — gg_miss_case","text":"","code":"gg_miss_case(airquality)  if (FALSE) { library(ggplot2) gg_miss_case(airquality) + labs(x = \"Number of Cases\") gg_miss_case(airquality, show_pct = TRUE) gg_miss_case(airquality, order_cases = FALSE) gg_miss_case(airquality, facet = Month) gg_miss_case(airquality, facet = Month, order_cases = FALSE) gg_miss_case(airquality, facet = Month, show_pct = TRUE) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"plot showing cumulative sum missing values cases, reading rows top bottom. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"","code":"gg_miss_case_cumsum(x, breaks = 20)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"x dataframe breaks breaks x axis default 20","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"ggplot object depicting number missings","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_case_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot of cumulative sum of missing for cases — gg_miss_case_cumsum","text":"","code":"gg_miss_case_cumsum(airquality)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"function draws ggplot plot number missings column, broken categorical variable dataset. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"","code":"gg_miss_fct(x, fct)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"x data.frame fct column containing factor variable visualise","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"ggplot object depicting % missing factor level variable.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_fct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings for each variable, broken down by a factor — gg_miss_fct","text":"","code":"gg_miss_fct(x = riskfactors, fct = marital)  if (FALSE) { library(ggplot2) gg_miss_fct(x = riskfactors, fct = marital) + labs(title = \"NA in Risk Factors and Marital status\") }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings in a given repeating span — gg_miss_span","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"gg_miss_span replacement function imputeTS::plotNA.distributionBar(tsNH4, breaksize = 100), shows number missings given span, breaksize. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"","code":"gg_miss_span(data, var, span_every, facet)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"data data.frame var bare unquoted variable name data. span_every integer describing length span explored facet (optional) single bare variable name, want create faceted plot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"ggplot2 showing number missings span (window, breaksize)","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_span.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings in a given repeating span — gg_miss_span","text":"","code":"miss_var_span(pedestrian, hourly_counts, span_every = 3000) #> # A tibble: 13 × 6 #>    span_counter n_miss n_complete prop_miss prop_complete n_in_span #>                                       #>  1            1      0       3000  0                1          3000 #>  2            2      0       3000  0                1          3000 #>  3            3      1       2999  0.000333         1.00       3000 #>  4            4    121       2879  0.0403           0.960      3000 #>  5            5    503       2497  0.168            0.832      3000 #>  6            6    555       2445  0.185            0.815      3000 #>  7            7    190       2810  0.0633           0.937      3000 #>  8            8      0       3000  0                1          3000 #>  9            9      1       2999  0.000333         1.00       3000 #> 10           10      0       3000  0                1          3000 #> 11           11      0       3000  0                1          3000 #> 12           12    745       2255  0.248            0.752      3000 #> 13           13    432       1268  0.254            0.746      1700 if (FALSE) { library(ggplot2) gg_miss_span(pedestrian, hourly_counts, span_every = 3000) gg_miss_span(pedestrian, hourly_counts, span_every = 3000, facet = sensor_name) # works with the rest of ggplot gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + labs(x = \"custom\") gg_miss_span(pedestrian, hourly_counts, span_every = 3000) + theme_dark() }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"Upset plots way visualising common sets, gg_miss_upset shows number missing values sets data. default option gg_miss_upset taken UpSetR::upset - use 5 sets 40 interactions. also set ordering frequency intersections. Setting nsets = 5 means look 5 variables combinations. number combinations rather intersections controlled nintersects. 40 intersections, 40 combinations variables explored. number sets intersections can changed passing arguments nsets = 10 look 10 sets variables, nintersects = 50 look 50 intersections.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"","code":"gg_miss_upset(data, order.by = \"freq\", ...)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"data data.frame order.(UpSetR::upset) intersections matrix ordered . Options include frequency (entered \"freq\"), degree, order.  See ?UpSetR::upset options ... arguments pass upset plot - see ?UpSetR::upset","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"ggplot visualisation missing data","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_upset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the pattern of missingness using an upset plot. — gg_miss_upset","text":"","code":"if (FALSE) { gg_miss_upset(airquality) gg_miss_upset(riskfactors) gg_miss_upset(riskfactors, nsets = 10) gg_miss_upset(riskfactors, nsets = 10, nintersects = 10) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot the number of missings for each variable — gg_miss_var","title":"Plot the number of missings for each variable — gg_miss_var","text":"visual analogue miss_var_summary. draws ggplot number missings variable, ordered show variables missing data. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot the number of missings for each variable — gg_miss_var","text":"","code":"gg_miss_var(x, facet, show_pct = FALSE)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot the number of missings for each variable — gg_miss_var","text":"x dataframe facet (optional) bare variable name, want create faceted plot. show_pct logical shows number missings (default), set TRUE, display proportion missings.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot the number of missings for each variable — gg_miss_var","text":"ggplot object depicting number missings given column","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot the number of missings for each variable — gg_miss_var","text":"","code":"gg_miss_var(airquality)  if (FALSE) { library(ggplot2) gg_miss_var(airquality) + labs(y = \"Look at all the missing ones\") gg_miss_var(airquality, Month) gg_miss_var(airquality, Month, show_pct = TRUE) gg_miss_var(airquality, Month, show_pct = TRUE) + ylim(0, 100) }"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"plot showing cumulative sum missing values variable, reading columns left right initial dataframe. default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"","code":"gg_miss_var_cumsum(x)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"x data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"ggplot object showing cumulative sum missings variables","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_var_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot of cumulative sum of missing value for each variable — gg_miss_var_cumsum","text":"","code":"gg_miss_var_cumsum(airquality)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot which variables contain a missing value — gg_miss_which","title":"Plot which variables contain a missing value — gg_miss_which","text":"plot produces set rectangles indicating whether missing element column .  default minimal theme used, can customised normal ggplot.","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot which variables contain a missing value — gg_miss_which","text":"","code":"gg_miss_which(x)"},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot which variables contain a missing value — gg_miss_which","text":"x dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot which variables contain a missing value — gg_miss_which","text":"ggplot object variables contains missing values","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/gg_miss_which.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot which variables contain a missing value — gg_miss_which","text":"","code":"gg_miss_which(airquality)"},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute data with values shifted 10 percent below range. — impute_below","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"can useful exploratory graphics impute data outside range data. impute_below imputes variables missings values 10 percent range numeric values, plus jittered noise, separate repeated values, missing values can visualised along rest data. character factor values, adds new string label.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"","code":"impute_below(x, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"x variable interest shift ... extra arguments pass","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/impute_below.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute data with values shifted 10 percent below range. — impute_below","text":"","code":"library(dplyr) vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_below(vec) #>  [1] -0.008593142 -0.530161130 -0.561854135  0.509078646  0.115911160 #>  [6] -0.751444156 -0.252584949 -0.690342117  0.985024011 -0.742595875 impute_below(vec, prop_below = 0.25) #>  [1] -0.008593142 -0.530161130 -0.561854135  0.509078646  0.115911160 #>  [6] -0.983475878 -0.252584949 -0.922373839  0.985024011 -0.974627597 impute_below(vec,             prop_below = 0.25,             jitter = 0.2) #>  [1] -0.008593142 -0.530161130 -0.561854135  0.509078646  0.115911160 #>  [6] -1.088182499 -0.252584949 -0.843774343  0.985024011 -1.052789373  dat <- tibble(  num = rnorm(10),  int = as.integer(rpois(10, 5)),  fct = factor(LETTERS[1:10]) ) %>%  mutate(    across(      everything(),      \\(x) set_prop_miss(x, prop = 0.25)    )  )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1  0.721     10 A     #>  2 -0.303      5 B     #>  3 -0.730      6 C     #>  4  0.0459    NA D     #>  5  0.271      7 NA    #>  6 -1.74       5 F     #>  7 -0.290      1 NA    #>  8 -0.686      5 H     #>  9 NA         NA I     #> 10 NA          3 J      dat %>%  nabular() %>%  mutate(    num = impute_below(num),    int = impute_below(int),    fct = impute_below(fct),  ) #> # A tibble: 10 × 6 #>        num     int fct     num_NA int_NA fct_NA #>                   #>  1  0.721  10      A       !NA    !NA    !NA    #>  2 -0.303   5      B       !NA    !NA    !NA    #>  3 -0.730   6      C       !NA    !NA    !NA    #>  4  0.0459 -0.0751 D       !NA    NA     !NA    #>  5  0.271   7      missing !NA    !NA    NA     #>  6 -1.74    5      F       !NA    !NA    !NA    #>  7 -0.290   1      missing !NA    !NA    NA     #>  8 -0.686   5      H       !NA    !NA    !NA    #>  9 -2.01    0.0370 I       NA     NA     !NA    #> 10 -2.03    3      J       NA     !NA    !NA     dat %>%  nabular() %>%  mutate(    across(      where(is.numeric),      impute_below    )  ) #> # A tibble: 10 × 6 #>        num     int fct   num_NA int_NA fct_NA #>                 #>  1  0.721  10      A     !NA    !NA    !NA    #>  2 -0.303   5      B     !NA    !NA    !NA    #>  3 -0.730   6      C     !NA    !NA    !NA    #>  4  0.0459 -0.0751 D     !NA    NA     !NA    #>  5  0.271   7      NA    !NA    !NA    NA     #>  6 -1.74    5      F     !NA    !NA    !NA    #>  7 -0.290   1      NA    !NA    !NA    NA     #>  8 -0.686   5      H     !NA    !NA    !NA    #>  9 -2.01    0.0370 I     NA     NA     !NA    #> 10 -2.03    3      J     NA     !NA    !NA     dat %>%  nabular() %>%  mutate(    across(      c(\"num\", \"int\"),      impute_below    )  ) #> # A tibble: 10 × 6 #>        num     int fct   num_NA int_NA fct_NA #>                 #>  1  0.721  10      A     !NA    !NA    !NA    #>  2 -0.303   5      B     !NA    !NA    !NA    #>  3 -0.730   6      C     !NA    !NA    !NA    #>  4  0.0459 -0.0751 D     !NA    NA     !NA    #>  5  0.271   7      NA    !NA    !NA    NA     #>  6 -1.74    5      F     !NA    !NA    !NA    #>  7 -0.290   1      NA    !NA    !NA    NA     #>  8 -0.686   5      H     !NA    !NA    !NA    #>  9 -2.01    0.0370 I     NA     NA     !NA    #> 10 -2.03    3      J     NA     !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_below.numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute numeric values below a range for graphical exploration — impute_below.numeric","title":"Impute numeric values below a range for graphical exploration — impute_below.numeric","text":"Impute numeric values range graphical exploration","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below.numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute numeric values below a range for graphical exploration — impute_below.numeric","text":"","code":"# S3 method for numeric impute_below(   x,   prop_below = 0.1,   jitter = 0.05,   seed_shift = 2017 - 7 - 1 - 1850,   ... )"},{"path":"http://naniar.njtierney.com/reference/impute_below.numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute numeric values below a range for graphical exploration — impute_below.numeric","text":"x variable interest shift prop_below degree shift values. default jitter amount jitter add. default 0.05 seed_shift random seed set, like ... extra arguments pass","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute data with values shifted 10 percent below range. — impute_below_all","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"can useful exploratory graphics impute data outside range data. impute_below_all imputes variables missings values 10\\ values adds new string label.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"","code":"impute_below_all(.tbl, prop_below = 0.1, jitter = 0.05, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":".tbl data.frame prop_below degree shift values. default jitter amount jitter add. default 0.05 ... additional arguments","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/impute_below_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute data with values shifted 10 percent below range. — impute_below_all","text":"","code":"# you can impute data like so: airquality %>%   impute_below_all() #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30  # However, this does not show you WHERE the missing values are. # to keep track of them, you want to use `bind_shadow()` first.  airquality %>%   bind_shadow() %>%   impute_below_all() #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1  41     190     7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2  36     118     8      72     5     2 !NA      !NA        !NA     !NA     #>  3  12     149    12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4  18     313    11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5 -19.7   -33.6  14.3    56     5     5 NA       NA         !NA     !NA     #>  6  28     -33.1  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7  23     299     8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8  19      99    13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9   8      19    20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10 -18.5   194     8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA   # This identifies where the missing values are located, which means you # can do things like this:  if (FALSE) { library(ggplot2) airquality %>%   bind_shadow() %>%   impute_below_all() %>%   # identify where there are missings across rows.   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +   geom_point() # Note that this ^^ is a long version of `geom_miss_point()`. }"},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_below — impute_below_at","title":"Scoped variants of impute_below — impute_below_at","text":"impute_below imputes missing values set percentage range data. impute many variables , recommend use across function workflow, shown examples impute_below(). impute_below_all operates variables. impute variables satisfy specific condition, use scoped variants, impute_below_at, impute_below_if. use _at effectively, must know _at`` affects variables selected character vector, vars()`.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_below — impute_below_at","text":"","code":"impute_below_at(.tbl, .vars, prop_below = 0.1, jitter = 0.05, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_below — impute_below_at","text":".tbl data.frame .vars variables impute prop_below degree shift values. default jitter amount jitter add. default 0.05 ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_below — impute_below_at","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/impute_below_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_below — impute_below_at","text":"","code":"# select variables starting with a particular string. impute_below_at(airquality,                 .vars = c(\"Ozone\", \"Solar.R\")) #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30  impute_below_at(airquality, .vars = 1:2) #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30  if (FALSE) { library(dplyr) impute_below_at(airquality,                 .vars = vars(Ozone))  library(ggplot2) airquality %>%   bind_shadow() %>%   impute_below_at(vars(Ozone, Solar.R)) %>%   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +          geom_point() }"},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_below — impute_below_if","title":"Scoped variants of impute_below — impute_below_if","text":"impute_below operates variables. impute variables satisfy specific condition, use scoped variants, impute_below_at, impute_below_if.","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_below — impute_below_if","text":"","code":"impute_below_if(.tbl, .predicate, prop_below = 0.1, jitter = 0.05, ...)"},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_below — impute_below_if","text":".tbl data.frame .predicate predicate function (.numeric) prop_below degree shift values. default jitter amount jitter add. default 0.05 ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_below — impute_below_if","text":"dataset values imputed","code":""},{"path":"http://naniar.njtierney.com/reference/impute_below_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_below — impute_below_if","text":"","code":"airquality %>%   impute_below_if(.predicate = is.numeric) #>         Ozone   Solar.R Wind Temp Month Day #> 1    41.00000 190.00000  7.4   67     5   1 #> 2    36.00000 118.00000  8.0   72     5   2 #> 3    12.00000 149.00000 12.6   74     5   3 #> 4    18.00000 313.00000 11.5   62     5   4 #> 5   -19.72321 -33.57778 14.3   56     5   5 #> 6    28.00000 -33.07810 14.9   66     5   6 #> 7    23.00000 299.00000  8.6   65     5   7 #> 8    19.00000  99.00000 13.8   59     5   8 #> 9     8.00000  19.00000 20.1   61     5   9 #> 10  -18.51277 194.00000  8.6   69     5  10 #> 11    7.00000 -21.37719  6.9   74     5  11 #> 12   16.00000 256.00000  9.7   69     5  12 #> 13   11.00000 290.00000  9.2   66     5  13 #> 14   14.00000 274.00000 10.9   68     5  14 #> 15   18.00000  65.00000 13.2   58     5  15 #> 16   14.00000 334.00000 11.5   64     5  16 #> 17   34.00000 307.00000 12.0   66     5  17 #> 18    6.00000  78.00000 18.4   57     5  18 #> 19   30.00000 322.00000 11.5   68     5  19 #> 20   11.00000  44.00000  9.7   62     5  20 #> 21    1.00000   8.00000  9.7   59     5  21 #> 22   11.00000 320.00000 16.6   73     5  22 #> 23    4.00000  25.00000  9.7   61     5  23 #> 24   32.00000  92.00000 12.0   61     5  24 #> 25  -17.81863  66.00000 16.6   57     5  25 #> 26  -19.43853 266.00000 14.9   58     5  26 #> 27  -15.14310 -24.60954  8.0   57     5  27 #> 28   23.00000  13.00000 12.0   67     5  28 #> 29   45.00000 252.00000 14.9   81     5  29 #> 30  115.00000 223.00000  5.7   79     5  30 #> 31   37.00000 279.00000  7.4   76     5  31 #> 32  -16.17315 286.00000  8.6   78     6   1 #> 33  -14.65883 287.00000  9.7   74     6   2 #> 34  -17.85609 242.00000 16.1   67     6   3 #> 35  -13.29299 186.00000  9.2   84     6   4 #> 36  -16.16323 220.00000  8.6   85     6   5 #> 37  -19.60935 264.00000 14.3   79     6   6 #> 38   29.00000 127.00000  9.7   82     6   7 #> 39  -19.65780 273.00000  6.9   87     6   8 #> 40   71.00000 291.00000 13.8   90     6   9 #> 41   39.00000 323.00000 11.5   87     6  10 #> 42  -13.40961 259.00000 10.9   93     6  11 #> 43  -13.53728 250.00000  9.2   92     6  12 #> 44   23.00000 148.00000  8.0   82     6  13 #> 45  -19.65993 332.00000 13.8   80     6  14 #> 46  -16.48342 322.00000 11.5   79     6  15 #> 47   21.00000 191.00000 14.9   77     6  16 #> 48   37.00000 284.00000 20.7   72     6  17 #> 49   20.00000  37.00000  9.2   65     6  18 #> 50   12.00000 120.00000 11.5   73     6  19 #> 51   13.00000 137.00000 10.3   76     6  20 #> 52  -17.17718 150.00000  6.3   77     6  21 #> 53  -16.74073  59.00000  1.7   76     6  22 #> 54  -13.65786  91.00000  4.6   76     6  23 #> 55  -16.78786 250.00000  6.3   76     6  24 #> 56  -12.30098 135.00000  8.0   75     6  25 #> 57  -13.33171 127.00000  8.0   78     6  26 #> 58  -16.77414  47.00000 10.3   73     6  27 #> 59  -17.08225  98.00000 11.5   80     6  28 #> 60  -15.98818  31.00000 14.9   77     6  29 #> 61  -19.17558 138.00000  8.0   83     6  30 #> 62  135.00000 269.00000  4.1   84     7   1 #> 63   49.00000 248.00000  9.2   85     7   2 #> 64   32.00000 236.00000  9.2   81     7   3 #> 65  -14.27138 101.00000 10.9   84     7   4 #> 66   64.00000 175.00000  4.6   83     7   5 #> 67   40.00000 314.00000 10.9   83     7   6 #> 68   77.00000 276.00000  5.1   88     7   7 #> 69   97.00000 267.00000  6.3   92     7   8 #> 70   97.00000 272.00000  5.7   92     7   9 #> 71   85.00000 175.00000  7.4   89     7  10 #> 72  -13.51764 139.00000  8.6   82     7  11 #> 73   10.00000 264.00000 14.3   73     7  12 #> 74   27.00000 175.00000 14.9   81     7  13 #> 75  -13.48998 291.00000 14.9   91     7  14 #> 76    7.00000  48.00000 14.3   80     7  15 #> 77   48.00000 260.00000  6.9   81     7  16 #> 78   35.00000 274.00000 10.3   82     7  17 #> 79   61.00000 285.00000  6.3   84     7  18 #> 80   79.00000 187.00000  5.1   87     7  19 #> 81   63.00000 220.00000 11.5   85     7  20 #> 82   16.00000   7.00000  6.9   74     7  21 #> 83  -16.92150 258.00000  9.7   81     7  22 #> 84  -16.60335 295.00000 11.5   82     7  23 #> 85   80.00000 294.00000  8.6   86     7  24 #> 86  108.00000 223.00000  8.0   85     7  25 #> 87   20.00000  81.00000  8.6   82     7  26 #> 88   52.00000  82.00000 12.0   86     7  27 #> 89   82.00000 213.00000  7.4   88     7  28 #> 90   50.00000 275.00000  7.4   86     7  29 #> 91   64.00000 253.00000  7.4   83     7  30 #> 92   59.00000 254.00000  9.2   81     7  31 #> 93   39.00000  83.00000  6.9   81     8   1 #> 94    9.00000  24.00000 13.8   81     8   2 #> 95   16.00000  77.00000  7.4   82     8   3 #> 96   78.00000 -30.94374  6.9   86     8   4 #> 97   35.00000 -33.38707  7.4   85     8   5 #> 98   66.00000 -21.48980  4.6   87     8   6 #> 99  122.00000 255.00000  4.0   89     8   7 #> 100  89.00000 229.00000 10.3   90     8   8 #> 101 110.00000 207.00000  8.0   90     8   9 #> 102 -14.78907 222.00000  8.6   92     8  10 #> 103 -16.19151 137.00000 11.5   86     8  11 #> 104  44.00000 192.00000 11.5   86     8  12 #> 105  28.00000 273.00000 11.5   82     8  13 #> 106  65.00000 157.00000  9.7   80     8  14 #> 107 -19.73591  64.00000 11.5   79     8  15 #> 108  22.00000  71.00000 10.3   77     8  16 #> 109  59.00000  51.00000  6.3   79     8  17 #> 110  23.00000 115.00000  7.4   76     8  18 #> 111  31.00000 244.00000 10.9   78     8  19 #> 112  44.00000 190.00000 10.3   78     8  20 #> 113  21.00000 259.00000 15.5   77     8  21 #> 114   9.00000  36.00000 14.3   72     8  22 #> 115 -18.92235 255.00000 12.6   75     8  23 #> 116  45.00000 212.00000  9.7   79     8  24 #> 117 168.00000 238.00000  3.4   81     8  25 #> 118  73.00000 215.00000  8.0   86     8  26 #> 119 -14.86296 153.00000  5.7   88     8  27 #> 120  76.00000 203.00000  9.7   97     8  28 #> 121 118.00000 225.00000  2.3   94     8  29 #> 122  84.00000 237.00000  6.3   96     8  30 #> 123  85.00000 188.00000  6.3   94     8  31 #> 124  96.00000 167.00000  6.9   91     9   1 #> 125  78.00000 197.00000  5.1   92     9   2 #> 126  73.00000 183.00000  2.8   93     9   3 #> 127  91.00000 189.00000  4.6   93     9   4 #> 128  47.00000  95.00000  7.4   87     9   5 #> 129  32.00000  92.00000 15.5   84     9   6 #> 130  20.00000 252.00000 10.9   80     9   7 #> 131  23.00000 220.00000 10.3   78     9   8 #> 132  21.00000 230.00000 10.9   75     9   9 #> 133  24.00000 259.00000  9.7   73     9  10 #> 134  44.00000 236.00000 14.9   81     9  11 #> 135  21.00000 259.00000 15.5   76     9  12 #> 136  28.00000 238.00000  6.3   77     9  13 #> 137   9.00000  24.00000 10.9   71     9  14 #> 138  13.00000 112.00000 11.5   71     9  15 #> 139  46.00000 237.00000  6.9   78     9  16 #> 140  18.00000 224.00000 13.8   67     9  17 #> 141  13.00000  27.00000 10.3   76     9  18 #> 142  24.00000 238.00000 10.3   68     9  19 #> 143  16.00000 201.00000  8.0   82     9  20 #> 144  13.00000 238.00000 12.6   64     9  21 #> 145  23.00000  14.00000  9.2   71     9  22 #> 146  36.00000 139.00000 10.3   81     9  23 #> 147   7.00000  49.00000 10.3   69     9  24 #> 148  14.00000  20.00000 16.6   63     9  25 #> 149  30.00000 193.00000  6.9   70     9  26 #> 150 -14.83089 145.00000 13.2   77     9  27 #> 151  14.00000 191.00000 14.3   75     9  28 #> 152  18.00000 131.00000  8.0   76     9  29 #> 153  20.00000 223.00000 11.5   68     9  30"},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute a factor value into a vector with missing values — impute_factor","title":"Impute a factor value into a vector with missing values — impute_factor","text":"imputing fixed factor levels. adds new imputed value end levels vector. generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute a factor value into a vector with missing values — impute_factor","text":"","code":"impute_factor(x, value)  # S3 method for default impute_factor(x, value)  # S3 method for factor impute_factor(x, value)  # S3 method for character impute_factor(x, value)  # S3 method for shade impute_factor(x, value)"},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute a factor value into a vector with missing values — impute_factor","text":"x vector value factor impute","code":""},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute a factor value into a vector with missing values — impute_factor","text":"vector factor values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_factor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute a factor value into a vector with missing values — impute_factor","text":"","code":"vec <- factor(LETTERS[1:10])  vec[sample(1:10, 3)] <- NA  vec #>  [1] A    B    C    D    E     G     I     #> Levels: A B C D E F G H I J  impute_factor(vec, \"wat\") #>  [1] A   B   C   D   E   wat G   wat I   wat #> Levels: A B C D E F G H I J wat  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1  0.0742     4 A     #>  2 -0.201     NA B     #>  3  1.51      NA C     #>  4 NA          4 D     #>  5 NA          3 E     #>  6  1.37       6 NA    #>  7  1.06       3 G     #>  8 -1.00       3 NA    #>  9  0.880      4 I     #> 10  0.987      7 J      dat %>%   nabular() %>%   mutate(     num = impute_fixed(num, -9999),     int = impute_zero(int),     fct = impute_factor(fct, \"out\")   ) #> # A tibble: 10 × 6 #>           num   int fct   num_NA int_NA fct_NA #>                  #>  1     0.0742     4 A     !NA    !NA    !NA    #>  2    -0.201      0 B     !NA    NA     !NA    #>  3     1.51       0 C     !NA    NA     !NA    #>  4 -9999          4 D     NA     !NA    !NA    #>  5 -9999          3 E     NA     !NA    !NA    #>  6     1.37       6 out   !NA    !NA    NA     #>  7     1.06       3 G     !NA    !NA    !NA    #>  8    -1.00       3 out   !NA    !NA    NA     #>  9     0.880      4 I     !NA    !NA    !NA    #> 10     0.987      7 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute a fixed value into a vector with missing values — impute_fixed","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"","code":"impute_fixed(x, value)  # S3 method for default impute_fixed(x, value)"},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"x vector value value impute","code":""},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"vector fixed values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_fixed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute a fixed value into a vector with missing values — impute_fixed","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  vec #>  [1] -1.4057189  2.4815984         NA  0.4221011 -0.6310333  0.5363818 #>  [7] -1.4013999         NA         NA -0.1498814  impute_fixed(vec, -999) #>  [1]   -1.4057189    2.4815984 -999.0000000    0.4221011   -0.6310333 #>  [6]    0.5363818   -1.4013999 -999.0000000 -999.0000000   -0.1498814  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1 NA          1 A     #>  2 NA         NA B     #>  3 -0.813     NA C     #>  4 -0.0584     1 NA    #>  5 -2.26       9 E     #>  6 -1.14       7 F     #>  7 -0.294      2 G     #>  8 -0.493      5 NA    #>  9  1.95       7 I     #> 10  0.349      3 J      dat %>%   nabular() %>%   mutate(     num = impute_fixed(num, -9999),     int = impute_zero(int),     fct = impute_factor(fct, \"out\")   ) #> # A tibble: 10 × 6 #>           num   int fct   num_NA int_NA fct_NA #>                  #>  1 -9999          1 A     NA     !NA    !NA    #>  2 -9999          0 B     NA     NA     !NA    #>  3    -0.813      0 C     !NA    NA     !NA    #>  4    -0.0584     1 out   !NA    !NA    NA     #>  5    -2.26       9 E     !NA    !NA    !NA    #>  6    -1.14       7 F     !NA    !NA    !NA    #>  7    -0.294      2 G     !NA    !NA    !NA    #>  8    -0.493      5 out   !NA    !NA    NA     #>  9     1.95       7 I     !NA    !NA    !NA    #> 10     0.349      3 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute the mean value into a vector with missing values — impute_mean","title":"Impute the mean value into a vector with missing values — impute_mean","text":"can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute the mean value into a vector with missing values — impute_mean","text":"","code":"impute_mean(x)  # S3 method for default impute_mean(x)  # S3 method for factor impute_mean(x)"},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute the mean value into a vector with missing values — impute_mean","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute the mean value into a vector with missing values — impute_mean","text":"vector mean values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute the mean value into a vector with missing values — impute_mean","text":"","code":"library(dplyr) vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_mean(vec) #>  [1]  0.5301633  0.7462801  1.3446716  0.5301633 -0.4860343  0.8088018 #>  [7]  0.3218633  0.0581052  0.5301633  0.9174552  dat <- tibble(   num = rnorm(10),   int = as.integer(rpois(10, 5)),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>       num   int fct   #>        #>  1 NA         7 A     #>  2  1.35     NA B     #>  3 NA         4 C     #>  4  0.590     4 NA    #>  5  1.23      5 E     #>  6 -1.42     NA F     #>  7 -1.04      9 NA    #>  8  1.28      3 H     #>  9 -1.31      7 I     #> 10  1.60      6 J      dat %>%   nabular() %>%   mutate(     num = impute_mean(num),     int = impute_mean(int),     fct = impute_mean(fct),   ) #> # A tibble: 10 × 6 #>       num   int fct   num_NA int_NA fct_NA #>              #>  1  0.285  7    A     NA     !NA    !NA    #>  2  1.35   5.62 B     !NA    NA     !NA    #>  3  0.285  4    C     NA     !NA    !NA    #>  4  0.590  4    J     !NA    !NA    NA     #>  5  1.23   5    E     !NA    !NA    !NA    #>  6 -1.42   5.62 F     !NA    NA     !NA    #>  7 -1.04   9    J     !NA    !NA    NA     #>  8  1.28   3    H     !NA    !NA    !NA    #>  9 -1.31   7    I     !NA    !NA    !NA    #> 10  1.60   6    J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       where(is.numeric),       impute_mean     )   ) #> # A tibble: 10 × 6 #>       num   int fct   num_NA int_NA fct_NA #>              #>  1  0.285  7    A     NA     !NA    !NA    #>  2  1.35   5.62 B     !NA    NA     !NA    #>  3  0.285  4    C     NA     !NA    !NA    #>  4  0.590  4    NA    !NA    !NA    NA     #>  5  1.23   5    E     !NA    !NA    !NA    #>  6 -1.42   5.62 F     !NA    NA     !NA    #>  7 -1.04   9    NA    !NA    !NA    NA     #>  8  1.28   3    H     !NA    !NA    !NA    #>  9 -1.31   7    I     !NA    !NA    !NA    #> 10  1.60   6    J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       c(\"num\", \"int\"),       impute_mean     )   ) #> # A tibble: 10 × 6 #>       num   int fct   num_NA int_NA fct_NA #>              #>  1  0.285  7    A     NA     !NA    !NA    #>  2  1.35   5.62 B     !NA    NA     !NA    #>  3  0.285  4    C     NA     !NA    !NA    #>  4  0.590  4    NA    !NA    !NA    NA     #>  5  1.23   5    E     !NA    !NA    !NA    #>  6 -1.42   5.62 F     !NA    NA     !NA    #>  7 -1.04   9    NA    !NA    !NA    NA     #>  8  1.28   3    H     !NA    !NA    !NA    #>  9 -1.31   7    I     !NA    !NA    !NA    #> 10  1.60   6    J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute the median value into a vector with missing values — impute_median","title":"Impute the median value into a vector with missing values — impute_median","text":"Impute median value vector missing values","code":""},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute the median value into a vector with missing values — impute_median","text":"","code":"impute_median(x)  # S3 method for default impute_median(x)  # S3 method for factor impute_median(x)"},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute the median value into a vector with missing values — impute_median","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute the median value into a vector with missing values — impute_median","text":"vector median values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_median.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute the median value into a vector with missing values — impute_median","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_median(vec) #>  [1] -0.7289445 -0.9342655 -1.2804352 -0.3857275 -0.3857275  0.2674186 #>  [7] -0.3857275 -0.1630526  0.2793086 -0.3857275  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = as.integer(rpois(10, 5)),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1  0.449      8 A     #>  2 -0.306      6 B     #>  3 -0.0124    11 C     #>  4 -1.09       6 D     #>  5 NA          3 NA    #>  6 -0.0466     4 F     #>  7 -1.44      NA G     #>  8 NA          5 H     #>  9 -0.397     NA NA    #> 10  0.664      3 J      dat %>%   nabular() %>%   mutate(     num = impute_median(num),     int = impute_median(int),   ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1  0.449    8   A     !NA    !NA    !NA    #>  2 -0.306    6   B     !NA    !NA    !NA    #>  3 -0.0124  11   C     !NA    !NA    !NA    #>  4 -1.09     6   D     !NA    !NA    !NA    #>  5 -0.177    3   NA    NA     !NA    NA     #>  6 -0.0466   4   F     !NA    !NA    !NA    #>  7 -1.44     5.5 G     !NA    NA     !NA    #>  8 -0.177    5   H     NA     !NA    !NA    #>  9 -0.397    5.5 NA    !NA    NA     NA     #> 10  0.664    3   J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       where(is.numeric),       impute_median     )   ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1  0.449    8   A     !NA    !NA    !NA    #>  2 -0.306    6   B     !NA    !NA    !NA    #>  3 -0.0124  11   C     !NA    !NA    !NA    #>  4 -1.09     6   D     !NA    !NA    !NA    #>  5 -0.177    3   NA    NA     !NA    NA     #>  6 -0.0466   4   F     !NA    !NA    !NA    #>  7 -1.44     5.5 G     !NA    NA     !NA    #>  8 -0.177    5   H     NA     !NA    !NA    #>  9 -0.397    5.5 NA    !NA    NA     NA     #> 10  0.664    3   J     !NA    !NA    !NA     dat %>%   nabular() %>%   mutate(     across(       c(\"num\", \"int\"),       impute_median     )  ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1  0.449    8   A     !NA    !NA    !NA    #>  2 -0.306    6   B     !NA    !NA    !NA    #>  3 -0.0124  11   C     !NA    !NA    !NA    #>  4 -1.09     6   D     !NA    !NA    !NA    #>  5 -0.177    3   NA    NA     !NA    NA     #>  6 -0.0466   4   F     !NA    !NA    !NA    #>  7 -1.44     5.5 G     !NA    NA     !NA    #>  8 -0.177    5   H     NA     !NA    !NA    #>  9 -0.397    5.5 NA    !NA    NA     NA     #> 10  0.664    3   J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute the mode value into a vector with missing values — impute_mode","title":"Impute the mode value into a vector with missing values — impute_mode","text":"Impute mode value vector missing values","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute the mode value into a vector with missing values — impute_mode","text":"","code":"impute_mode(x)  # S3 method for default impute_mode(x)  # S3 method for integer impute_mode(x)  # S3 method for factor impute_mode(x)"},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute the mode value into a vector with missing values — impute_mode","text":"x vector approach adapts examples provided stack overflow, integer case, just rounds value. can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute the mode value into a vector with missing values — impute_mode","text":"vector mode values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_mode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute the mode value into a vector with missing values — impute_mode","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  impute_mode(vec) #>  [1]  1.371914294  0.413380638 -1.669939609  0.069016915  0.069016915 #>  [6] -1.158660464  0.001326548 -1.771324596  0.018509032  0.069016915  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>        num   int fct   #>         #>  1 -0.100      6 A     #>  2 -0.342      4 B     #>  3 -0.108     NA C     #>  4  1.51       6 D     #>  5  0.202     10 NA    #>  6  2.26       3 F     #>  7 NA         NA NA    #>  8 -1.30       8 H     #>  9 NA          6 I     #> 10 -0.0709     3 J       dat %>%   nabular() %>%   mutate(     num = impute_mode(num),     int = impute_mode(int),     fct = impute_mode(fct)   ) #> # A tibble: 10 × 6 #>        num   int fct   num_NA int_NA fct_NA #>               #>  1 -0.100      6 A     !NA    !NA    !NA    #>  2 -0.342      4 B     !NA    !NA    !NA    #>  3 -0.108      6 C     !NA    NA     !NA    #>  4  1.51       6 D     !NA    !NA    !NA    #>  5  0.202     10 B     !NA    !NA    NA     #>  6  2.26       3 F     !NA    !NA    !NA    #>  7 -0.0964     6 B     NA     NA     NA     #>  8 -1.30       8 H     !NA    !NA    !NA    #>  9 -0.0964     6 I     NA     !NA    !NA    #> 10 -0.0709     3 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute zero into a vector with missing values — impute_zero","title":"Impute zero into a vector with missing values — impute_zero","text":"can useful imputing specific values, however generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm().","code":""},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute zero into a vector with missing values — impute_zero","text":"","code":"impute_zero(x)"},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute zero into a vector with missing values — impute_zero","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute zero into a vector with missing values — impute_zero","text":"vector fixed values replaced","code":""},{"path":"http://naniar.njtierney.com/reference/impute_zero.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute zero into a vector with missing values — impute_zero","text":"","code":"vec <- rnorm(10)  vec[sample(1:10, 3)] <- NA  vec #>  [1]          NA -0.25705805 -1.41422789  0.01887104  0.35647301  0.89006961 #>  [7]          NA          NA  0.43744452 -1.65606748  impute_zero(vec) #>  [1]  0.00000000 -0.25705805 -1.41422789  0.01887104  0.35647301  0.89006961 #>  [7]  0.00000000  0.00000000  0.43744452 -1.65606748  library(dplyr)  dat <- tibble(   num = rnorm(10),   int = rpois(10, 5),   fct = factor(LETTERS[1:10]) ) %>%   mutate(     across(       everything(),       \\(x) set_prop_miss(x, prop = 0.25)     )   )  dat #> # A tibble: 10 × 3 #>       num   int fct   #>        #>  1 -1.30      5 A     #>  2  2.19      3 B     #>  3 -0.303    NA C     #>  4  1.36      2 NA    #>  5 -0.744     5 E     #>  6 NA         6 NA    #>  7  1.76      7 G     #>  8  0.724    NA H     #>  9 NA         3 I     #> 10  1.38      7 J      dat %>%   nabular() %>%   mutate(     num = impute_fixed(num, -9999),     int = impute_zero(int),     fct = impute_factor(fct, \"out\")   ) #> # A tibble: 10 × 6 #>          num   int fct   num_NA int_NA fct_NA #>                 #>  1    -1.30      5 A     !NA    !NA    !NA    #>  2     2.19      3 B     !NA    !NA    !NA    #>  3    -0.303     0 C     !NA    NA     !NA    #>  4     1.36      2 out   !NA    !NA    NA     #>  5    -0.744     5 E     !NA    !NA    !NA    #>  6 -9999         6 out   NA     !NA    NA     #>  7     1.76      7 G     !NA    !NA    !NA    #>  8     0.724     0 H     !NA    NA     !NA    #>  9 -9999         3 I     NA     !NA    !NA    #> 10     1.38      7 J     !NA    !NA    !NA"},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect if this is a shade — is_shade","title":"Detect if this is a shade — is_shade","text":"tells us column shade","code":""},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect if this is a shade — is_shade","text":"","code":"is_shade(x)  are_shade(x)  any_shade(x)"},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect if this is a shade — is_shade","text":"x vector want test shade","code":""},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect if this is a shade — is_shade","text":"logical - shade?","code":""},{"path":"http://naniar.njtierney.com/reference/is_shade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect if this is a shade — is_shade","text":"","code":"xs <- shade(c(NA, 1, 2, \"3\"))  is_shade(xs) #> [1] TRUE are_shade(xs) #> [1] TRUE TRUE TRUE TRUE any_shade(xs) #> [1] TRUE  aq_s <- as_shadow(airquality)  is_shade(aq_s) #> [1] FALSE are_shade(aq_s) #>   Ozone_NA Solar.R_NA    Wind_NA    Temp_NA   Month_NA     Day_NA  #>       TRUE       TRUE       TRUE       TRUE       TRUE       TRUE  any_shade(aq_s) #> [1] TRUE any_shade(airquality) #> [1] FALSE"},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":null,"dir":"Reference","previous_headings":"","what":"Label a missing from one column — label_miss_1d","title":"Label a missing from one column — label_miss_1d","text":"Label whether value missing row one columns.","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Label a missing from one column — label_miss_1d","text":"","code":"label_miss_1d(x1)"},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Label a missing from one column — label_miss_1d","text":"x1 variable dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Label a missing from one column — label_miss_1d","text":"vector indicating whether rows missing values","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Label a missing from one column — label_miss_1d","text":"can generalise label_miss work number variables?","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/label_miss_1d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Label a missing from one column — label_miss_1d","text":"","code":"label_miss_1d(airquality$Ozone) #>   [1] Not Missing Not Missing Not Missing Not Missing Missing     Not Missing #>   [7] Not Missing Not Missing Not Missing Missing     Not Missing Not Missing #>  [13] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [19] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [25] Missing     Missing     Missing     Not Missing Not Missing Not Missing #>  [31] Not Missing Missing     Missing     Missing     Missing     Missing     #>  [37] Missing     Not Missing Missing     Not Missing Not Missing Missing     #>  [43] Missing     Not Missing Missing     Missing     Not Missing Not Missing #>  [49] Not Missing Not Missing Not Missing Missing     Missing     Missing     #>  [55] Missing     Missing     Missing     Missing     Missing     Missing     #>  [61] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #>  [67] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #>  [73] Not Missing Not Missing Missing     Not Missing Not Missing Not Missing #>  [79] Not Missing Not Missing Not Missing Not Missing Missing     Missing     #>  [85] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [91] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [97] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #> [103] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [109] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [115] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [121] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [127] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [133] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [139] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [145] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #> [151] Not Missing Not Missing Not Missing #> Levels: Missing Not Missing"},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":null,"dir":"Reference","previous_headings":"","what":"label_miss_2d — label_miss_2d","title":"label_miss_2d — label_miss_2d","text":"Label whether value missing either row two columns.","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"label_miss_2d — label_miss_2d","text":"","code":"label_miss_2d(x1, x2)"},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"label_miss_2d — label_miss_2d","text":"x1 variable dataframe x2 another variable dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"label_miss_2d — label_miss_2d","text":"vector indicating whether rows missing values","code":""},{"path":"http://naniar.njtierney.com/reference/label_miss_2d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"label_miss_2d — label_miss_2d","text":"","code":"label_miss_2d(airquality$Ozone, airquality$Solar.R) #>   [1] Not Missing Not Missing Not Missing Not Missing Missing     Missing     #>   [7] Not Missing Not Missing Not Missing Missing     Missing     Not Missing #>  [13] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [19] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [25] Missing     Missing     Missing     Not Missing Not Missing Not Missing #>  [31] Not Missing Missing     Missing     Missing     Missing     Missing     #>  [37] Missing     Not Missing Missing     Not Missing Not Missing Missing     #>  [43] Missing     Not Missing Missing     Missing     Not Missing Not Missing #>  [49] Not Missing Not Missing Not Missing Missing     Missing     Missing     #>  [55] Missing     Missing     Missing     Missing     Missing     Missing     #>  [61] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #>  [67] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #>  [73] Not Missing Not Missing Missing     Not Missing Not Missing Not Missing #>  [79] Not Missing Not Missing Not Missing Not Missing Missing     Missing     #>  [85] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #>  [91] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #>  [97] Missing     Missing     Not Missing Not Missing Not Missing Missing     #> [103] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [109] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [115] Missing     Not Missing Not Missing Not Missing Missing     Not Missing #> [121] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [127] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [133] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [139] Not Missing Not Missing Not Missing Not Missing Not Missing Not Missing #> [145] Not Missing Not Missing Not Missing Not Missing Not Missing Missing     #> [151] Not Missing Not Missing Not Missing #> Levels: Missing Not Missing"},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":null,"dir":"Reference","previous_headings":"","what":"Is there a missing value in the row of a dataframe? — label_missings","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"Creates character vector describing presence/absence missing values","code":""},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"","code":"label_missings(data, ..., missing = \"Missing\", complete = \"Not Missing\")"},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"data dataframe set vectors length ... extra variable label missing character label values missing - defaults \"Missing\" complete character character label values complete - defaults \"Missing\"","code":""},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"character vector \"Missing\" \"Missing\".","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/label_missings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is there a missing value in the row of a dataframe? — label_missings","text":"","code":"label_missings(airquality) #>   [1] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>   [6] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [11] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [16] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [21] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [26] \"Missing\"     \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [31] \"Not Missing\" \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     #>  [36] \"Missing\"     \"Missing\"     \"Not Missing\" \"Missing\"     \"Not Missing\" #>  [41] \"Not Missing\" \"Missing\"     \"Missing\"     \"Not Missing\" \"Missing\"     #>  [46] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [51] \"Not Missing\" \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     #>  [56] \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     \"Missing\"     #>  [61] \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [66] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [71] \"Not Missing\" \"Missing\"     \"Not Missing\" \"Not Missing\" \"Missing\"     #>  [76] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [81] \"Not Missing\" \"Not Missing\" \"Missing\"     \"Missing\"     \"Not Missing\" #>  [86] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [91] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #>  [96] \"Missing\"     \"Missing\"     \"Missing\"     \"Not Missing\" \"Not Missing\" #> [101] \"Not Missing\" \"Missing\"     \"Missing\"     \"Not Missing\" \"Not Missing\" #> [106] \"Not Missing\" \"Missing\"     \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [111] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #> [116] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     \"Not Missing\" #> [121] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [126] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [131] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [136] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [141] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" #> [146] \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Not Missing\" \"Missing\"     #> [151] \"Not Missing\" \"Not Missing\" \"Not Missing\"  if (FALSE) { library(dplyr)  airquality %>%   mutate(is_missing = label_missings(airquality)) %>%   head()  airquality %>%   mutate(is_missing = label_missings(airquality,                                      missing = \"definitely missing\",                                      complete = \"absolutely complete\")) %>%   head() }"},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":null,"dir":"Reference","previous_headings":"","what":"Little's missing completely at random (MCAR) test — mcar_test","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Use Little's (1988) test statistic assess data missing completely random (MCAR). null hypothesis test data MCAR, test statistic chi-squared value. example shows output mcar_test(airquality). Given high statistic value low p-value, can conclude airquality data missing completely random.","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"","code":"mcar_test(data)"},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"data data frame","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"tibble::tibble() one row four columns: statistic Chi-squared statistic Little's test df Degrees freedom used chi-squared statistic p.value P-value chi-squared statistic missing.patterns Number missing data patterns data","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Code adapted LittleMCAR() now-orphaned BaylorEdPsych package: https://rdrr.io/cran/BaylorEdPsych/man/LittleMCAR.html. code adapted Eric Stemmler: https://web.archive.org/web/20201120030409/https://stats-bayes.com/post/2020/08/14/r-function--little-s-test--data-missing-completely--random/ using Maximum likelihood estimation norm.","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Little, Roderick J. . 1988. \"Test Missing Completely Random Multivariate Data Missing Values.\" Journal American Statistical Association 83 (404): 1198--1202. doi:10.1080/01621459.1988.10478722 .","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"Andrew Heiss, andrew@andrewheiss.com","code":""},{"path":"http://naniar.njtierney.com/reference/mcar_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Little's missing completely at random (MCAR) test — mcar_test","text":"","code":"mcar_test(airquality) #> # A tibble: 1 × 4 #>   statistic    df p.value missing.patterns #>                        #> 1      35.1    14 0.00142                4 mcar_test(oceanbuoys) #> # A tibble: 1 × 4 #>   statistic    df p.value missing.patterns #>                        #> 1      747.    31       0                6  # If there are non-numeric columns, there will be a warning mcar_test(riskfactors) #> Warning: NAs introduced by coercion to integer range #> # A tibble: 1 × 4 #>   statistic    df  p.value missing.patterns #>                         #> 1     1741.  1319 3.32e-14               48"},{"path":"http://naniar.njtierney.com/reference/miss-pct-prop-defunct.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","title":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","text":"Defunct. Please see prop_miss_var(), prop_complete_var(), pct_miss_var(), pct_complete_var(), prop_miss_case(), prop_complete_case(), pct_miss_case(), pct_complete_case().","code":""},{"path":"http://naniar.njtierney.com/reference/miss-pct-prop-defunct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","text":"","code":"miss_var_prop(...)  complete_var_prop(...)  miss_var_pct(...)  complete_var_pct(...)  miss_case_prop(...)  complete_case_prop(...)  miss_case_pct(...)  complete_case_pct(...)"},{"path":"http://naniar.njtierney.com/reference/miss-pct-prop-defunct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportion of variables containing missings or complete values — miss-pct-prop-defunct","text":"... arguments","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the missingness in each case — miss_case_cumsum","title":"Summarise the missingness in each case — miss_case_cumsum","text":"Provide data.frame containing case (row), number percent missing values case.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the missingness in each case — miss_case_cumsum","text":"","code":"miss_case_cumsum(data)"},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the missingness in each case — miss_case_cumsum","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the missingness in each case — miss_case_cumsum","text":"tibble containing number percent missing data case","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the missingness in each case — miss_case_cumsum","text":"","code":"miss_case_cumsum(airquality) #> Warning: `miss_case_cumsum()` was deprecated in naniar 1.1.0. #> ℹ Please use `miss_var_summary(data, add_cumsum = TRUE)` #> # A tibble: 153 × 3 #>     case n_miss n_miss_cumsum #>                #>  1     1      0             0 #>  2     2      0             0 #>  3     3      0             0 #>  4     4      0             0 #>  5     5      2             2 #>  6     6      1             3 #>  7     7      0             3 #>  8     8      0             3 #>  9     9      0             3 #> 10    10      1             4 #> # ℹ 143 more rows  if (FALSE) { library(dplyr)  airquality %>%   group_by(Month) %>%   miss_case_cumsum() }"},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the missingness in each case — miss_case_summary","title":"Summarise the missingness in each case — miss_case_summary","text":"Provide summary case data number, percent missings, cumulative sum missings order variables. default, orders missings variable.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the missingness in each case — miss_case_summary","text":"","code":"miss_case_summary(data, order = TRUE, add_cumsum = FALSE, ...)"},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the missingness in each case — miss_case_summary","text":"data data.frame order logical indicating whether order result n_miss. Defaults TRUE. FALSE, order cases order input. add_cumsum logical indicating whether add cumulative sum missings data. can useful exploring patterns nonresponse. calculated cumulative sum missings variables first presented function. ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the missingness in each case — miss_case_summary","text":"tibble percent missing data case.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_case_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the missingness in each case — miss_case_summary","text":"","code":"miss_case_summary(airquality) #> # A tibble: 153 × 3 #>     case n_miss pct_miss #>           #>  1     5      2     33.3 #>  2    27      2     33.3 #>  3     6      1     16.7 #>  4    10      1     16.7 #>  5    11      1     16.7 #>  6    25      1     16.7 #>  7    26      1     16.7 #>  8    32      1     16.7 #>  9    33      1     16.7 #> 10    34      1     16.7 #> # ℹ 143 more rows  if (FALSE) { # works with group_by from dplyr library(dplyr) airquality %>%   group_by(Month) %>%   miss_case_summary() }"},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Tabulate missings in cases. — miss_case_table","title":"Tabulate missings in cases. — miss_case_table","text":"Provide tidy table number cases 0, 1, 2, n, missing values proportion number cases cases make .","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tabulate missings in cases. — miss_case_table","text":"","code":"miss_case_table(data)"},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tabulate missings in cases. — miss_case_table","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tabulate missings in cases. — miss_case_table","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_case_table.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tabulate missings in cases. — miss_case_table","text":"","code":"miss_case_table(airquality) #> # A tibble: 3 × 3 #>   n_miss_in_case n_cases pct_cases #>                     #> 1              0     111     72.5  #> 2              1      40     26.1  #> 3              2       2      1.31 if (FALSE) { library(dplyr) airquality %>%   group_by(Month) %>%   miss_case_table() }"},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportions of missings in data, variables, and cases. — miss_prop_summary","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"Return missing data info dataframe, variables, cases. Specifically, returning many elements dataframe contain missing value, many elements variable contain missing value, many elements case contain missing.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"","code":"miss_prop_summary(data)"},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_prop_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Proportions of missings in data, variables, and cases. — miss_prop_summary","text":"","code":"miss_prop_summary(airquality) #> # A tibble: 1 × 3 #>       df   var  case #>       #> 1 0.0479 0.333 0.275 if (FALSE) { library(dplyr) # respects dplyr::group_by airquality %>% group_by(Month) %>% miss_prop_summary() }"},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":null,"dir":"Reference","previous_headings":"","what":"Search and present different kinds of missing values — miss_scan_count","title":"Search and present different kinds of missing values — miss_scan_count","text":"Searching different kinds missing values really annoying. values like -99 data, , encoded missing, can difficult ascertain , , . miss_scan_count makes easier users search particular occurrences values across variables. Note searches done regular expressions, special ways searching text. See example see look characters like ?.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Search and present different kinds of missing values — miss_scan_count","text":"","code":"miss_scan_count(data, search)"},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Search and present different kinds of missing values — miss_scan_count","text":"data data search values search ","code":""},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Search and present different kinds of missing values — miss_scan_count","text":"dataframe occurrences values searched ","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_scan_count.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Search and present different kinds of missing values — miss_scan_count","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,  ~specials,                          1,   \"A\",   -100, \"?\",                          3,   \"N/A\", -99,  \"!\",                          NA,  NA,    -98,  \".\",                          -99, \"E\",   -101, \"*\",                          -98, \"F\",   -1,  \"-\")  miss_scan_count(dat_ms,-99) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            1 #> 2 y            0 #> 3 z            1 #> 4 specials     0 miss_scan_count(dat_ms,c(-99,-98)) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            0 #> 3 z            2 #> 4 specials     0 miss_scan_count(dat_ms,c(\"-99\",\"-98\",\"N/A\")) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            1 #> 3 z            2 #> 4 specials     0 miss_scan_count(dat_ms, \"\\\\?\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"\\\\!\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"\\\\.\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"\\\\*\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            0 #> 2 y            0 #> 3 z            0 #> 4 specials     1 miss_scan_count(dat_ms, \"-\") #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            2 #> 2 y            0 #> 3 z            5 #> 4 specials     1 miss_scan_count(dat_ms,common_na_strings) #> # A tibble: 4 × 2 #>   Variable     n #>        #> 1 x            4 #> 2 y            4 #> 3 z            5 #> 4 specials     5"},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Collate summary measures from naniar into one tibble — miss_summary","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"miss_summary performs missing data helper summaries puts lists within tibble","code":""},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"","code":"miss_summary(data, order = TRUE)"},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"data dataframe order whether order result n_miss","code":""},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"tibble missing data summaries","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collate summary measures from naniar into one tibble — miss_summary","text":"","code":"s_miss <- miss_summary(airquality) s_miss$miss_df_prop #> [1] 0.04793028 s_miss$miss_case_table #> [[1]] #> # A tibble: 3 × 3 #>   n_miss_in_case n_cases pct_cases #>                     #> 1              0     111     72.5  #> 2              1      40     26.1  #> 3              2       2      1.31 #>  s_miss$miss_var_summary #> [[1]] #> # A tibble: 6 × 3 #>   variable n_miss pct_miss #>             #> 1 Ozone        37    24.2  #> 2 Solar.R       7     4.58 #> 3 Wind          0     0    #> 4 Temp          0     0    #> 5 Month         0     0    #> 6 Day           0     0    #>  # etc, etc, etc.  if (FALSE) { library(dplyr) s_miss_group <- group_by(airquality, Month) %>% miss_summary() s_miss_group$miss_df_prop s_miss_group$miss_case_table # etc, etc, etc. }"},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":null,"dir":"Reference","previous_headings":"","what":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"Calculate cumulative sum number & percentage missingness variable.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"","code":"miss_var_cumsum(data)"},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"tibble cumulative sum missing data variable","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_cumsum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cumulative sum of the number of missings in each variable — miss_var_cumsum","text":"","code":"miss_var_cumsum(airquality) #> Warning: `miss_var_cumsum()` was deprecated in naniar 1.1.0. #> ℹ Please use `miss_var_summary(data, add_cumsum = TRUE)` #> # A tibble: 6 × 3 #>   variable n_miss n_miss_cumsum #>                  #> 1 Ozone        37            37 #> 2 Solar.R       7            44 #> 3 Wind          0            44 #> 4 Temp          0            44 #> 5 Month         0            44 #> 6 Day           0            44 if (FALSE) { library(dplyr)  # respects dplyr::group_by  airquality %>%   group_by(Month) %>%   miss_var_cumsum() }"},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the number of missing and complete values in a single run — miss_var_run","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"us useful find number missing values occur single run. function, miss_var_run(), returns dataframe column names \"run_length\" \"is_na\", describe length run, whether run describes missing value.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"","code":"miss_var_run(data, var)"},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"data data.frame var bare variable name","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"dataframe column names \"run_length\" \"is_na\", describe length run, whether run describes missing value.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_run.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find the number of missing and complete values in a single run — miss_var_run","text":"","code":"miss_var_run(pedestrian, hourly_counts) #> # A tibble: 35 × 2 #>    run_length is_na    #>              #>  1       6628 complete #>  2          1 missing  #>  3       5250 complete #>  4        624 missing  #>  5       3652 complete #>  6          1 missing  #>  7       1290 complete #>  8        744 missing  #>  9       7420 complete #> 10          1 missing  #> # ℹ 25 more rows  if (FALSE) { # find the number of runs missing/complete for each month library(dplyr)   pedestrian %>%   group_by(month) %>%   miss_var_run(hourly_counts)  library(ggplot2)  # explore the number of missings in a given run miss_var_run(pedestrian, hourly_counts) %>%   filter(is_na == \"missing\") %>%   count(run_length) %>%   ggplot(aes(x = run_length,              y = n)) +       geom_col()  # look at the number of missing values and the run length of these. miss_var_run(pedestrian, hourly_counts) %>%   ggplot(aes(x = is_na,              y = run_length)) +       geom_boxplot()  # using group_by  pedestrian %>%    group_by(month) %>%    miss_var_run(hourly_counts) }"},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"summarise missing values time series object can useful calculate number missing values given time period. miss_var_span takes data.frame object, variable, span_every argument returns dataframe containing number missing values within span. number observations perfect multiple span length, final span whatever last remainder . example, pedestrian dataset 37,700 rows. span set 4000, 1700 rows remaining. can provided using modulo (%%): nrow(data) %% 4000. remainder number provided n_in_span.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"","code":"miss_var_span(data, var, span_every)"},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"data data.frame var bare unquoted variable name interest. span_every integer describing length span explored","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"dataframe variables n_miss, n_complete, prop_miss, prop_complete, describe number, proportion missing complete values within given time span. final variable, n_in_span states many observations span.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_span.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the number of missings for a given repeating span on a variable — miss_var_span","text":"","code":"miss_var_span(data = pedestrian,              var = hourly_counts,              span_every = 168) #> # A tibble: 225 × 6 #>    span_counter n_miss n_complete prop_miss prop_complete n_in_span #>                                       #>  1            1      0        168         0             1       168 #>  2            2      0        168         0             1       168 #>  3            3      0        168         0             1       168 #>  4            4      0        168         0             1       168 #>  5            5      0        168         0             1       168 #>  6            6      0        168         0             1       168 #>  7            7      0        168         0             1       168 #>  8            8      0        168         0             1       168 #>  9            9      0        168         0             1       168 #> 10           10      0        168         0             1       168 #> # ℹ 215 more rows  if (FALSE) {  library(dplyr)  pedestrian %>%    group_by(month) %>%      miss_var_span(var = hourly_counts,                    span_every = 168) }"},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise the missingness in each variable — miss_var_summary","title":"Summarise the missingness in each variable — miss_var_summary","text":"Provide summary variable number, percent missings, cumulative sum missings order variables. default, orders missings variable.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise the missingness in each variable — miss_var_summary","text":"","code":"miss_var_summary(data, order = FALSE, add_cumsum = FALSE, digits, ...)"},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise the missingness in each variable — miss_var_summary","text":"data data.frame order logical indicating whether order result n_miss. Defaults TRUE. FALSE, order variables order input. add_cumsum logical indicating whether add cumulative sum missings data. can useful exploring patterns nonresponse. calculated cumulative sum missings variables first presented function. digits many digits display pct_miss column. Useful working small amounts missing data. ... extra arguments","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise the missingness in each variable — miss_var_summary","text":"tibble percent missing data variable","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Summarise the missingness in each variable — miss_var_summary","text":"n_miss_cumsum calculated cumulative sum missings variables order given data entering function","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise the missingness in each variable — miss_var_summary","text":"","code":"miss_var_summary(airquality) #> # A tibble: 6 × 3 #>   variable n_miss pct_miss #>             #> 1 Ozone        37    24.2  #> 2 Solar.R       7     4.58 #> 3 Wind          0     0    #> 4 Temp          0     0    #> 5 Month         0     0    #> 6 Day           0     0    miss_var_summary(oceanbuoys, order = TRUE) #> # A tibble: 8 × 3 #>   variable   n_miss pct_miss #>               #> 1 humidity       93   12.6   #> 2 air_temp_c     81   11.0   #> 3 sea_temp_c      3    0.408 #> 4 year            0    0     #> 5 latitude        0    0     #> 6 longitude       0    0     #> 7 wind_ew         0    0     #> 8 wind_ns         0    0      if (FALSE) { # works with group_by from dplyr library(dplyr) airquality %>%   group_by(Month) %>%   miss_var_summary() }"},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Tabulate the missings in the variables — miss_var_table","title":"Tabulate the missings in the variables — miss_var_table","text":"Provide tidy table number variables 0, 1, 2, n, missing values proportion number variables variables make .","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tabulate the missings in the variables — miss_var_table","text":"","code":"miss_var_table(data)"},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tabulate the missings in the variables — miss_var_table","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tabulate the missings in the variables — miss_var_table","text":"dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/miss_var_table.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tabulate the missings in the variables — miss_var_table","text":"","code":"miss_var_table(airquality) #> # A tibble: 3 × 3 #>   n_miss_in_var n_vars pct_vars #>                  #> 1             0      4     66.7 #> 2             7      1     16.7 #> 3            37      1     16.7 if (FALSE) { library(dplyr) airquality %>%   group_by(Month) %>%   miss_var_table() }"},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":null,"dir":"Reference","previous_headings":"","what":"Which variables contain missing values? — miss_var_which","title":"Which variables contain missing values? — miss_var_which","text":"can helpful writing functions just return names variables contain missing values. miss_var_which returns vector variable names contain missings. return NULL missings.","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which variables contain missing values? — miss_var_which","text":"","code":"miss_var_which(data)"},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which variables contain missing values? — miss_var_which","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which variables contain missing values? — miss_var_which","text":"character vector variable names","code":""},{"path":"http://naniar.njtierney.com/reference/miss_var_which.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which variables contain missing values? — miss_var_which","text":"","code":"miss_var_which(airquality) #> [1] \"Ozone\"   \"Solar.R\"  miss_var_which(mtcars) #> NULL"},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":null,"dir":"Reference","previous_headings":"","what":"The number of variables with complete values — n-var-case-complete","title":"The number of variables with complete values — n-var-case-complete","text":"function calculates number variables contain complete value","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The number of variables with complete values — n-var-case-complete","text":"","code":"n_var_complete(data)  n_case_complete(data)"},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The number of variables with complete values — n-var-case-complete","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The number of variables with complete values — n-var-case-complete","text":"integer number complete values","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n-var-case-complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The number of variables with complete values — n-var-case-complete","text":"","code":"# how many variables contain complete values? n_var_complete(airquality) #> [1] 4 n_case_complete(airquality) #> [1] 111"},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":null,"dir":"Reference","previous_headings":"","what":"The number of variables or cases with missing values — n-var-case-miss","title":"The number of variables or cases with missing values — n-var-case-miss","text":"function calculates number variables cases contain missing value","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The number of variables or cases with missing values — n-var-case-miss","text":"","code":"n_var_miss(data)  n_case_miss(data)"},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The number of variables or cases with missing values — n-var-case-miss","text":"data data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The number of variables or cases with missing values — n-var-case-miss","text":"integer, number missings","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n-var-case-miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The number of variables or cases with missing values — n-var-case-miss","text":"","code":"# how many variables contain missing values? n_var_miss(airquality) #> [1] 2 n_case_miss(airquality) #> [1] 42"},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the number of complete values — n_complete","title":"Return the number of complete values — n_complete","text":"complement n_miss","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the number of complete values — n_complete","text":"","code":"n_complete(x)"},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the number of complete values — n_complete","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the number of complete values — n_complete","text":"numeric number complete values","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the number of complete values — n_complete","text":"","code":"n_complete(airquality) #> [1] 874 n_complete(airquality$Ozone) #> [1] 116"},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the number of complete values in each row — n_complete_row","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"Substitute rowSums(!.na(data)) also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"","code":"n_complete_row(data)"},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"numeric vector number complete values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n_complete_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the number of complete values in each row — n_complete_row","text":"","code":"n_complete_row(airquality) #>   [1] 6 6 6 6 4 5 6 6 6 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 4 6 6 6 6 5 5 5 5 5 5 #>  [38] 6 5 6 6 5 5 6 5 5 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 6 6 6 5 6 6 6 6 6 6 5 6 6 #>  [75] 5 6 6 6 6 6 6 6 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 6 6 6 5 5 6 6 6 5 6 6 6 6 #> [112] 6 6 6 5 6 6 6 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 #> [149] 6 5 6 6 6"},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the number of missing values — n_miss","title":"Return the number of missing values — n_miss","text":"Substitute sum(.na(data))","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the number of missing values — n_miss","text":"","code":"n_miss(x)"},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the number of missing values — n_miss","text":"x vector","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the number of missing values — n_miss","text":"numeric number missing values","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the number of missing values — n_miss","text":"","code":"n_miss(airquality) #> [1] 44 n_miss(airquality$Ozone) #> [1] 37"},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the number of missing values in each row — n_miss_row","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"Substitute rowSums(.na(data)), also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"","code":"n_miss_row(data)"},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"numeric vector number missing values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/n_miss_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the number of missing values in each row — n_miss_row","text":"","code":"n_miss_row(airquality) #>   [1] 0 0 0 0 2 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 0 0 0 0 1 1 1 1 1 1 #>  [38] 0 1 0 0 1 1 0 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 #>  [75] 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 #> [112] 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [149] 0 1 0 0 0"},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert data into nabular form by binding shade to it — nabular","title":"Convert data into nabular form by binding shade to it — nabular","text":"Binding shadow matrix regular dataframe converts nabular data, makes easier visualise work missing data.","code":""},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert data into nabular form by binding shade to it — nabular","text":"","code":"nabular(data, only_miss = FALSE, ...)"},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert data into nabular form by binding shade to it — nabular","text":"data dataframe only_miss logical - FALSE (default) bind dataframe variables duplicated shadow. Setting TRUE bind variables variables contain missing values. See examples details. ... extra options pass recode_shadow() - work progress.","code":""},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert data into nabular form by binding shade to it — nabular","text":"data added variable shifted suffix _NA","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/nabular.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert data into nabular form by binding shade to it — nabular","text":"","code":"aq_nab <- nabular(airquality) aq_s <- bind_shadow(airquality)  all.equal(aq_nab, aq_s) #> [1] TRUE"},{"path":"http://naniar.njtierney.com/reference/naniar-ggproto.html","id":null,"dir":"Reference","previous_headings":"","what":"naniar-ggproto — GeomMissPoint","title":"naniar-ggproto — GeomMissPoint","text":"stat geom overrides using ggproto ggplot2 make naniar work.","code":""},{"path":"http://naniar.njtierney.com/reference/naniar-ggproto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"naniar-ggproto — GeomMissPoint","text":"","code":"StatMissPoint"},{"path":"http://naniar.njtierney.com/reference/naniar-ggproto.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"naniar-ggproto — GeomMissPoint","text":"object class StatMissPoint (inherits Stat, ggproto, gg) length 6.","code":""},{"path":"http://naniar.njtierney.com/reference/naniar.html","id":null,"dir":"Reference","previous_headings":"","what":"naniar — naniar","title":"naniar — naniar","text":"naniar package make easier summarise handle missing values R. strives way consistent tidyverse principles possible.  work fully discussed Tierney & Cook (2023) doi:10.18637/jss.v105.i07.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/naniar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"naniar — naniar","text":"Maintainer: Nicholas Tierney nicholas.tierney@gmail.com (ORCID) Authors: Di Cook dicook@monash.edu (ORCID) Miles McBain miles.mcbain@gmail.com (ORCID) Colin Fay contact@colinfay.(ORCID) contributors: Mitchell O'Hara-Wild [contributor] Jim Hester james.f.hester@gmail.com [contributor] Luke Smith [contributor] Andrew Heiss andrew@andrewheiss.com (ORCID) [contributor]","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":null,"dir":"Reference","previous_headings":"","what":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"Real-time data moored ocean buoys improved detection, understanding prediction El Ni'o La Ni'. data collected Tropical Atmosphere Ocean project (https://www.pmel.noaa.gov/gtmba/pmel-theme/pacific-ocean-tao).","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"","code":"data(oceanbuoys)"},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"object class tbl_df (inherits tbl, data.frame) 736 rows 8 columns.","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"https://www.pmel.noaa.gov/tao/drupal/disdel/","code":""},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"Format: data frame 736 observations following 8 variables. year numeric levels 1993 1997. latitude numeric levels -5  -2 0. longitude numeric levels -110 -95. sea_temp_c Sea surface temperature(degree Celsius),  measured TAO buoys one meter surface. air_temp_c Air temperature(degree Celsius), measured TAO buoys three meters sea surface. humidity Relative humidity(%), measured TAO buoys 3 meters sea surface. wind_ew East-West wind vector components(M/s).  TAO buoys measure wind speed direction four meters sea surface. positive, East-West component wind blowing towards East. negative, component blowing towards West. wind_ns North-South wind vector components(M/s). TAO buoys measure wind speed direction four meters sea surface. positive, North-South component wind blowing towards North. negative, component blowing towards South.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/oceanbuoys.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"West Pacific Tropical Atmosphere Ocean Data, 1993 & 1997. — oceanbuoys","text":"","code":"vis_miss(oceanbuoys)   # Look at the missingness in the variables miss_var_summary(oceanbuoys) #> # A tibble: 8 × 3 #>   variable   n_miss pct_miss #>               #> 1 humidity       93   12.6   #> 2 air_temp_c     81   11.0   #> 3 sea_temp_c      3    0.408 #> 4 year            0    0     #> 5 latitude        0    0     #> 6 longitude       0    0     #> 7 wind_ew         0    0     #> 8 wind_ns         0    0     if (FALSE) { # Look at the missingness in air temperature and humidity library(ggplot2) p <- ggplot(oceanbuoys,        aes(x = air_temp_c,            y = humidity)) +      geom_miss_point()   p   # for each year?  p + facet_wrap(~year)   # this shows that there are more missing values in humidity in 1993, and  # more air temperature missing values in 1997   # see more examples in the vignette, \"getting started with naniar\". }"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":null,"dir":"Reference","previous_headings":"","what":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"Calculate percentage cases (rows) contain missing complete value.","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"","code":"pct_miss_case(data)  pct_complete_case(data)"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"numeric percentage cases contain missing complete value","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Percentage of cases that contain a missing or complete values. — pct-miss-complete-case","text":"","code":"pct_miss_case(airquality) #> [1] 27.45098 pct_complete_case(airquality) #> [1] 72.54902"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":null,"dir":"Reference","previous_headings":"","what":"Percentage of variables containing missings or complete values — pct-miss-complete-var","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"Calculate percentage variables contain single missing complete value.","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"","code":"pct_miss_var(data)  pct_complete_var(data)"},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"numeric percent variables contain missing complete data","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/pct-miss-complete-var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Percentage of variables containing missings or complete values — pct-miss-complete-var","text":"","code":"prop_miss_var(airquality) #> [1] 0.3333333 prop_complete_var(airquality) #> [1] 0.6666667"},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the percent of complete values — pct_complete","title":"Return the percent of complete values — pct_complete","text":"complement pct_miss","code":""},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the percent of complete values — pct_complete","text":"","code":"pct_complete(x)"},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the percent of complete values — pct_complete","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the percent of complete values — pct_complete","text":"numeric percent complete values","code":""},{"path":"http://naniar.njtierney.com/reference/pct_complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the percent of complete values — pct_complete","text":"","code":"pct_complete(airquality) #> [1] 95.20697 pct_complete(airquality$Ozone) #> [1] 75.81699"},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the percent of missing values — pct_miss","title":"Return the percent of missing values — pct_miss","text":"shorthand mean(.na(x)) * 100","code":""},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the percent of missing values — pct_miss","text":"","code":"pct_miss(x)"},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the percent of missing values — pct_miss","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the percent of missing values — pct_miss","text":"numeric percent missing values x","code":""},{"path":"http://naniar.njtierney.com/reference/pct_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the percent of missing values — pct_miss","text":"","code":"pct_miss(airquality) #> [1] 4.793028 pct_miss(airquality$Ozone) #> [1] 24.18301"},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":null,"dir":"Reference","previous_headings":"","what":"Pedestrian count information around Melbourne for 2016 — pedestrian","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"dataset contains hourly counts pedestrians 4 sensors around Melbourne: Birrarung Marr, Bourke Street Mall, Flagstaff station, Spencer St-Collins St (south), recorded January 1st 2016 00:00:00 December 31st 2016 23:00:00. data made free publicly available https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-monthly-counts-per-hour/information/","code":""},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"","code":"data(pedestrian)"},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"tibble 37,700 rows 9 variables: hourly_counts (integer) number pedestrians counted sensor time date_time (POSIXct, POSIXt) time count taken year (integer) Year record month (factor) Month record ordered factor (1 = January, 12 = December) month_day (integer) Full day month week_day (factor) Full day week ordered factor (1 = Sunday, 7 = Saturday) hour (integer) hour day 24 hour format sensor_id (integer) id sensor sensor_name (character) full name sensor","code":""},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-monthly-counts-per-hour/information/","code":""},{"path":"http://naniar.njtierney.com/reference/pedestrian.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pedestrian count information around Melbourne for 2016 — pedestrian","text":"","code":"# explore the missingness with vis_miss  vis_miss(pedestrian)   # Look at the missingness in the variables miss_var_summary(pedestrian) #> # A tibble: 9 × 3 #>   variable      n_miss pct_miss #>                  #> 1 hourly_counts   2548     6.76 #> 2 date_time          0     0    #> 3 year               0     0    #> 4 month              0     0    #> 5 month_day          0     0    #> 6 week_day           0     0    #> 7 hour               0     0    #> 8 sensor_id          0     0    #> 9 sensor_name        0     0     if (FALSE) { # There is only missingness in hourly_counts # Look at the missingness over a rolling window library(ggplot2) gg_miss_span(pedestrian, hourly_counts, span_every = 3000) }"},{"path":"http://naniar.njtierney.com/reference/plotly_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Plotly helpers (Convert a geom to a ","title":"Plotly helpers (Convert a geom to a ","text":"Helper functions make easier automatically create plotly charts. function makes possible convert ggplot2 geoms included ggplot2 . Users need use function. exists purely allow package authors write conversion method(s).","code":""},{"path":"http://naniar.njtierney.com/reference/plotly_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plotly helpers (Convert a geom to a ","text":"","code":"to_basic.GeomMissPoint(data, prestats_data, layout, params, p, ...)"},{"path":"http://naniar.njtierney.com/reference/plotly_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plotly helpers (Convert a geom to a ","text":"data data returned ggplot2::ggplot_build(). prestats_data data statistics computed. layout panel layout. params parameters geom, statistic, 'constant' aesthetics p ggplot2 object (conversion may depend scales, instance). ... currently ignored","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"Calculate proportion cases (rows) contain missing complete values.","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"","code":"prop_miss_case(data)  prop_complete_case(data)"},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"numeric proportion cases contain missing complete value","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Proportion of cases that contain a missing or complete values. — prop-miss-complete-case","text":"","code":"prop_miss_case(airquality) #> [1] 0.2745098 prop_complete_case(airquality) #> [1] 0.7254902"},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":null,"dir":"Reference","previous_headings":"","what":"Proportion of variables containing missings or complete values — prop-miss-complete-var","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"Calculate proportion variables contain single missing complete values.","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"","code":"prop_miss_var(data)  prop_complete_var(data)"},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"numeric proportion variables contain missing complete data","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop-miss-complete-var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Proportion of variables containing missings or complete values — prop-miss-complete-var","text":"","code":"prop_miss_var(airquality) #> [1] 0.3333333 prop_complete_var(airquality) #> [1] 0.6666667"},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the proportion of complete values — prop_complete","title":"Return the proportion of complete values — prop_complete","text":"complement prop_miss","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the proportion of complete values — prop_complete","text":"","code":"prop_complete(x)"},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the proportion of complete values — prop_complete","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the proportion of complete values — prop_complete","text":"numeric proportion complete values","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the proportion of complete values — prop_complete","text":"","code":"prop_complete(airquality) #> [1] 0.9520697 prop_complete(airquality$Ozone) #> [1] 0.7581699"},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the proportion of missing values in each row — prop_complete_row","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"Substitute rowMeans(!.na(data)), also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"","code":"prop_complete_row(data)"},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"numeric vector proportion missing values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop_complete_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the proportion of missing values in each row — prop_complete_row","text":"","code":"prop_complete_row(airquality) #>   [1] 1.0000000 1.0000000 1.0000000 1.0000000 0.6666667 0.8333333 1.0000000 #>   [8] 1.0000000 1.0000000 0.8333333 0.8333333 1.0000000 1.0000000 1.0000000 #>  [15] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #>  [22] 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 0.6666667 1.0000000 #>  [29] 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 0.8333333 0.8333333 #>  [36] 0.8333333 0.8333333 1.0000000 0.8333333 1.0000000 1.0000000 0.8333333 #>  [43] 0.8333333 1.0000000 0.8333333 0.8333333 1.0000000 1.0000000 1.0000000 #>  [50] 1.0000000 1.0000000 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 #>  [57] 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 1.0000000 1.0000000 #>  [64] 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #>  [71] 1.0000000 0.8333333 1.0000000 1.0000000 0.8333333 1.0000000 1.0000000 #>  [78] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 #>  [85] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #>  [92] 1.0000000 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 0.8333333 #>  [99] 1.0000000 1.0000000 1.0000000 0.8333333 0.8333333 1.0000000 1.0000000 #> [106] 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [113] 1.0000000 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000 0.8333333 #> [120] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [127] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [134] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [141] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [148] 1.0000000 1.0000000 0.8333333 1.0000000 1.0000000 1.0000000"},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the proportion of missing values — prop_miss","title":"Return the proportion of missing values — prop_miss","text":"shorthand mean(.na(x))","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the proportion of missing values — prop_miss","text":"","code":"prop_miss(x)"},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the proportion of missing values — prop_miss","text":"x vector data.frame","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the proportion of missing values — prop_miss","text":"numeric proportion missing values x","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the proportion of missing values — prop_miss","text":"","code":"prop_miss(airquality) #> [1] 0.04793028 prop_miss(airquality$Ozone) #> [1] 0.2418301"},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a vector of the proportion of missing values in each row — prop_miss_row","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"Substitute rowMeans(.na(data)), also checks input NULL dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"","code":"prop_miss_row(data)"},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"data dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"numeric vector proportion missing values row","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/prop_miss_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a vector of the proportion of missing values in each row — prop_miss_row","text":"","code":"prop_miss_row(airquality) #>   [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.3333333 0.1666667 0.0000000 #>   [8] 0.0000000 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 0.0000000 #>  [15] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #>  [22] 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.3333333 0.0000000 #>  [29] 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 0.1666667 #>  [36] 0.1666667 0.1666667 0.0000000 0.1666667 0.0000000 0.0000000 0.1666667 #>  [43] 0.1666667 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 0.0000000 #>  [50] 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 #>  [57] 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.0000000 0.0000000 #>  [64] 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #>  [71] 0.0000000 0.1666667 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 #>  [78] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 #>  [85] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #>  [92] 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 #>  [99] 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 #> [106] 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [113] 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.1666667 #> [120] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [127] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [134] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [141] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [148] 0.0000000 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000"},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":null,"dir":"Reference","previous_headings":"","what":"Add special missing values to the shadow matrix — recode_shadow","title":"Add special missing values to the shadow matrix — recode_shadow","text":"can useful add special missing values, naniar supports recode_shadow function.","code":""},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add special missing values to the shadow matrix — recode_shadow","text":"","code":"recode_shadow(data, ...)  # S3 method for data.frame recode_shadow(data, ...)  # S3 method for grouped_df recode_shadow(data, ...)"},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add special missing values to the shadow matrix — recode_shadow","text":"data data.frame ... sequence two-sided formulas dplyr::case_when, wrapper function .written around .","code":""},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add special missing values to the shadow matrix — recode_shadow","text":"dataframe altered shadows","code":""},{"path":"http://naniar.njtierney.com/reference/recode_shadow.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add special missing values to the shadow matrix — recode_shadow","text":"","code":"df <- tibble::tribble( ~wind, ~temp, -99,    45, 68,    NA, 72,    25 )  dfs <- bind_shadow(df)  dfs #> # A tibble: 3 × 4 #>    wind  temp wind_NA temp_NA #>           #> 1   -99    45 !NA     !NA     #> 2    68    NA !NA     NA      #> 3    72    25 !NA     !NA      recode_shadow(dfs, temp = .where(wind == -99 ~ \"bananas\")) #> # A tibble: 3 × 4 #>    wind  temp wind_NA temp_NA    #>              #> 1   -99    45 !NA     NA_bananas #> 2    68    NA !NA     NA         #> 3    72    25 !NA     !NA         recode_shadow(dfs,               temp = .where(wind == -99 ~ \"bananas\")) %>% recode_shadow(wind = .where(wind == -99 ~ \"apples\")) #> # A tibble: 3 × 4 #>    wind  temp wind_NA   temp_NA    #>                #> 1   -99    45 NA_apples NA_bananas #> 2    68    NA !NA       NA         #> 3    72    25 !NA       !NA"},{"path":"http://naniar.njtierney.com/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. magrittr %>% rlang are_na, is_na visdat vis_miss","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace NA value with provided value — replace_na_with","title":"Replace NA value with provided value — replace_na_with","text":"function helps replace NA values single provided value. can classed kind imputation, powered impute_fixed(). However, generally recommend impute using model based approaches. See simputation package, example simputation::impute_lm(). See tidyr::replace_na() slightly different approach, dplyr::coalesce() replacing NAs values vectors, dplyr::na_if() replace specified values NA.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace NA value with provided value — replace_na_with","text":"","code":"replace_na_with(x, value)"},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace NA value with provided value — replace_na_with","text":"x vector value value replace","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace NA value with provided value — replace_na_with","text":"vector replaced values","code":""},{"path":"http://naniar.njtierney.com/reference/replace_na_with.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace NA value with provided value — replace_na_with","text":"","code":"library(naniar) x <- c(1:5, NA, NA, NA) x #> [1]  1  2  3  4  5 NA NA NA replace_na_with(x, 0L) #> [1] 1 2 3 4 5 0 0 0 replace_na_with(x, \"unknown\") #> [1] \"1\"       \"2\"       \"3\"       \"4\"       \"5\"       \"unknown\" \"unknown\" #> [8] \"unknown\"  library(dplyr) dat <- tibble(   ones = c(NA,1,1),   twos = c(NA,NA, 2),   threes = c(NA, NA, NA) )  dat #> # A tibble: 3 × 3 #>    ones  twos threes #>       #> 1    NA    NA NA     #> 2     1    NA NA     #> 3     1     2 NA      dat %>%   mutate(     ones = replace_na_with(ones, 0),     twos = replace_na_with(twos, -99),     threes = replace_na_with(threes, \"unknowns\")   ) #> # A tibble: 3 × 3 #>    ones  twos threes   #>         #> 1     0   -99 unknowns #> 2     1   -99 unknowns #> 3     1     2 unknowns  dat %>%   mutate(     across(       everything(),       \\(x) replace_na_with(x, -99)     )   ) #> # A tibble: 3 × 3 #>    ones  twos threes #>       #> 1   -99   -99    -99 #> 2     1   -99    -99 #> 3     1     2    -99"},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace values with missings — replace_to_na","title":"Replace values with missings — replace_to_na","text":"function Defunct, please see replace_with_na().","code":""},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace values with missings — replace_to_na","text":"","code":"replace_to_na(...)"},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace values with missings — replace_to_na","text":"... additional arguments methods.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_to_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace values with missings — replace_to_na","text":"values replaced NA","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace values with missings — replace_with_na","title":"Replace values with missings — replace_with_na","text":"Specify variables values want convert missing values. complement tidyr::replace_na.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace values with missings — replace_with_na","text":"","code":"replace_with_na(data, replace = list(), ...)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace values with missings — replace_with_na","text":"data data.frame replace named list given NA replace values column ... additional arguments methods. Currently unused","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace values with missings — replace_with_na","text":"Dataframe values replaced NA.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/replace_with_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace values with missings — replace_with_na","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                          1,   \"A\",   -100,                          3,   \"N/A\", -99,                          NA,  NA,    -98,                          -99, \"E\",   -101,                          -98, \"F\",   -1)  replace_with_na(dat_ms,                replace = list(x = -99)) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  replace_with_na(dat_ms,              replace = list(x = c(-99, -98))) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4    NA E      -101 #> 5    NA F        -1  replace_with_na(dat_ms,              replace = list(x = c(-99, -98),                           y = c(\"N/A\"),                           z = c(-101))) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4    NA E        NA #> 5    NA F        -1"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace all values with NA where a certain condition is met — replace_with_na_all","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"function takes dataframe replaces values meet condition specified NA value, following special syntax.","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"","code":"replace_with_na_all(data, condition)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"data dataframe condition condition required TRUE set NA. , condition specified formula, following syntax: ~.x {condition}. example, writing ~.x < 20 mean \"variable value less 20, replace NA\".","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace all values with NA where a certain condition is met — replace_with_na_all","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  dat_ms #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1 #replace all instances of -99 with NA replace_with_na_all(data = dat_ms,                     condition = ~.x == -99) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A      NA #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  # replace all instances of -99 or -98, or \"N/A\" with NA replace_with_na_all(dat_ms,                     condition = ~.x %in% c(-99, -98, \"N/A\")) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA       NA #> 3    NA NA       NA #> 4    NA E      -101 #> 5    NA F        -1 # replace all instances of common na strings replace_with_na_all(dat_ms,                     condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  # where works with functions replace_with_na_all(airquality, ~ sqrt(.x) < 5) #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190    NA    67    NA    NA #>  2    36     118    NA    72    NA    NA #>  3    NA     149    NA    74    NA    NA #>  4    NA     313    NA    62    NA    NA #>  5    NA      NA    NA    56    NA    NA #>  6    28      NA    NA    66    NA    NA #>  7    NA     299    NA    65    NA    NA #>  8    NA      99    NA    59    NA    NA #>  9    NA      NA    NA    61    NA    NA #> 10    NA     194    NA    69    NA    NA #> # ℹ 143 more rows"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"Replace specified variables NA certain condition met","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"","code":"replace_with_na_at(data, .vars, condition)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"data dataframe .vars character string variables replace NA values condition condition required TRUE set NA. , condition specified formula, following syntax: ~.x {condition}. example, writing ~.x < 20 mean \"variable value less 20, replace NA\".","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace specified variables with NA where a certain condition is met — replace_with_na_at","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  dat_ms #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  replace_with_na_at(data = dat_ms,                  .vars = \"x\",                  condition = ~.x == -99) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  replace_with_na_at(data = dat_ms,                  .vars = c(\"x\",\"z\"),                  condition = ~.x == -99) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A      NA #> 3    NA NA      -98 #> 4    NA E      -101 #> 5   -98 F        -1  # replace using values in common_na_strings replace_with_na_at(data = dat_ms,                  .vars = c(\"x\",\"z\"),                  condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"Replace values NA based condition, variables meet predicate","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"","code":"replace_with_na_if(data, .predicate, condition)"},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"data Dataframe .predicate predicate function applied columns logical vector. condition condition required TRUE set NA. , condition specified formula, following syntax: ~.x {condition}. example, writing ~.x < 20 mean \"variable value less 20, replace NA\".","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"Dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/replace_with_na_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace values with NA based on some condition, for variables that meet some predicate — replace_with_na_if","text":"","code":"dat_ms <- tibble::tribble(~x,  ~y,    ~z,                           1,   \"A\",   -100,                           3,   \"N/A\", -99,                           NA,  NA,    -98,                           -99, \"E\",   -101,                           -98, \"F\",   -1)  dat_ms #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  replace_with_na_if(data = dat_ms,                  .predicate = is.character,                  condition = ~.x == \"N/A\") #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1 replace_with_na_if(data = dat_ms,                    .predicate = is.character,                    condition = ~.x %in% common_na_strings) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 NA      -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1  replace_with_na(dat_ms,               to_na = list(x = c(-99, -98),                            y = c(\"N/A\"),                            z = c(-101))) #> # A tibble: 5 × 3 #>       x y         z #>      #> 1     1 A      -100 #> 2     3 N/A     -99 #> 3    NA NA      -98 #> 4   -99 E      -101 #> 5   -98 F        -1"},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":null,"dir":"Reference","previous_headings":"","what":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"data subset 2009 survey BRFSS, ongoing data collection program designed measure behavioral risk factors adult population (18 years age older) living households.","code":""},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"","code":"data(riskfactors)"},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"object class tbl_df (inherits tbl, data.frame) 245 rows 34 columns.","code":""},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"https://www.cdc.gov/brfss/annual_data/annual_2009.htm","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/riskfactors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The Behavioral Risk Factor Surveillance System (BRFSS) Survey\nData, 2009. — riskfactors","text":"","code":"vis_miss(riskfactors)   # Look at the missingness in the variables miss_var_summary(riskfactors) #> # A tibble: 34 × 3 #>    variable      n_miss pct_miss #>                   #>  1 pregnant         215    87.8  #>  2 smoke_stop       212    86.5  #>  3 smoke_last       161    65.7  #>  4 drink_average    135    55.1  #>  5 drink_days       134    54.7  #>  6 smoke_days       128    52.2  #>  7 health_poor      113    46.1  #>  8 bmi               11     4.49 #>  9 weight_lbs        10     4.08 #> 10 diet_fruit         8     3.27 #> # ℹ 24 more rows  # and now as a plot gg_miss_var(riskfactors)   if (FALSE) { # Look at the missingness in bmi and poor health library(ggplot2) p <- ggplot(riskfactors,        aes(x = health_poor,            y = bmi)) +      geom_miss_point()   p   # for each sex?  p + facet_wrap(~sex)  # for each education bracket?  p + facet_wrap(~education) }"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_mean — scoped-impute_mean","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"impute_mean imputes mean vector. get work variables, use impute_mean_all. impute variables satisfy specific condition, use scoped variants, impute_below_at, impute_below_if. use _at effectively, must know _at`` affects variables selected character vector, vars()`.","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"","code":"impute_mean_all(.tbl)  impute_mean_at(.tbl, .vars)  impute_mean_if(.tbl, .predicate)"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_mean — scoped-impute_mean","text":".tbl data.frame .vars variables impute .predicate variables impute","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/scoped-impute_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_mean — scoped-impute_mean","text":"","code":"# select variables starting with a particular string. impute_mean_all(airquality) #>         Ozone  Solar.R Wind Temp Month Day #> 1    41.00000 190.0000  7.4   67     5   1 #> 2    36.00000 118.0000  8.0   72     5   2 #> 3    12.00000 149.0000 12.6   74     5   3 #> 4    18.00000 313.0000 11.5   62     5   4 #> 5    42.12931 185.9315 14.3   56     5   5 #> 6    28.00000 185.9315 14.9   66     5   6 #> 7    23.00000 299.0000  8.6   65     5   7 #> 8    19.00000  99.0000 13.8   59     5   8 #> 9     8.00000  19.0000 20.1   61     5   9 #> 10   42.12931 194.0000  8.6   69     5  10 #> 11    7.00000 185.9315  6.9   74     5  11 #> 12   16.00000 256.0000  9.7   69     5  12 #> 13   11.00000 290.0000  9.2   66     5  13 #> 14   14.00000 274.0000 10.9   68     5  14 #> 15   18.00000  65.0000 13.2   58     5  15 #> 16   14.00000 334.0000 11.5   64     5  16 #> 17   34.00000 307.0000 12.0   66     5  17 #> 18    6.00000  78.0000 18.4   57     5  18 #> 19   30.00000 322.0000 11.5   68     5  19 #> 20   11.00000  44.0000  9.7   62     5  20 #> 21    1.00000   8.0000  9.7   59     5  21 #> 22   11.00000 320.0000 16.6   73     5  22 #> 23    4.00000  25.0000  9.7   61     5  23 #> 24   32.00000  92.0000 12.0   61     5  24 #> 25   42.12931  66.0000 16.6   57     5  25 #> 26   42.12931 266.0000 14.9   58     5  26 #> 27   42.12931 185.9315  8.0   57     5  27 #> 28   23.00000  13.0000 12.0   67     5  28 #> 29   45.00000 252.0000 14.9   81     5  29 #> 30  115.00000 223.0000  5.7   79     5  30 #> 31   37.00000 279.0000  7.4   76     5  31 #> 32   42.12931 286.0000  8.6   78     6   1 #> 33   42.12931 287.0000  9.7   74     6   2 #> 34   42.12931 242.0000 16.1   67     6   3 #> 35   42.12931 186.0000  9.2   84     6   4 #> 36   42.12931 220.0000  8.6   85     6   5 #> 37   42.12931 264.0000 14.3   79     6   6 #> 38   29.00000 127.0000  9.7   82     6   7 #> 39   42.12931 273.0000  6.9   87     6   8 #> 40   71.00000 291.0000 13.8   90     6   9 #> 41   39.00000 323.0000 11.5   87     6  10 #> 42   42.12931 259.0000 10.9   93     6  11 #> 43   42.12931 250.0000  9.2   92     6  12 #> 44   23.00000 148.0000  8.0   82     6  13 #> 45   42.12931 332.0000 13.8   80     6  14 #> 46   42.12931 322.0000 11.5   79     6  15 #> 47   21.00000 191.0000 14.9   77     6  16 #> 48   37.00000 284.0000 20.7   72     6  17 #> 49   20.00000  37.0000  9.2   65     6  18 #> 50   12.00000 120.0000 11.5   73     6  19 #> 51   13.00000 137.0000 10.3   76     6  20 #> 52   42.12931 150.0000  6.3   77     6  21 #> 53   42.12931  59.0000  1.7   76     6  22 #> 54   42.12931  91.0000  4.6   76     6  23 #> 55   42.12931 250.0000  6.3   76     6  24 #> 56   42.12931 135.0000  8.0   75     6  25 #> 57   42.12931 127.0000  8.0   78     6  26 #> 58   42.12931  47.0000 10.3   73     6  27 #> 59   42.12931  98.0000 11.5   80     6  28 #> 60   42.12931  31.0000 14.9   77     6  29 #> 61   42.12931 138.0000  8.0   83     6  30 #> 62  135.00000 269.0000  4.1   84     7   1 #> 63   49.00000 248.0000  9.2   85     7   2 #> 64   32.00000 236.0000  9.2   81     7   3 #> 65   42.12931 101.0000 10.9   84     7   4 #> 66   64.00000 175.0000  4.6   83     7   5 #> 67   40.00000 314.0000 10.9   83     7   6 #> 68   77.00000 276.0000  5.1   88     7   7 #> 69   97.00000 267.0000  6.3   92     7   8 #> 70   97.00000 272.0000  5.7   92     7   9 #> 71   85.00000 175.0000  7.4   89     7  10 #> 72   42.12931 139.0000  8.6   82     7  11 #> 73   10.00000 264.0000 14.3   73     7  12 #> 74   27.00000 175.0000 14.9   81     7  13 #> 75   42.12931 291.0000 14.9   91     7  14 #> 76    7.00000  48.0000 14.3   80     7  15 #> 77   48.00000 260.0000  6.9   81     7  16 #> 78   35.00000 274.0000 10.3   82     7  17 #> 79   61.00000 285.0000  6.3   84     7  18 #> 80   79.00000 187.0000  5.1   87     7  19 #> 81   63.00000 220.0000 11.5   85     7  20 #> 82   16.00000   7.0000  6.9   74     7  21 #> 83   42.12931 258.0000  9.7   81     7  22 #> 84   42.12931 295.0000 11.5   82     7  23 #> 85   80.00000 294.0000  8.6   86     7  24 #> 86  108.00000 223.0000  8.0   85     7  25 #> 87   20.00000  81.0000  8.6   82     7  26 #> 88   52.00000  82.0000 12.0   86     7  27 #> 89   82.00000 213.0000  7.4   88     7  28 #> 90   50.00000 275.0000  7.4   86     7  29 #> 91   64.00000 253.0000  7.4   83     7  30 #> 92   59.00000 254.0000  9.2   81     7  31 #> 93   39.00000  83.0000  6.9   81     8   1 #> 94    9.00000  24.0000 13.8   81     8   2 #> 95   16.00000  77.0000  7.4   82     8   3 #> 96   78.00000 185.9315  6.9   86     8   4 #> 97   35.00000 185.9315  7.4   85     8   5 #> 98   66.00000 185.9315  4.6   87     8   6 #> 99  122.00000 255.0000  4.0   89     8   7 #> 100  89.00000 229.0000 10.3   90     8   8 #> 101 110.00000 207.0000  8.0   90     8   9 #> 102  42.12931 222.0000  8.6   92     8  10 #> 103  42.12931 137.0000 11.5   86     8  11 #> 104  44.00000 192.0000 11.5   86     8  12 #> 105  28.00000 273.0000 11.5   82     8  13 #> 106  65.00000 157.0000  9.7   80     8  14 #> 107  42.12931  64.0000 11.5   79     8  15 #> 108  22.00000  71.0000 10.3   77     8  16 #> 109  59.00000  51.0000  6.3   79     8  17 #> 110  23.00000 115.0000  7.4   76     8  18 #> 111  31.00000 244.0000 10.9   78     8  19 #> 112  44.00000 190.0000 10.3   78     8  20 #> 113  21.00000 259.0000 15.5   77     8  21 #> 114   9.00000  36.0000 14.3   72     8  22 #> 115  42.12931 255.0000 12.6   75     8  23 #> 116  45.00000 212.0000  9.7   79     8  24 #> 117 168.00000 238.0000  3.4   81     8  25 #> 118  73.00000 215.0000  8.0   86     8  26 #> 119  42.12931 153.0000  5.7   88     8  27 #> 120  76.00000 203.0000  9.7   97     8  28 #> 121 118.00000 225.0000  2.3   94     8  29 #> 122  84.00000 237.0000  6.3   96     8  30 #> 123  85.00000 188.0000  6.3   94     8  31 #> 124  96.00000 167.0000  6.9   91     9   1 #> 125  78.00000 197.0000  5.1   92     9   2 #> 126  73.00000 183.0000  2.8   93     9   3 #> 127  91.00000 189.0000  4.6   93     9   4 #> 128  47.00000  95.0000  7.4   87     9   5 #> 129  32.00000  92.0000 15.5   84     9   6 #> 130  20.00000 252.0000 10.9   80     9   7 #> 131  23.00000 220.0000 10.3   78     9   8 #> 132  21.00000 230.0000 10.9   75     9   9 #> 133  24.00000 259.0000  9.7   73     9  10 #> 134  44.00000 236.0000 14.9   81     9  11 #> 135  21.00000 259.0000 15.5   76     9  12 #> 136  28.00000 238.0000  6.3   77     9  13 #> 137   9.00000  24.0000 10.9   71     9  14 #> 138  13.00000 112.0000 11.5   71     9  15 #> 139  46.00000 237.0000  6.9   78     9  16 #> 140  18.00000 224.0000 13.8   67     9  17 #> 141  13.00000  27.0000 10.3   76     9  18 #> 142  24.00000 238.0000 10.3   68     9  19 #> 143  16.00000 201.0000  8.0   82     9  20 #> 144  13.00000 238.0000 12.6   64     9  21 #> 145  23.00000  14.0000  9.2   71     9  22 #> 146  36.00000 139.0000 10.3   81     9  23 #> 147   7.00000  49.0000 10.3   69     9  24 #> 148  14.00000  20.0000 16.6   63     9  25 #> 149  30.00000 193.0000  6.9   70     9  26 #> 150  42.12931 145.0000 13.2   77     9  27 #> 151  14.00000 191.0000 14.3   75     9  28 #> 152  18.00000 131.0000  8.0   76     9  29 #> 153  20.00000 223.0000 11.5   68     9  30  impute_mean_at(airquality,                .vars = c(\"Ozone\", \"Solar.R\")) #>         Ozone  Solar.R Wind Temp Month Day #> 1    41.00000 190.0000  7.4   67     5   1 #> 2    36.00000 118.0000  8.0   72     5   2 #> 3    12.00000 149.0000 12.6   74     5   3 #> 4    18.00000 313.0000 11.5   62     5   4 #> 5    42.12931 185.9315 14.3   56     5   5 #> 6    28.00000 185.9315 14.9   66     5   6 #> 7    23.00000 299.0000  8.6   65     5   7 #> 8    19.00000  99.0000 13.8   59     5   8 #> 9     8.00000  19.0000 20.1   61     5   9 #> 10   42.12931 194.0000  8.6   69     5  10 #> 11    7.00000 185.9315  6.9   74     5  11 #> 12   16.00000 256.0000  9.7   69     5  12 #> 13   11.00000 290.0000  9.2   66     5  13 #> 14   14.00000 274.0000 10.9   68     5  14 #> 15   18.00000  65.0000 13.2   58     5  15 #> 16   14.00000 334.0000 11.5   64     5  16 #> 17   34.00000 307.0000 12.0   66     5  17 #> 18    6.00000  78.0000 18.4   57     5  18 #> 19   30.00000 322.0000 11.5   68     5  19 #> 20   11.00000  44.0000  9.7   62     5  20 #> 21    1.00000   8.0000  9.7   59     5  21 #> 22   11.00000 320.0000 16.6   73     5  22 #> 23    4.00000  25.0000  9.7   61     5  23 #> 24   32.00000  92.0000 12.0   61     5  24 #> 25   42.12931  66.0000 16.6   57     5  25 #> 26   42.12931 266.0000 14.9   58     5  26 #> 27   42.12931 185.9315  8.0   57     5  27 #> 28   23.00000  13.0000 12.0   67     5  28 #> 29   45.00000 252.0000 14.9   81     5  29 #> 30  115.00000 223.0000  5.7   79     5  30 #> 31   37.00000 279.0000  7.4   76     5  31 #> 32   42.12931 286.0000  8.6   78     6   1 #> 33   42.12931 287.0000  9.7   74     6   2 #> 34   42.12931 242.0000 16.1   67     6   3 #> 35   42.12931 186.0000  9.2   84     6   4 #> 36   42.12931 220.0000  8.6   85     6   5 #> 37   42.12931 264.0000 14.3   79     6   6 #> 38   29.00000 127.0000  9.7   82     6   7 #> 39   42.12931 273.0000  6.9   87     6   8 #> 40   71.00000 291.0000 13.8   90     6   9 #> 41   39.00000 323.0000 11.5   87     6  10 #> 42   42.12931 259.0000 10.9   93     6  11 #> 43   42.12931 250.0000  9.2   92     6  12 #> 44   23.00000 148.0000  8.0   82     6  13 #> 45   42.12931 332.0000 13.8   80     6  14 #> 46   42.12931 322.0000 11.5   79     6  15 #> 47   21.00000 191.0000 14.9   77     6  16 #> 48   37.00000 284.0000 20.7   72     6  17 #> 49   20.00000  37.0000  9.2   65     6  18 #> 50   12.00000 120.0000 11.5   73     6  19 #> 51   13.00000 137.0000 10.3   76     6  20 #> 52   42.12931 150.0000  6.3   77     6  21 #> 53   42.12931  59.0000  1.7   76     6  22 #> 54   42.12931  91.0000  4.6   76     6  23 #> 55   42.12931 250.0000  6.3   76     6  24 #> 56   42.12931 135.0000  8.0   75     6  25 #> 57   42.12931 127.0000  8.0   78     6  26 #> 58   42.12931  47.0000 10.3   73     6  27 #> 59   42.12931  98.0000 11.5   80     6  28 #> 60   42.12931  31.0000 14.9   77     6  29 #> 61   42.12931 138.0000  8.0   83     6  30 #> 62  135.00000 269.0000  4.1   84     7   1 #> 63   49.00000 248.0000  9.2   85     7   2 #> 64   32.00000 236.0000  9.2   81     7   3 #> 65   42.12931 101.0000 10.9   84     7   4 #> 66   64.00000 175.0000  4.6   83     7   5 #> 67   40.00000 314.0000 10.9   83     7   6 #> 68   77.00000 276.0000  5.1   88     7   7 #> 69   97.00000 267.0000  6.3   92     7   8 #> 70   97.00000 272.0000  5.7   92     7   9 #> 71   85.00000 175.0000  7.4   89     7  10 #> 72   42.12931 139.0000  8.6   82     7  11 #> 73   10.00000 264.0000 14.3   73     7  12 #> 74   27.00000 175.0000 14.9   81     7  13 #> 75   42.12931 291.0000 14.9   91     7  14 #> 76    7.00000  48.0000 14.3   80     7  15 #> 77   48.00000 260.0000  6.9   81     7  16 #> 78   35.00000 274.0000 10.3   82     7  17 #> 79   61.00000 285.0000  6.3   84     7  18 #> 80   79.00000 187.0000  5.1   87     7  19 #> 81   63.00000 220.0000 11.5   85     7  20 #> 82   16.00000   7.0000  6.9   74     7  21 #> 83   42.12931 258.0000  9.7   81     7  22 #> 84   42.12931 295.0000 11.5   82     7  23 #> 85   80.00000 294.0000  8.6   86     7  24 #> 86  108.00000 223.0000  8.0   85     7  25 #> 87   20.00000  81.0000  8.6   82     7  26 #> 88   52.00000  82.0000 12.0   86     7  27 #> 89   82.00000 213.0000  7.4   88     7  28 #> 90   50.00000 275.0000  7.4   86     7  29 #> 91   64.00000 253.0000  7.4   83     7  30 #> 92   59.00000 254.0000  9.2   81     7  31 #> 93   39.00000  83.0000  6.9   81     8   1 #> 94    9.00000  24.0000 13.8   81     8   2 #> 95   16.00000  77.0000  7.4   82     8   3 #> 96   78.00000 185.9315  6.9   86     8   4 #> 97   35.00000 185.9315  7.4   85     8   5 #> 98   66.00000 185.9315  4.6   87     8   6 #> 99  122.00000 255.0000  4.0   89     8   7 #> 100  89.00000 229.0000 10.3   90     8   8 #> 101 110.00000 207.0000  8.0   90     8   9 #> 102  42.12931 222.0000  8.6   92     8  10 #> 103  42.12931 137.0000 11.5   86     8  11 #> 104  44.00000 192.0000 11.5   86     8  12 #> 105  28.00000 273.0000 11.5   82     8  13 #> 106  65.00000 157.0000  9.7   80     8  14 #> 107  42.12931  64.0000 11.5   79     8  15 #> 108  22.00000  71.0000 10.3   77     8  16 #> 109  59.00000  51.0000  6.3   79     8  17 #> 110  23.00000 115.0000  7.4   76     8  18 #> 111  31.00000 244.0000 10.9   78     8  19 #> 112  44.00000 190.0000 10.3   78     8  20 #> 113  21.00000 259.0000 15.5   77     8  21 #> 114   9.00000  36.0000 14.3   72     8  22 #> 115  42.12931 255.0000 12.6   75     8  23 #> 116  45.00000 212.0000  9.7   79     8  24 #> 117 168.00000 238.0000  3.4   81     8  25 #> 118  73.00000 215.0000  8.0   86     8  26 #> 119  42.12931 153.0000  5.7   88     8  27 #> 120  76.00000 203.0000  9.7   97     8  28 #> 121 118.00000 225.0000  2.3   94     8  29 #> 122  84.00000 237.0000  6.3   96     8  30 #> 123  85.00000 188.0000  6.3   94     8  31 #> 124  96.00000 167.0000  6.9   91     9   1 #> 125  78.00000 197.0000  5.1   92     9   2 #> 126  73.00000 183.0000  2.8   93     9   3 #> 127  91.00000 189.0000  4.6   93     9   4 #> 128  47.00000  95.0000  7.4   87     9   5 #> 129  32.00000  92.0000 15.5   84     9   6 #> 130  20.00000 252.0000 10.9   80     9   7 #> 131  23.00000 220.0000 10.3   78     9   8 #> 132  21.00000 230.0000 10.9   75     9   9 #> 133  24.00000 259.0000  9.7   73     9  10 #> 134  44.00000 236.0000 14.9   81     9  11 #> 135  21.00000 259.0000 15.5   76     9  12 #> 136  28.00000 238.0000  6.3   77     9  13 #> 137   9.00000  24.0000 10.9   71     9  14 #> 138  13.00000 112.0000 11.5   71     9  15 #> 139  46.00000 237.0000  6.9   78     9  16 #> 140  18.00000 224.0000 13.8   67     9  17 #> 141  13.00000  27.0000 10.3   76     9  18 #> 142  24.00000 238.0000 10.3   68     9  19 #> 143  16.00000 201.0000  8.0   82     9  20 #> 144  13.00000 238.0000 12.6   64     9  21 #> 145  23.00000  14.0000  9.2   71     9  22 #> 146  36.00000 139.0000 10.3   81     9  23 #> 147   7.00000  49.0000 10.3   69     9  24 #> 148  14.00000  20.0000 16.6   63     9  25 #> 149  30.00000 193.0000  6.9   70     9  26 #> 150  42.12931 145.0000 13.2   77     9  27 #> 151  14.00000 191.0000 14.3   75     9  28 #> 152  18.00000 131.0000  8.0   76     9  29 #> 153  20.00000 223.0000 11.5   68     9  30  if (FALSE) { library(dplyr) impute_mean_at(airquality,                 .vars = vars(Ozone))  impute_mean_if(airquality,                 .predicate = is.numeric)  library(ggplot2) airquality %>%   bind_shadow() %>%   impute_mean_all() %>%   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +          geom_point() }"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":null,"dir":"Reference","previous_headings":"","what":"Scoped variants of impute_median — scoped-impute_median","title":"Scoped variants of impute_median — scoped-impute_median","text":"impute_median imputes median vector. impute many variables , recommend use  across function workflow, shown examples impute_median(). can use scoped variants, impute_median_all.impute_below_at, impute_below_if impute , , just variables meeting condition, respectively. use _at effectively, must know _at affects variables selected character vector, vars().","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scoped variants of impute_median — scoped-impute_median","text":"","code":"impute_median_all(.tbl)  impute_median_at(.tbl, .vars)  impute_median_if(.tbl, .predicate)"},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scoped variants of impute_median — scoped-impute_median","text":".tbl data.frame .vars variables impute .predicate variables impute","code":""},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scoped variants of impute_median — scoped-impute_median","text":"dataset values imputed","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/scoped-impute_median.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scoped variants of impute_median — scoped-impute_median","text":"","code":"# select variables starting with a particular string. impute_median_all(airquality) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5     205 14.3   56     5   5 #> 6    28.0     205 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0     205  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5     205  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0     205  6.9   86     8   4 #> 97   35.0     205  7.4   85     8   5 #> 98   66.0     205  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30  impute_median_at(airquality,                .vars = c(\"Ozone\", \"Solar.R\")) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5     205 14.3   56     5   5 #> 6    28.0     205 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0     205  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5     205  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0     205  6.9   86     8   4 #> 97   35.0     205  7.4   85     8   5 #> 98   66.0     205  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30 library(dplyr) impute_median_at(airquality,                 .vars = vars(Ozone)) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5      NA 14.3   56     5   5 #> 6    28.0      NA 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0      NA  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5      NA  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0      NA  6.9   86     8   4 #> 97   35.0      NA  7.4   85     8   5 #> 98   66.0      NA  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30  impute_median_if(airquality,                 .predicate = is.numeric) #>     Ozone Solar.R Wind Temp Month Day #> 1    41.0     190  7.4   67     5   1 #> 2    36.0     118  8.0   72     5   2 #> 3    12.0     149 12.6   74     5   3 #> 4    18.0     313 11.5   62     5   4 #> 5    31.5     205 14.3   56     5   5 #> 6    28.0     205 14.9   66     5   6 #> 7    23.0     299  8.6   65     5   7 #> 8    19.0      99 13.8   59     5   8 #> 9     8.0      19 20.1   61     5   9 #> 10   31.5     194  8.6   69     5  10 #> 11    7.0     205  6.9   74     5  11 #> 12   16.0     256  9.7   69     5  12 #> 13   11.0     290  9.2   66     5  13 #> 14   14.0     274 10.9   68     5  14 #> 15   18.0      65 13.2   58     5  15 #> 16   14.0     334 11.5   64     5  16 #> 17   34.0     307 12.0   66     5  17 #> 18    6.0      78 18.4   57     5  18 #> 19   30.0     322 11.5   68     5  19 #> 20   11.0      44  9.7   62     5  20 #> 21    1.0       8  9.7   59     5  21 #> 22   11.0     320 16.6   73     5  22 #> 23    4.0      25  9.7   61     5  23 #> 24   32.0      92 12.0   61     5  24 #> 25   31.5      66 16.6   57     5  25 #> 26   31.5     266 14.9   58     5  26 #> 27   31.5     205  8.0   57     5  27 #> 28   23.0      13 12.0   67     5  28 #> 29   45.0     252 14.9   81     5  29 #> 30  115.0     223  5.7   79     5  30 #> 31   37.0     279  7.4   76     5  31 #> 32   31.5     286  8.6   78     6   1 #> 33   31.5     287  9.7   74     6   2 #> 34   31.5     242 16.1   67     6   3 #> 35   31.5     186  9.2   84     6   4 #> 36   31.5     220  8.6   85     6   5 #> 37   31.5     264 14.3   79     6   6 #> 38   29.0     127  9.7   82     6   7 #> 39   31.5     273  6.9   87     6   8 #> 40   71.0     291 13.8   90     6   9 #> 41   39.0     323 11.5   87     6  10 #> 42   31.5     259 10.9   93     6  11 #> 43   31.5     250  9.2   92     6  12 #> 44   23.0     148  8.0   82     6  13 #> 45   31.5     332 13.8   80     6  14 #> 46   31.5     322 11.5   79     6  15 #> 47   21.0     191 14.9   77     6  16 #> 48   37.0     284 20.7   72     6  17 #> 49   20.0      37  9.2   65     6  18 #> 50   12.0     120 11.5   73     6  19 #> 51   13.0     137 10.3   76     6  20 #> 52   31.5     150  6.3   77     6  21 #> 53   31.5      59  1.7   76     6  22 #> 54   31.5      91  4.6   76     6  23 #> 55   31.5     250  6.3   76     6  24 #> 56   31.5     135  8.0   75     6  25 #> 57   31.5     127  8.0   78     6  26 #> 58   31.5      47 10.3   73     6  27 #> 59   31.5      98 11.5   80     6  28 #> 60   31.5      31 14.9   77     6  29 #> 61   31.5     138  8.0   83     6  30 #> 62  135.0     269  4.1   84     7   1 #> 63   49.0     248  9.2   85     7   2 #> 64   32.0     236  9.2   81     7   3 #> 65   31.5     101 10.9   84     7   4 #> 66   64.0     175  4.6   83     7   5 #> 67   40.0     314 10.9   83     7   6 #> 68   77.0     276  5.1   88     7   7 #> 69   97.0     267  6.3   92     7   8 #> 70   97.0     272  5.7   92     7   9 #> 71   85.0     175  7.4   89     7  10 #> 72   31.5     139  8.6   82     7  11 #> 73   10.0     264 14.3   73     7  12 #> 74   27.0     175 14.9   81     7  13 #> 75   31.5     291 14.9   91     7  14 #> 76    7.0      48 14.3   80     7  15 #> 77   48.0     260  6.9   81     7  16 #> 78   35.0     274 10.3   82     7  17 #> 79   61.0     285  6.3   84     7  18 #> 80   79.0     187  5.1   87     7  19 #> 81   63.0     220 11.5   85     7  20 #> 82   16.0       7  6.9   74     7  21 #> 83   31.5     258  9.7   81     7  22 #> 84   31.5     295 11.5   82     7  23 #> 85   80.0     294  8.6   86     7  24 #> 86  108.0     223  8.0   85     7  25 #> 87   20.0      81  8.6   82     7  26 #> 88   52.0      82 12.0   86     7  27 #> 89   82.0     213  7.4   88     7  28 #> 90   50.0     275  7.4   86     7  29 #> 91   64.0     253  7.4   83     7  30 #> 92   59.0     254  9.2   81     7  31 #> 93   39.0      83  6.9   81     8   1 #> 94    9.0      24 13.8   81     8   2 #> 95   16.0      77  7.4   82     8   3 #> 96   78.0     205  6.9   86     8   4 #> 97   35.0     205  7.4   85     8   5 #> 98   66.0     205  4.6   87     8   6 #> 99  122.0     255  4.0   89     8   7 #> 100  89.0     229 10.3   90     8   8 #> 101 110.0     207  8.0   90     8   9 #> 102  31.5     222  8.6   92     8  10 #> 103  31.5     137 11.5   86     8  11 #> 104  44.0     192 11.5   86     8  12 #> 105  28.0     273 11.5   82     8  13 #> 106  65.0     157  9.7   80     8  14 #> 107  31.5      64 11.5   79     8  15 #> 108  22.0      71 10.3   77     8  16 #> 109  59.0      51  6.3   79     8  17 #> 110  23.0     115  7.4   76     8  18 #> 111  31.0     244 10.9   78     8  19 #> 112  44.0     190 10.3   78     8  20 #> 113  21.0     259 15.5   77     8  21 #> 114   9.0      36 14.3   72     8  22 #> 115  31.5     255 12.6   75     8  23 #> 116  45.0     212  9.7   79     8  24 #> 117 168.0     238  3.4   81     8  25 #> 118  73.0     215  8.0   86     8  26 #> 119  31.5     153  5.7   88     8  27 #> 120  76.0     203  9.7   97     8  28 #> 121 118.0     225  2.3   94     8  29 #> 122  84.0     237  6.3   96     8  30 #> 123  85.0     188  6.3   94     8  31 #> 124  96.0     167  6.9   91     9   1 #> 125  78.0     197  5.1   92     9   2 #> 126  73.0     183  2.8   93     9   3 #> 127  91.0     189  4.6   93     9   4 #> 128  47.0      95  7.4   87     9   5 #> 129  32.0      92 15.5   84     9   6 #> 130  20.0     252 10.9   80     9   7 #> 131  23.0     220 10.3   78     9   8 #> 132  21.0     230 10.9   75     9   9 #> 133  24.0     259  9.7   73     9  10 #> 134  44.0     236 14.9   81     9  11 #> 135  21.0     259 15.5   76     9  12 #> 136  28.0     238  6.3   77     9  13 #> 137   9.0      24 10.9   71     9  14 #> 138  13.0     112 11.5   71     9  15 #> 139  46.0     237  6.9   78     9  16 #> 140  18.0     224 13.8   67     9  17 #> 141  13.0      27 10.3   76     9  18 #> 142  24.0     238 10.3   68     9  19 #> 143  16.0     201  8.0   82     9  20 #> 144  13.0     238 12.6   64     9  21 #> 145  23.0      14  9.2   71     9  22 #> 146  36.0     139 10.3   81     9  23 #> 147   7.0      49 10.3   69     9  24 #> 148  14.0      20 16.6   63     9  25 #> 149  30.0     193  6.9   70     9  26 #> 150  31.5     145 13.2   77     9  27 #> 151  14.0     191 14.3   75     9  28 #> 152  18.0     131  8.0   76     9  29 #> 153  20.0     223 11.5   68     9  30  library(ggplot2) airquality %>%   bind_shadow() %>%   impute_median_all() %>%   add_label_shadow() %>%   ggplot(aes(x = Ozone,              y = Solar.R,              colour = any_missing)) +          geom_point()"},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":null,"dir":"Reference","previous_headings":"","what":"Set a proportion or number of missing values — set-prop-n-miss","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"Set proportion number missing values","code":""},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"","code":"set_prop_miss(x, prop = 0.1)  set_n_miss(x, n = 1)"},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"x vector values set missing prop proportion values 0 1 set missing n number values set missing","code":""},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"vector missing values added","code":""},{"path":"http://naniar.njtierney.com/reference/set-prop-n-miss.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set a proportion or number of missing values — set-prop-n-miss","text":"","code":"vec <- rnorm(5) set_prop_miss(vec, 0.2) #> [1] -0.65662615 -0.64975149  0.09030152          NA  0.74846478 set_prop_miss(vec, 0.4) #> [1] -0.6566262 -0.6497515         NA -1.3162772         NA set_n_miss(vec, 1) #> [1] -0.6566262 -0.6497515         NA -1.3162772  0.7484648 set_n_miss(vec, 4) #> [1]        NA        NA        NA -1.316277        NA"},{"path":"http://naniar.njtierney.com/reference/shade.html","id":null,"dir":"Reference","previous_headings":"","what":"Create new levels of missing — shade","title":"Create new levels of missing — shade","text":"Returns (least) factors !NA NA, !NA indicates datum missing, NA indicates missingness. also allows specify new missings, like. function powers factor levels as_shadow().","code":""},{"path":"http://naniar.njtierney.com/reference/shade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create new levels of missing — shade","text":"","code":"shade(x, ..., extra_levels = NULL)"},{"path":"http://naniar.njtierney.com/reference/shade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create new levels of missing — shade","text":"x vector ... additional levels missing add extra_levels extra levels might specify factor.","code":""},{"path":"http://naniar.njtierney.com/reference/shade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create new levels of missing — shade","text":"","code":"df <- tibble::tribble(   ~wind, ~temp,   -99,    45,   68,    NA,   72,    25   )  shade(df$wind) #> [1] !NA !NA !NA #> Levels: !NA NA  shade(df$wind, inst_fail = -99) #> [1] NA_inst_fail !NA          !NA          #> Levels: !NA NA NA_inst_fail"},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape shadow data into a long format — shadow_long","title":"Reshape shadow data into a long format — shadow_long","text":"data nabular form, shadow bound data, can useful reshape long format shadow columns separate grouping - variable, value, variable_NA value_NA.","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape shadow data into a long format — shadow_long","text":"","code":"shadow_long(shadow_data, ..., fn_value_transform = NULL, only_main_vars = TRUE)"},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape shadow data into a long format — shadow_long","text":"shadow_data data.frame ... bare name variables want focus fn_value_transform function transform \"value\" column. Default NULL, defaults .character. aware .numeric may fail instances coerce value numeric. See examples. only_main_vars logical - want filter main variables?","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshape shadow data into a long format — shadow_long","text":"data long format, columns variable, value, variable_NA, value_NA.","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_long.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reshape shadow data into a long format — shadow_long","text":"","code":"aq_shadow <- nabular(airquality)  shadow_long(aq_shadow) #> # A tibble: 918 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone    41    Ozone_NA    !NA      #>  2 Solar.R  190   Solar.R_NA  !NA      #>  3 Wind     7.4   Wind_NA     !NA      #>  4 Temp     67    Temp_NA     !NA      #>  5 Month    5     Month_NA    !NA      #>  6 Day      1     Day_NA      !NA      #>  7 Ozone    36    Ozone_NA    !NA      #>  8 Solar.R  118   Solar.R_NA  !NA      #>  9 Wind     8     Wind_NA     !NA      #> 10 Temp     72    Temp_NA     !NA      #> # ℹ 908 more rows  # then filter only on Ozone shadow_long(aq_shadow, Ozone) #> # A tibble: 153 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone    41    Ozone_NA    !NA      #>  2 Ozone    36    Ozone_NA    !NA      #>  3 Ozone    12    Ozone_NA    !NA      #>  4 Ozone    18    Ozone_NA    !NA      #>  5 Ozone    NA    Ozone_NA    NA       #>  6 Ozone    28    Ozone_NA    !NA      #>  7 Ozone    23    Ozone_NA    !NA      #>  8 Ozone    19    Ozone_NA    !NA      #>  9 Ozone    8     Ozone_NA    !NA      #> 10 Ozone    NA    Ozone_NA    NA       #> # ℹ 143 more rows  shadow_long(aq_shadow, Ozone, Solar.R) #> # A tibble: 306 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone    41    Ozone_NA    !NA      #>  2 Solar.R  190   Solar.R_NA  !NA      #>  3 Ozone    36    Ozone_NA    !NA      #>  4 Solar.R  118   Solar.R_NA  !NA      #>  5 Ozone    12    Ozone_NA    !NA      #>  6 Solar.R  149   Solar.R_NA  !NA      #>  7 Ozone    18    Ozone_NA    !NA      #>  8 Solar.R  313   Solar.R_NA  !NA      #>  9 Ozone    NA    Ozone_NA    NA       #> 10 Solar.R  NA    Solar.R_NA  NA       #> # ℹ 296 more rows  # ensure `value` is numeric shadow_long(aq_shadow, fn_value_transform = as.numeric) #> # A tibble: 918 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone     41   Ozone_NA    !NA      #>  2 Solar.R  190   Solar.R_NA  !NA      #>  3 Wind       7.4 Wind_NA     !NA      #>  4 Temp      67   Temp_NA     !NA      #>  5 Month      5   Month_NA    !NA      #>  6 Day        1   Day_NA      !NA      #>  7 Ozone     36   Ozone_NA    !NA      #>  8 Solar.R  118   Solar.R_NA  !NA      #>  9 Wind       8   Wind_NA     !NA      #> 10 Temp      72   Temp_NA     !NA      #> # ℹ 908 more rows shadow_long(aq_shadow, Ozone, Solar.R, fn_value_transform = as.numeric) #> # A tibble: 306 × 4 #>    variable value variable_NA value_NA #>                    #>  1 Ozone       41 Ozone_NA    !NA      #>  2 Solar.R    190 Solar.R_NA  !NA      #>  3 Ozone       36 Ozone_NA    !NA      #>  4 Solar.R    118 Solar.R_NA  !NA      #>  5 Ozone       12 Ozone_NA    !NA      #>  6 Solar.R    149 Solar.R_NA  !NA      #>  7 Ozone       18 Ozone_NA    !NA      #>  8 Solar.R    313 Solar.R_NA  !NA      #>  9 Ozone       NA Ozone_NA    NA       #> 10 Solar.R     NA Solar.R_NA  NA       #> # ℹ 296 more rows"},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"shadow_shift transforms missing values facilitate visualisation, different behaviour different types variables. numeric variables, values shifted 10% minimum value given variable plus jittered noise, separate repeated values, missing values can visualised along rest data.","code":""},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"","code":"shadow_shift(...)"},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"... arguments impute_below().","code":""},{"path":[]},{"path":[]},{"path":"http://naniar.njtierney.com/reference/shadow_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Shift missing values to facilitate missing data exploration/visualisation — shadow_shift","text":"","code":"airquality$Ozone #>   [1]  41  36  12  18  NA  28  23  19   8  NA   7  16  11  14  18  14  34   6 #>  [19]  30  11   1  11   4  32  NA  NA  NA  23  45 115  37  NA  NA  NA  NA  NA #>  [37]  NA  29  NA  71  39  NA  NA  23  NA  NA  21  37  20  12  13  NA  NA  NA #>  [55]  NA  NA  NA  NA  NA  NA  NA 135  49  32  NA  64  40  77  97  97  85  NA #>  [73]  10  27  NA   7  48  35  61  79  63  16  NA  NA  80 108  20  52  82  50 #>  [91]  64  59  39   9  16  78  35  66 122  89 110  NA  NA  44  28  65  NA  22 #> [109]  59  23  31  44  21   9  NA  45 168  73  NA  76 118  84  85  96  78  73 #> [127]  91  47  32  20  23  21  24  44  21  28   9  13  46  18  13  24  16  13 #> [145]  23  36   7  14  30  NA  14  18  20 shadow_shift(airquality$Ozone) #> Warning: `shadow_shift()` was deprecated in naniar 1.1.0. #> ℹ Please use `impute_below()` instead. #>   [1]  41.00000  36.00000  12.00000  18.00000 -19.72321  28.00000  23.00000 #>   [8]  19.00000   8.00000 -18.51277   7.00000  16.00000  11.00000  14.00000 #>  [15]  18.00000  14.00000  34.00000   6.00000  30.00000  11.00000   1.00000 #>  [22]  11.00000   4.00000  32.00000 -17.81863 -19.43853 -15.14310  23.00000 #>  [29]  45.00000 115.00000  37.00000 -16.17315 -14.65883 -17.85609 -13.29299 #>  [36] -16.16323 -19.60935  29.00000 -19.65780  71.00000  39.00000 -13.40961 #>  [43] -13.53728  23.00000 -19.65993 -16.48342  21.00000  37.00000  20.00000 #>  [50]  12.00000  13.00000 -17.17718 -16.74073 -13.65786 -16.78786 -12.30098 #>  [57] -13.33171 -16.77414 -17.08225 -15.98818 -19.17558 135.00000  49.00000 #>  [64]  32.00000 -14.27138  64.00000  40.00000  77.00000  97.00000  97.00000 #>  [71]  85.00000 -13.51764  10.00000  27.00000 -13.48998   7.00000  48.00000 #>  [78]  35.00000  61.00000  79.00000  63.00000  16.00000 -16.92150 -16.60335 #>  [85]  80.00000 108.00000  20.00000  52.00000  82.00000  50.00000  64.00000 #>  [92]  59.00000  39.00000   9.00000  16.00000  78.00000  35.00000  66.00000 #>  [99] 122.00000  89.00000 110.00000 -14.78907 -16.19151  44.00000  28.00000 #> [106]  65.00000 -19.73591  22.00000  59.00000  23.00000  31.00000  44.00000 #> [113]  21.00000   9.00000 -18.92235  45.00000 168.00000  73.00000 -14.86296 #> [120]  76.00000 118.00000  84.00000  85.00000  96.00000  78.00000  73.00000 #> [127]  91.00000  47.00000  32.00000  20.00000  23.00000  21.00000  24.00000 #> [134]  44.00000  21.00000  28.00000   9.00000  13.00000  46.00000  18.00000 #> [141]  13.00000  24.00000  16.00000  13.00000  23.00000  36.00000   7.00000 #> [148]  14.00000  30.00000 -14.83089  14.00000  18.00000  20.00000 if (FALSE) { library(dplyr) airquality %>%     mutate(Ozone_shift = shadow_shift(Ozone)) }"},{"path":"http://naniar.njtierney.com/reference/stat_miss_point.html","id":null,"dir":"Reference","previous_headings":"","what":"stat_miss_point — stat_miss_point","title":"stat_miss_point — stat_miss_point","text":"stat_miss_point adds geometry displaying missingness geom_point","code":""},{"path":"http://naniar.njtierney.com/reference/stat_miss_point.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"stat_miss_point — stat_miss_point","text":"","code":"stat_miss_point(   mapping = NULL,   data = NULL,   prop_below = 0.1,   jitter = 0.05,   geom = \"point\",   position = \"identity\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE,   ... )"},{"path":"http://naniar.njtierney.com/reference/stat_miss_point.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"stat_miss_point — stat_miss_point","text":"mapping Set aesthetic mappings created ggplot2::aes() ggplot2::aes_(). specified inherit.aes = TRUE (default), combined default mapping top level plot. need supply mapping mapping defined plot. data data frame. specified, overrides default data frame defined top level plot. prop_below degree shift values. default 0.1 jitter amount jitter add. default 0.05 geom, stat Override default connection geom_point stat_point. position Position adjustment, either string, result call position adjustment function na.rm FALSE (default), removes missing values warning. TRUE silently removes missing values. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders. ... arguments passed ggplot2::layer(). three types arguments can use : Aesthetics: set aesthetic fixed value, like color = \"red\" size = 3. arguments layer, example override default stat associated layer. arguments passed stat.","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":null,"dir":"Reference","previous_headings":"","what":"Unbind (remove) shadow from data, and vice versa — unbinders","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"Remove shadow variables (end _NA) data, vice versa. also remove nabular class data.","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"","code":"unbind_shadow(data)  unbind_data(data)"},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"data data.frame containing shadow columns (created bind_shadow())","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"data.frame without shadow columns using unbind_shadow(), without original data, using unbind_data().","code":""},{"path":"http://naniar.njtierney.com/reference/unbinders.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unbind (remove) shadow from data, and vice versa — unbinders","text":"","code":"# bind shadow columns aq_sh <- bind_shadow(airquality)  # print data aq_sh #> # A tibble: 153 × 12 #>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA Wind_NA Temp_NA #>                            #>  1    41     190   7.4    67     5     1 !NA      !NA        !NA     !NA     #>  2    36     118   8      72     5     2 !NA      !NA        !NA     !NA     #>  3    12     149  12.6    74     5     3 !NA      !NA        !NA     !NA     #>  4    18     313  11.5    62     5     4 !NA      !NA        !NA     !NA     #>  5    NA      NA  14.3    56     5     5 NA       NA         !NA     !NA     #>  6    28      NA  14.9    66     5     6 !NA      NA         !NA     !NA     #>  7    23     299   8.6    65     5     7 !NA      !NA        !NA     !NA     #>  8    19      99  13.8    59     5     8 !NA      !NA        !NA     !NA     #>  9     8      19  20.1    61     5     9 !NA      !NA        !NA     !NA     #> 10    NA     194   8.6    69     5    10 NA       !NA        !NA     !NA     #> # ℹ 143 more rows #> # ℹ 2 more variables: Month_NA , Day_NA   # remove shadow columns unbind_shadow(aq_sh) #> # A tibble: 153 × 6 #>    Ozone Solar.R  Wind  Temp Month   Day #>            #>  1    41     190   7.4    67     5     1 #>  2    36     118   8      72     5     2 #>  3    12     149  12.6    74     5     3 #>  4    18     313  11.5    62     5     4 #>  5    NA      NA  14.3    56     5     5 #>  6    28      NA  14.9    66     5     6 #>  7    23     299   8.6    65     5     7 #>  8    19      99  13.8    59     5     8 #>  9     8      19  20.1    61     5     9 #> 10    NA     194   8.6    69     5    10 #> # ℹ 143 more rows  # remove data unbind_data(aq_sh) #> # A tibble: 153 × 6 #>    Ozone_NA Solar.R_NA Wind_NA Temp_NA Month_NA Day_NA #>                          #>  1 !NA      !NA        !NA     !NA     !NA      !NA    #>  2 !NA      !NA        !NA     !NA     !NA      !NA    #>  3 !NA      !NA        !NA     !NA     !NA      !NA    #>  4 !NA      !NA        !NA     !NA     !NA      !NA    #>  5 NA       NA         !NA     !NA     !NA      !NA    #>  6 !NA      NA         !NA     !NA     !NA      !NA    #>  7 !NA      !NA        !NA     !NA     !NA      !NA    #>  8 !NA      !NA        !NA     !NA     !NA      !NA    #>  9 !NA      !NA        !NA     !NA     !NA      !NA    #> 10 NA       !NA        !NA     !NA     !NA      !NA    #> # ℹ 143 more rows  # errors when you don't use data with shadows if (FALSE) {  unbind_data(airquality)  unbind_shadow(airquality) }"},{"path":"http://naniar.njtierney.com/reference/where.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a call into two components with a useful verb name — where","title":"Split a call into two components with a useful verb name — where","text":"function used inside recode_shadow help evaluate formula call effectively. .special function designed use recode_shadow, use outside ","code":""},{"path":"http://naniar.njtierney.com/reference/where.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a call into two components with a useful verb name — where","text":"","code":".where(...)"},{"path":"http://naniar.njtierney.com/reference/where.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a call into two components with a useful verb name — where","text":"... case_when style formula","code":""},{"path":"http://naniar.njtierney.com/reference/where.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a call into two components with a useful verb name — where","text":"list \"condition\" \"suffix\" arguments","code":""},{"path":"http://naniar.njtierney.com/reference/where.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a call into two components with a useful verb name — where","text":"","code":"if (FALSE) { df <- tibble::tribble( ~wind, ~temp, -99,    45, 68,    NA, 72,    25 )  dfs <- bind_shadow(df)  recode_shadow(dfs,               temp = .where(wind == -99 ~ \"bananas\"))  }"},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Which rows and cols contain missings? — where_na","title":"Which rows and cols contain missings? — where_na","text":"Internal function short (.na(x), arr.ind = TRUE). Creates array index locations missing values dataframe.","code":""},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which rows and cols contain missings? — where_na","text":"","code":"where_na(x)"},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which rows and cols contain missings? — where_na","text":"x dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which rows and cols contain missings? — where_na","text":"matrix columns \"row\" \"col\", refer row column identify position missing value dataframe","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/where_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which rows and cols contain missings? — where_na","text":"","code":"where_na(airquality) #>       row col #>  [1,]   5   1 #>  [2,]  10   1 #>  [3,]  25   1 #>  [4,]  26   1 #>  [5,]  27   1 #>  [6,]  32   1 #>  [7,]  33   1 #>  [8,]  34   1 #>  [9,]  35   1 #> [10,]  36   1 #> [11,]  37   1 #> [12,]  39   1 #> [13,]  42   1 #> [14,]  43   1 #> [15,]  45   1 #> [16,]  46   1 #> [17,]  52   1 #> [18,]  53   1 #> [19,]  54   1 #> [20,]  55   1 #> [21,]  56   1 #> [22,]  57   1 #> [23,]  58   1 #> [24,]  59   1 #> [25,]  60   1 #> [26,]  61   1 #> [27,]  65   1 #> [28,]  72   1 #> [29,]  75   1 #> [30,]  83   1 #> [31,]  84   1 #> [32,] 102   1 #> [33,] 103   1 #> [34,] 107   1 #> [35,] 115   1 #> [36,] 119   1 #> [37,] 150   1 #> [38,]   5   2 #> [39,]   6   2 #> [40,]  11   2 #> [41,]  27   2 #> [42,]  96   2 #> [43,]  97   2 #> [44,]  98   2 where_na(oceanbuoys$sea_temp_c) #> [1] 463 481 637"},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":null,"dir":"Reference","previous_headings":"","what":"Which variables are shades? — which_are_shade","title":"Which variables are shades? — which_are_shade","text":"function tells us variables contain shade information","code":""},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which variables are shades? — which_are_shade","text":"","code":"which_are_shade(.tbl)"},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which variables are shades? — which_are_shade","text":".tbl data.frame tbl","code":""},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which variables are shades? — which_are_shade","text":"numeric - column numbers contain shade information","code":""},{"path":"http://naniar.njtierney.com/reference/which_are_shade.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which variables are shades? — which_are_shade","text":"","code":"df_shadow <- bind_shadow(airquality)  which_are_shade(df_shadow) #>   Ozone_NA Solar.R_NA    Wind_NA    Temp_NA   Month_NA     Day_NA  #>          7          8          9         10         11         12"},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Which elements contain missings? — which_na","title":"Which elements contain missings? — which_na","text":"Equivalent (.na()) - returns integer locations missing values.","code":""},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which elements contain missings? — which_na","text":"","code":"which_na(x)"},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which elements contain missings? — which_na","text":"x dataframe","code":""},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which elements contain missings? — which_na","text":"integer locations missing values.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/reference/which_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which elements contain missings? — which_na","text":"","code":"which_na(airquality) #>  [1]   5  10  25  26  27  32  33  34  35  36  37  39  42  43  45  46  52  53  54 #> [20]  55  56  57  58  59  60  61  65  72  75  83  84 102 103 107 115 119 150 158 #> [39] 159 164 180 249 250 251"},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-110-prince-caspian","dir":"Changelog","previous_headings":"","what":"naniar 1.1.0 “Prince Caspian”","title":"naniar 1.1.0 “Prince Caspian”","text":"CRAN release: 2024-03-05","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-1-1-0","dir":"Changelog","previous_headings":"","what":"New","title":"naniar 1.1.0 “Prince Caspian”","text":"Implement impute_fixed, impute_zero, impute_factor. notably implement “scoped variants” previously implemented - example, impute_fixed_if etc. favour using new across workflow within dplyr, easier maintain. #261 Add digit argument miss_var_summary help display %missing data correctly small fraction missingness. #284 Implemented impute_mode - resolves #213. geom_miss_point() works shape argument #290 Fix bug all_complete, implemented !anyNA(x) (complete.cases(x)). Correctly implement any_na() (any_miss()) any_complete(). Rework examples demonstrate workflow finding complete variables.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-1-1-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"naniar 1.1.0 “Prince Caspian”","text":"Fix bug shadow_long working gathering variables mixed type. Fix involves specifying value transform, defaults character. #314 Implement Date, POSIXct POSIXlt methods impute_below() - #158 Provide replace_na_with, complement replace_with_na - #129 Fix bug gg_miss_fct used deprecated function forcats - #342","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"misc-1-1-0","dir":"Changelog","previous_headings":"","what":"Misc","title":"naniar 1.1.0 “Prince Caspian”","text":"Use cli::cli_abort cli::cli_warn instead stop warn (#326) Use expect_snapshot instead expect_error (#326)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Changes","title":"naniar 1.1.0 “Prince Caspian”","text":"Soft deprecated shadow_shift - #193 Soft deprecate miss_case_cumsum() miss_var_cumsum() - #257","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-100","dir":"Changelog","previous_headings":"","what":"naniar 1.0.0","title":"naniar 1.0.0","text":"CRAN release: 2023-02-02 Version 1.0.0 naniar signify release associated publication associated JSS paper, doi:10.18637/jss.v105.i07. also small changes implemented release, described . still lot naniar, release signify changes upcoming, establish stable release, changes upcoming go formal deprecation process .","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-1-0-0","dir":"Changelog","previous_headings":"","what":"New","title":"naniar 1.0.0","text":"DOI CITATION new JSS publication registered publication CRAN. Replaced tidyr::gather tidyr::pivot_longer - resolves #301 added set_n_miss set_prop_miss functions - resolved #298","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-1-0-0","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"naniar 1.0.0","text":"Fix bug gg_miss_var() warning appears due change remove legend #288.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"misc-1-0-0","dir":"Changelog","previous_headings":"","what":"Misc","title":"naniar 1.0.0","text":"Removed gdtools naniar longer needed 302. added imports, vctrs cli - free dependencies used within already used tidyverse already.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-061-20210513-incandescent-lightbulbs-killed-the-arc-lamps","dir":"Changelog","previous_headings":"","what":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","title":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","text":"CRAN release: 2021-05-14","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-6-1","dir":"Changelog","previous_headings":"","what":"New features","title":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","text":"naniar now provides mcar_test() Little’s (1988) statistical test missing completely random (MCAR) data. null hypothesis test data MCAR, test statistic chi-squared value. Given high statistic value low p-value, can conclude data missing completely random. Thanks Andrew Heiss PR. common_na_strings gains \"#N/\".","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-6-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"naniar 0.6.1 (2021/05/13) “Incandescent lightbulbs killed the Arc lamps”","text":"Fix bug miss_var_span() (#270) number missings + number complete values added number rows data. due remainder used calculating number complete values. Fix bug recode_shadow() (#272) adding special missing value two subsequent operations fails.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-060-20200817-spur-of-the-lamp-post","dir":"Changelog","previous_headings":"","what":"naniar 0.6.0 (2020/08/17) “Spur of the lamp post”","title":"naniar 0.6.0 (2020/08/17) “Spur of the lamp post”","text":"CRAN release: 2020-09-02 Provide warning replace_with_na columns provided don’t exist (see #160). Thank michael-dewar help .","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"naniar 0.6.0 (2020/08/17) “Spur of the lamp post”","text":"Drop “nabular” “shadow” classes (#268) used nabular() bind_shadow(). removes functions, as_shadow(), is_shadow(), is_nabular(), new_nabular(), new_shadow(). mostly used internally expected users used functions. used, please file issue can implement .","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-052-20200628-silver-apple","dir":"Changelog","previous_headings":"","what":"naniar 0.5.2 (2020/06/28) “Silver Apple”","title":"naniar 0.5.2 (2020/06/28) “Silver Apple”","text":"CRAN release: 2020-06-29","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-5-2","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.5.2 (2020/06/28) “Silver Apple”","text":"Improvements code miss_var_summary(), miss_var_table(), prop_miss_var(), resulting 3-10x speedup.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-051-20200410-uncle-andrews-applewood-wardrobe","dir":"Changelog","previous_headings":"","what":"naniar 0.5.1 (2020/04/10) “Uncle Andrew’s Applewood Wardrobe”","title":"naniar 0.5.1 (2020/04/10) “Uncle Andrew’s Applewood Wardrobe”","text":"CRAN release: 2020-04-30","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-5-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.5.1 (2020/04/10) “Uncle Andrew’s Applewood Wardrobe”","text":"Fixes warnings errors tibble subsequent downstream impacts simputation.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-050-20200220-the-end-of-this-story-and-the-beginning-of-all-of-the-others","dir":"Changelog","previous_headings":"","what":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"CRAN release: 2020-02-28","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"miss_var_prop() complete_var_prop() miss_var_pct() complete_var_pct() miss_case_prop() complete_case_prop() miss_case_pct() complete_case_pct() Instead use: prop_miss_var(), prop_complete_var(), pct_miss_var(), pct_complete_var(), prop_miss_case(), prop_complete_case(), pct_miss_case(), pct_complete_case(). (see 242) replace_to_na() made defunct, please use replace_with_na() instead. (see 242)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"miss_var_cumsum miss_case_cumsum now exported use map_dfc instead map_df Fix various extra warnings improve test coverage","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-5-0","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"naniar 0.5.0 (2020/02/20) “The End of this Story and the Beginning of all of the Others”","text":"Address bug number missings row calculated properly - see 238 232. solution involved using rowSums(.na(x)), 3 times faster. Resolve bug gg_miss_fct() warning given non explicit NA values - see 241. skip vdiffr tests github actions use tibble() data_frame()","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-042-20190215-the-planting-of-the-tree","dir":"Changelog","previous_headings":"","what":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","title":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","text":"CRAN release: 2019-02-15","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"improvements-0-4-2","dir":"Changelog","previous_headings":"","what":"Improvements","title":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","text":"geom_miss_point() ggplot2 layer can now converted interactive web-based version ggplotly() function plotly package. order work, naniar now exports geom2trace.GeomMissPoint() function (users never need call geom2trace.GeomMissPoint() directly – ggplotly() calls ). adds WORDLIST spelling thanks usethis::use_spell_check() fix documentation @seealso bug (#228) (@sfirke)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"dependency-fixes-0-4-2","dir":"Changelog","previous_headings":"","what":"Dependency fixes","title":"naniar 0.4.2 (2019/02/15) “The Planting of The Tree”","text":"Thanks PR (#223) @romainfrancois: fixes two problems identified part reverse dependency checks dplyr 0.8.0 release candidate. https://github.com/tidyverse/dplyr/blob/revdep_dplyr_0_8_0_RC/revdep/problems.md#naniar n() must imported prefixed like function. PR, ’ve changed 1:n() dplyr::row_number() naniar seems prefix dplyr functions. update_shadow restoring class attributes, changed restores attributes, causing problems data grouped_df. likely problem , dplyr 0.8.0 stricter grouped data frame.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-041-20181214","dir":"Changelog","previous_headings":"","what":"naniar 0.4.1 (2018/12/14)","title":"naniar 0.4.1 (2018/12/14)","text":"CRAN release: 2018-11-20","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-4-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.4.1 (2018/12/14)","text":"pkgdown updates: update favicon logo, set gh-pages deployment use scalar integer new_tibble","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-041-20181120-aslans-song","dir":"Changelog","previous_headings":"","what":"naniar 0.4.1 (2018/11/20) “Aslan’s Song”","title":"naniar 0.4.1 (2018/11/20) “Aslan’s Song”","text":"CRAN release: 2018-11-20","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-change-0-4-1","dir":"Changelog","previous_headings":"","what":"Minor Change","title":"naniar 0.4.1 (2018/11/20) “Aslan’s Song”","text":"Fixes new_tibble #220 - Thanks Kirill Müller. Refactoring capture arguments rlang #218 - thanks Lionel Henry.","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-feature-0-4-0","dir":"Changelog","previous_headings":"","what":"New Feature","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Add custom label support missings missings functions add_label_missings add_label_shadow() add_any_miss(). can now `add_label_missings(data, missing = “custom_missing_label”, complete = “custom_complete_label”) impute_median() scoped variants any_shade() returns logical TRUE FALSE depending shade values nabular() alias bind_shadow() tie nabular term work. is_nabular() checks input nabular. geom_miss_point() now gains arguments shadow_shift()/impute_below() altering amount jitter proportion (prop_below). Added two new vignettes, “Exploring Imputed Values”, “Special Missing Values” miss_var_summary miss_case_summary now longer provide cumulative sum missingness summaries - summary can added back data option add_cumsum = TRUE. #186 Added gg_miss_upset replace workflow :","code":"data %>%    as_shadow_upset() %>%   UpSetR::upset()"},{"path":"http://naniar.njtierney.com/news/index.html","id":"major-change-0-4-0","dir":"Changelog","previous_headings":"","what":"Major Change","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"recode_shadow now works! function allows recode missing values special missing values. special missing values stored shadow part dataframe, ends _NA. implemented shade appropriate throughout naniar, also added verifiers, is_shade, are_shade, which_are_shade, removed which_are_shadow. as_shadow bind_shadow now return data class shadow. feed recode_shadow methods flexibly adding new types missing data. Note future shadow might changed nabble something similar.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-feature-0-4-0","dir":"Changelog","previous_headings":"","what":"Minor feature","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Functions add_label_shadow() add_label_missings() gain arguments can label according missingness / shadowy-ness given variables. new function which_are_shadow(), tell values shadows. new function long_shadow(), converts data shadow/nabular form long format suitable plotting. Related #165 Added tests miss_scan_count","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"gg_miss_upset gets better default presentation ordering largest intersections, also improved error message data 1 variables missing values. shadow_shift gains informative error message doesn’t know class. Changed common_na_string include escape characters “?”, “”, ”.” used replacement searching functions don’t return wildcard results characters ”?”, ””, “.”. miss_case_table miss_var_table now final column names pct_vars, pct_cases instead pct_miss - fixes #178.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Deprecated old names scalar missingness summaries, favour consistent syntax #171. old new : old names made defunct 0.5.0, removed completely 0.6.0. impute_below changed alias shadow_shift - operates single vector. impute_below_all operates columns dataframe (specified #159)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fix-0-4-0","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"naniar 0.4.0 (2018/09/10) “An Unexpected Meeting”","text":"Ensured miss_scan_count actually return’d something. gg_miss_var(airquality) now prints ggplot - typo meant print plot","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"naniar-031-20180610-strawberrys-adventure","dir":"Changelog","previous_headings":"","what":"naniar 0.3.1 (2018/06/10) “Strawberry’s Adventure”","title":"naniar 0.3.1 (2018/06/10) “Strawberry’s Adventure”","text":"CRAN release: 2018-06-08","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-change-0-3-1","dir":"Changelog","previous_headings":"","what":"Minor Change","title":"naniar 0.3.1 (2018/06/10) “Strawberry’s Adventure”","text":"patch release removes tidyselect package Imports, unnecessary. Fixes #174","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-030-20180606-digory-and-his-uncle-are-both-in-trouble","dir":"Changelog","previous_headings":"","what":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","title":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","text":"CRAN release: 2018-06-07","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","text":"Added all_miss() / all_na() equivalent (.na(x)) Added any_complete() equivalent (complete.cases(x)) Added any_miss() equivalent anyNA(x) Added common_na_numbers finalised common_na_strings - provide list commonly used NA values #168 Added miss_var_which, lists variable names missings Added as_shadow_upset gets data format suitable plotting UpSetR plot: Added imputation functions assist exploring missingness structure visualisation: impute_below Perfoms shadow_shift, performs columns. means imputes missing values 10% range data (powered shadow_shift), facilitate graphical exloration data. Closes #145 also scoped variants work specific named columns: impute_below_at, columns satisfy predicate function: impute_below_if. impute_mean, imputes mean value, scoped variants impute_mean_at, impute_mean_if. impute_below shadow_shift gain arguments prop_below jitter control degree shift, also extent jitter. Added complete_{case/var}_{pct/prop}, complement miss_{var/case}_{pct/prop} #150 Added unbind_shadow unbind_data helpers remove shadow columns data, data shadows, respectively. Added is_shadow are_shadow determine something contains shadow column. simimlar rlang::is_na rland::are_na, is_shadow returns logical vector length 1, are_shadow returns logical vector length number names data.frame. might revisited later point (see any_shade add_label_shadow). Aesthetics now map expected geom_miss_point(). means can write things like geom_miss_point(aes(colour = Month)) works appropriately. Fixed Luke Smith Pull request #144, fixing #137.","code":"airquality %>%   as_shadow_upset() %>%   UpSetR::upset()"},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"# naniar 0.3.0 (2018/06/06) “Digory and his Uncle Are Both in Trouble”","text":"miss_var_summary miss_case_summary now return use order = TRUE default, cases variables missings presented descending order. Fixes #163 Changes Visualisation: Changed default colours used gg_miss_case gg_miss_var lorikeet purple (ochRe package: https://github.com/ropenscilabs/ochRe) y axis label now … Default presentation order_cases = TRUE. Gains show_pct option consistent gg_miss_var #153 gg_miss_which rotated 90 degrees easier read variable names gg_miss_fct uses minimal theme tilts axis labels #118. imported is_na are_na rlang. Added common_na_strings, list common NA values #168. Added detail alternative methods replacing NA vignette “replacing values NA”.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-020-20180208-the-first-joke-and-other-matters","dir":"Changelog","previous_headings":"","what":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"CRAN release: 2018-02-09","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Speed improvements. Thanks help, contributions, discussion Romain François Jim Hester, naniar now greatly improved speed calculating missingness row. speedups continue improve future releases. New “scoped variants” replace_with_na, thankyou Colin Fay work : replace_with_na_all replaces NAs across dataframe meet specified condition (using syntax ~.x == -99) replace_with_na_at replaces NAs across specified variables replace_with_na_if replaces NAs variables satisfy predicate function (e.g., .character) added which_na - replacement (.na(x)) miss_scan_count. makes easier users search particular occurrences values across variables. #119 n_miss_row calculates number missing values row, returning vector. also 3 functions similar spirit: n_complete_row, prop_miss_row, prop_complete_row, return vector number complete obserations, proportion missings row, proportion complete obserations row add_miss_cluster new function calculates cluster missingness row, using hclust. can useful exploratory modelling missingness, similar Tierney et al 2015: “doi: 10.1136/bmjopen-2014-007450” Barnett et al. 2017: “doi: 10.1136/bmjopen-2017-017284” Now exported where_na - function returns positions NA values. dataframe returns matrix row col positions NAs, vector returns vector positions NAs. (#105)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Updated vignette “Gallery Missing Data Visualisations” include facet features order_cases. bind_shadow gains only_miss argument. set FALSE (default) bind dataframe variables duplicated shadow. Setting TRUE bind variables variables contain missing values. Cleaned visualisation gg_miss_case clearer less cluttered ( #117), also added n order_cases option order cases. Added facet argument gg_miss_var, gg_miss_case, gg_miss_span. makes easier users visualise plots across values another variable. future consider adding facet shorthand plotting function, moment seemed ones benefit feature.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fix-0-2-0","dir":"Changelog","previous_headings":"","what":"Bug fix","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"oceanbuoys now numeric type year, latitude, longitude, previously factor. See related issue Improved handling shadow_shift Inf -Inf values (see #117)","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"breaking-change-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking change","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Deprecated replace_to_na, replace_with_na, natural phrase (“replace coffee tea” vs “replace coffee tea”). made defunct next version. cast_shadow longer works called cast_shadow(data). action used return variables, shadow variables variables contained missing values. inconsistent use cast_shadow(data, var1, var2). new option added bind_shadow controls - discussed . See details issue 65. Change behaviour cast_shadow default option return variables contain missings. different bind_shadow, binds complete shadow matrix dataframe. way think shadow cast variables contain missing values, whereas bind binding complete shadow data. may change future default option bind_shadow.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-2-0-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"# naniar 0.2.0 (2018/02/08) (“The First Joke and Other Matters”)","text":"Update vignettes floating menu better figure size. minor changes graphics gg_miss_fct - change legend title “Percent Missing” “% Miss”.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-010-20170809-the-founding-of-naniar","dir":"Changelog","previous_headings":"","what":"# naniar 0.1.0 (2017/08/09) “The Founding of naniar”","title":"# naniar 0.1.0 (2017/08/09) “The Founding of naniar”","text":"CRAN release: 2017-08-09 first release naniar onto CRAN, updates naniar happen reasonably regularly approximately every 1-2 months","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"name-change-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"Name change","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"careful consideration, changed back naniar","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"major-change-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"Major Change","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"three new functions : miss_case_cumsum / miss_var_cumsum / replace_to_na two new visualisations : gg_var_cumsum & gg_case_cumsum","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-feature-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"New Feature","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"miss_case_cumsum() miss_case_summary() miss_case_table() miss_prop_summary() miss_var_cumsum() miss_var_run() miss_var_span() miss_var_summary() miss_var_table()","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-0-9-9995","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"Reviewed documentation functions improved wording, grammar, style. Converted roxygen roxygen markdown updated vignettes readme added new vignette “naniar-visualisation”, give quick overview visualisations provided naniar. changed label_missing* label_miss consistent rest naniar Add pct prop helpers (#78) removed miss_df_pct - literally pct_miss prop_miss. break larger files smaller, manageable files (#83) gg_miss_var gets show_pct argument show percentage missing values (Thanks Jennifer helpful feedback! :))","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"minor-changes-0-0-9-9995-1","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"# naniar 0.0.9.9995 (2017/08/07)","text":"miss_var_summary & miss_case_summary now consistent output (one ordered n_missing, ). prevent error miss_case_pct enquo_x now x Now ByteCompile TRUE add Colin auth","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-0069100-20170321","dir":"Changelog","previous_headings":"","what":"# naniar 0.0.6.9100 (2017/03/21)","title":"# naniar 0.0.6.9100 (2017/03/21)","text":"Added prop_miss complement prop_complete. n_miss returns number missing values, prop_miss returns proportion missing values. Likewise, prop_complete returns proportion complete values.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"defunct-functions-0-0-6-9100","dir":"Changelog","previous_headings":"","what":"Defunct functions","title":"# naniar 0.0.6.9100 (2017/03/21)","text":"stated 0.0.5.9000, address Issue #38, moving towards format miss_type_value/fun, makes sense tabbing functions. left hand side functions made defunct favour right hand side. - percent_missing_case() –> miss_case_pct() - percent_missing_var() –> miss_var_pct() - percent_missing_df() –> miss_df_pct() - summary_missing_case() –> miss_case_summary() - summary_missing_var() –> miss_var_summary() - table_missing_case() –> miss_case_table() - table_missing_var() –> miss_var_table()","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"deprecated-functions-0-0-5-9000","dir":"Changelog","previous_headings":"","what":"Deprecated functions","title":"# naniar 0.0.5.9000 (2016/01/08)","text":"address Issue #38, moving towards format miss_type_value/fun, makes sense tabbing functions. miss_* = want explore missing values miss_case_* = want explore missing cases miss_case_pct = want find percentage cases containing missing value miss_case_summary = want find number / percentage missings case miss_case_table = want tabulation number / percentage cases missing consistent easier reason . Thus, renamed following functions: - percent_missing_case() –> miss_case_pct() - percent_missing_var() –> miss_var_pct() - percent_missing_df() –> miss_df_pct() - summary_missing_case() –> miss_case_summary() - summary_missing_var() –> miss_var_summary() - table_missing_case() –> miss_case_table() - table_missing_var() –> miss_var_table() made defunct next release, 0.0.6.9000 (“Wood Worlds”).","code":""},{"path":[]},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-0-0-4-9000","dir":"Changelog","previous_headings":"","what":"New features","title":"# naniar 0.0.4.9000 (2016/12/31)","text":"n_complete complement n_miss, counts number complete values vector, matrix, dataframe.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-0-4-9000","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"# naniar 0.0.4.9000 (2016/12/31)","text":"shadow_shift now handles cases 1 complete value vector.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"other-changes-0-0-4-9000","dir":"Changelog","previous_headings":"","what":"Other changes","title":"# naniar 0.0.4.9000 (2016/12/31)","text":"added much comprehensive testing testthat.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"id_-naniar-0039901-20161218","dir":"Changelog","previous_headings":"","what":"# naniar 0.0.3.9901 (2016/12/18)","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"burst effort package done refactoring thought hard package going go. meant make decision rename package ggmissing naniar. name may strike strange reflects fact many changes happening, working creating nice utopia (like Narnia CS Lewis) helps us make easier work missing data","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"new-features-under-development-0-0-3-9901","dir":"Changelog","previous_headings":"","what":"New Features (under development)","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"add_n_miss add_prop_miss helpers add columns dataframe containing number proportion missing values. example provided use decision trees explore missing data structure “doi: 10.1136/bmjopen-2014-007450” geom_miss_point() now supports transparency, thanks @seasmith (Luke Smith) shadows. mainly around bind_shadow gather_shadow, helper functions assist creating","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"bug-fixes-0-0-3-9901","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"geom_missing_point() broke new release ggplot2 2.2.0, now fixed ensuring inherits GeomPoint, rather just new Geom. Thanks Mitchell O’hara-Wild help . missing data summaries table_missing_var table_missing_case also now return sensible numbers variable names. possible function names change future, kind verbose. semantic versioning incorrectly entered DESCRIPTION file 0.2.9000, changed 0.0.2.9000, 0.0.3.9000 now indicate new changes, hopefully won’t come back bite later. think accidentally visdat point well. Live learn.","code":""},{"path":"http://naniar.njtierney.com/news/index.html","id":"other-changes-0-0-3-9901","dir":"Changelog","previous_headings":"","what":"Other changes","title":"# naniar 0.0.3.9901 (2016/12/18)","text":"gathered related functions single R files rather leaving . correctly imported %>% operator magrittr, removed lot chaff around @importFrom - really don’t need use @importFrom often.","code":""}]