Learn R Programming

aqp (version 2.3)

rp: Generate a SoilProfileCollection of random profiles

Description

This function provides a convenient abstraction of lapply(), random_profile(), and combine() which are typically used together to create a SoilProfileCollection object with >1 soil profiles. rp() creates zero-padded integer IDs for logical sorting and indexing of profiles. For more complex IDs or additional flexibility, see random_profile(). See random_profile() for all possible arguments.

Usage

rp(size, prefix = NULL, ...)

Value

a SoilProfileCollection object

Arguments

size

integer, number of requested profiles

prefix

prefix added to zero-padded, integer IDs

...

additional arguments to random_profile()

Examples

Run this code

# generate a SoilProfileCollection object with 10 profiles
# using 0-padded, integer IDs for intuitive sorting
spc <- rp(10, method = 'LPP')
plotSPC(spc, color = 'p1')

# apply a prefix to the IDs
spc <- rp(10, prefix = 'A-', method = 'LPP')
plotSPC(spc, color = 'p1')

Run the code above in your browser using DataLab