Description Usage Arguments Value Note Author(s) Examples
The function fits linear models to a subset of data that is interactively selected from a scatter plot.
1 2 |
df |
A data frame with columns specified in the other arguments. |
time |
Name of the column of |
value |
Name of the column of |
keys |
Name(s) of the column(s) of |
trans |
A function that is applied to the data in the |
ylim |
A numeric vector of length 2 specifying the lower and upper limit
for the value axis, respectively. Note that the values must be supplied in
the transformed scale if |
A data frame with one row for each unique combination of the key
columns of df
. The number of columns is length(keys)
plus 5.
The contents of the additional columns is as follows:
slope.default: Slope of linear model fitted with lm
slope.robust: Slope of linear model fitted with lmRob
used.points: Number of points selected for fitting
time.first: Time coordinate of first (earliest) point selected
time.last: Time coordinate of last (latest) point selected
A plot is created for each subset of the data and the user is asked to select a (time) range on the x-axis by two sebsequent clicks with the left mouse button. The selected data points are highlighted and the fitted models are displayed. The selection can be corrected by repeating the two subsequent left-clicks. A click with the right mouse button (or pressing the 'finish' button in Rstudio) accepts the current result and the process continues with the next subset of the data (i.e. the next plot). The results is returned after all subsets were processed. Since the function does not return intermediate output you better call it for smaller data sets (e.g. < 100 plots) only. This avoids the loss of too much manual work in case of a crash, blackout, ...
David Kneis david.kneis@tu-dresden.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
d <- read.table(header=TRUE, sep="", text='
ID time value
1 1 1
1 2 10
1 3 150
1 4 900
2 1 NA
2 2 NA
2 3 NA
3 1 2
3 2 33
3 3 180
3 4 3500
')
print(lift(d))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.