generalize.hz: Generalize Horizon Names

Description Usage Arguments Value Author(s) References Examples

View source: R/generalize.hz.R

Description

Generalize a vector of horizon names, based on new classes, and REGEX patterns.

Usage

1
generalize.hz(x, new, pat, non.matching.code, hzdepm)

Arguments

x

a character vector of horizon names

new

a character vector of new horizon classes

pat

a character vector of REGEX, same length as x

non.matching.code

text used to describe any horizon not matching any item in pat

hzdepm

a numeric vector of horizon mid-points, must not contain NA, same length as x

Value

factor of the same length as x

Author(s)

Dylan E. Beaudette

References

http://casoilresource.lawr.ucdavis.edu/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(sp1)

# check original distribution of hz designations
table(sp1$name)

# generalize
sp1$genhz <- generalize.hz(sp1$name, 
new=c('O','A','B','C','R'), 
pat=c('O', '^A','^B','C','R'))

# see how we did / what we missed
table(sp1$genhz, sp1$name)

aqp documentation built on Nov. 17, 2017, 4:35 a.m.