naSummary: Giving a NA summary and an image of a data with missing...

Description Usage Arguments Value Examples

Description

Characterizes only variables of a data set with missing values. So, missing values are painted black, while other observations keep white.

Usage

1
2
naSummary(data, dataset.name, show.plot = FALSE, show.result = FALSE,
  margin.left = 4)

Arguments

data

[data.frame]
Data to summarize. Columns can be of type numeric, integer, logical, factor or character. Characters and logicals will be treated as factors.

dataset.name

[ReportTaskObj]
The name of the data set

show.plot

[logical(1)]
A logic value set to FALSE as default.

show.result

[logical(1)]
A logic value set to FALSE as default.

margin.left

[numeric(1)]
A numeric value which defines the margin size of the left. For more information see par.

Value

A [naSumObj] with Names of the variables with their frequency of missing values and two additional plots which shows the position of the missing values (color = black) for each variable with NAs and the number of missing values as a bar plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 data("airquality")
 #create new columns
 set.seed(1217)
 airquality$new1 = sample(1:nrow(airquality))
 airquality$new2 = rnorm(nrow(airquality))
 #add more NAs
 idx = sample(1:nrow(airquality), size = 15)
 airquality[idx, c("new1", "new2")] = NA
 idx2 = sample(1:nrow(airquality), size = 7)
 airquality[idx2, "Temp"] = NA
 #create the NA summary
 na.summary = naSummary(data = airquality, show.plot = TRUE,
  show.result = FALSE, margin.left = 4, dataset.name = "Airquality")
 #plot the object through print
 na.summary
 #retrieve the elements through the components
 na.summary$nsum
 na.summary$image()

ptl93/AEDA documentation built on May 7, 2019, 3:20 p.m.