| add_data | R Documentation |
Adds data values to a given data vector x.
add_data(x, box, n = c(0, 1), range = c(0, 1))
x |
numeric: data vector |
box |
character or numeric: basic box used |
n |
numeric: number of data values on the left, the right or both sides of |
range |
numeric: determines the range where the additional data values will be drawn from (default: |
Based on the data x or the range(box) a box is computed.
The length aof the box gives the multiplier for the range.
Then a left and right interval from which the additional values are drawn uniformly is computed:
[left box value-range[2]*box length; left box value-range[1]*box length] (left interval) and
[right box value+range[1]*box length; right box value+range[2]*box length] (right interval).
For box can be used also "boxplot" and quantile(x, c(0.25, 0.75), na.rm=TRUE) is used or
"range" and range(x, na.rm=TRUE) is used.
n can be a single number which will add n data values at the right side of x.
If n is a vector of length two then n[1] data values will be added at the left side of x and
n[2] data values will be added at the right side of x.
a data vectors with new values
x <- rnorm(8)
# add one value to the right
add_data(x, "box", range=1.5)
add_data(x, "range", range=0.1)
add_data(x, "box", range=c(1.5, 3))
# add two values to the right
add_data(x, "range", n=2, range=0.1)
# add two values to the left and three to the right
add_data(x, "range", n=c(2,3), range=0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.