Description Usage Arguments Details Value Examples
plotNA
returns a grob visualizing the missing values in data
1 |
tb |
a data.frame |
order |
(logical) Whether to order the variables based on missing values in plot |
limit |
(logical) Whether to limit the plot to maximum missing value. FALSE means the limit of axis will be [0, nrow(tb)] |
add_percent |
(logical) Whether to add percent as data labels on bar plot |
row.level |
(logical) Whether to create plot at rows and variables level |
This is a function which helps in visualizing the missing values in data using plots. By default a bar plot is generated which shows the count of missing values in each variable.
If order
is set as TRUE
then the bars are arranged in order of
missing values. If limit
is set as TRUE
then limit of axis is
set to [0, nrow(tb)]. If add_percent
is set as TRUE
then
percent is added as text to the bars. If row.level
is set to
TRUE
then an additional plot is generated which shows which rows have
missing values and in which variable (reshape2
(https://CRAN.R-project.org/package=reshape2) library
is required for this).
This function returns a grob of class 'analyzePlot' which has a bar
plot showing the count of missing value for each variable. order,
limit, add_percent
can be used to modify the bar plot. An additional plot
will be created and added to the grob if row.level
is set as
TRUE
1 2 3 4 5 | p <- plotNA(airquality)
# function to show the 'analyzerPlot' class plot
plot(p)
p1 <- plotNA(airquality, order = FALSE)
plot(p1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.