trim.data: Truncate data

Description Usage Arguments Details Value Examples

View source: R/interface.R

Description

The function truncates the data (deletes low- and high-x information).

Usage

1
trim.data(data, x.min, x.max)

Arguments

data

an object of type data. See set.data for details.

x.min, x.max

numeric values determining the region to keep.

Details

Frequently, the experimental data need to be truncated to remove unwanted ranges.

Value

an object of type data with all functions cropped to the region [x.min, x.max]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# prepare data
x <- seq(0, 50, 0.01)
y <- .8*exp(-x)*x^4 
dat <- list(x=x, y=y)
# truncate
dat <- trim.data(dat, 1, 25)
# plot results
plot(x,y,t="l",lwd=4, col=4)
lines(dat$x, dat$y, lwd=4, col=2)
legend(15,3,c("initial", "truncated"), lty=1, col=c(4,2))

BBEST documentation built on Jan. 8, 2021, 2:22 a.m.