missingDataGrid: Missing Data Grid

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/missingDataGrid.R

Description

Generate a levelplot of missing data from a SoilProfileCollection object.

Usage

1
2
missingDataGrid(s, max_depth, vars, filter.column = NULL, 
filter.regex = NULL, cols = NULL, ...)

Arguments

s

a SoilProfilecollection object

max_depth

integer specifying the max depth of analysis

vars

character vector of column names over which to evaluate missing data

filter.column

a character string naming the column to apply the filter REGEX to

filter.regex

a character string with a regular expression used to filter horizon data OUT of the analysis

cols

a vector of colors

...

additional arguments passed on to levelplot

Details

This function evaluates a 'missing data fraction' based on slice-wise evaulation of named variables in a SoilProfileCollection object.

Value

A data.frame describing the percentage of missing data by variable.

Note

A lattice graphic is printed to the active output device.

Author(s)

D.E. Beaudette

See Also

slice

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## visualizing missing data
# 10 random profiles
require(plyr)
s <- ldply(1:10, random_profile)

# randomly sprinkle some missing data
s[sample(nrow(s), 5), 'p1'] <- NA
s[sample(nrow(s), 5), 'p2'] <- NA
s[sample(nrow(s), 5), 'p3'] <- NA

# set all p4 and p5 attributes of `soil 1' to NA
s[which(s$id == '1'), 'p5'] <- NA
s[which(s$id == '1'), 'p4'] <- NA

# upgrade to SPC
depths(s) <- id ~ top + bottom

# plot missing data via slicing + levelplot
missingDataGrid(s, max_depth=100, vars=c('p1', 'p2', 'p3', 'p4', 'p5'), 
main='Missing Data Fraction')

aqp documentation built on May 31, 2017, 2:24 a.m.