Description Usage Arguments Value
Observations needing the calculation of a cumulative sum, for instance in germination experiments, will require to be done by treatment, combining identifiers (e.g. treatment and repetition).
In the formula method you set in the left term the numeric variable which
has to be acummulated. Note that you can insert in the left term multiple
variables separating them by a plus symbol ('+'
).
On the right term you set the sorting variable (usually time, Date or
integer) as the first term followed by identifiers.
This function is checking the uniqueness of the temporal variable per treatment. For ties the function will retrieve an error message.
1 2 3 4 5 6 7 |
x |
A data frame containing or a formula, depending on the method. See the description above to design the formula. |
... |
Further arguments passed among methods. |
ids |
A character vector with the names of the variables used to identify every experimental object (usually the combination of treatment and repetition). |
vars |
A character vector with the names of the variables used to calculate the cumulative sum. |
by |
A character value used as temporal variable. |
suffix |
A character value added to the name of the variable in the output data frame. |
diff |
A logical value. If true, the lagged differences (function
|
data |
A data frame required in the formula method. |
The input data frame with the cumulative sums as additional variables. Note that the sorting of rows may change in the process.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.