Learn R Programming

EMMAgeo (version 0.9.4)

create.EM: Function to create grain-size-distributions.

Description

This function allows to create artificial grain-size-compositions. One such "artificial end-member loading" may be composed of one or more superimposed normal distributions.

Usage

create.EM(p1, p2, s, boundaries, n)

Arguments

p1

Numeric vector with means of normal distributions, i.e. mode positions.

p2

Numeric vector with standard deviations of normal distributions, i.e. mode width.

s

Numeric vector with relative proportions of each mode, i.e. relative mode height.

boundaries

Numeric vector of length 2 with class boundaries (i.e. c(lower boundary, upper boundary)).

n

Numeric scalar with number of classes, i.e. resolution of the end-member.

Value

Numeric vector with normalised end-member loadings, consisting of the mixed normal distributions according to the input parameters.

Details

When mixing individual artificial end member loadings, these should span over the same classes. Hence, boundaries and n should be the same for all end-member loadings. The function builds composites of individual normal distributions. Each distribution is scaled according to s. Finally the distribution is scaled to 100 %.

See Also

mix.EM

Examples

Run this code
# NOT RUN {
## set lower and upper class boundary, number of classes and class units
boundaries <- c(0, 11)
n <- 40
phi <- seq(from = boundaries[1],
           to = boundaries[2],
           length.out = n)

## create two artificial end-member loadings
EMa.1 <- create.EM(p1 = c(2, 5), p2 = c(1, 0.8), s = c(0.7, 0.3),
                   boundaries = boundaries, n = n)
EMa.2 <- create.EM(p1 = c(4, 7), p2 = c(1.1, 1.4), s = c(0.5, 0.5),
                   boundaries = boundaries, n = n)

## plot the two artificial end-member loadings
plot(phi, EMa.1, type = "l")
lines(phi, EMa.2, col = "red")
# }

Run the code above in your browser using DataLab