shift {scan} | R Documentation |
Shift values in a single-case data file
Description
This function has been superseded by the much more versatile
transform.scdf
function.
Shifting the values might be helpful in cases where the measurement time
is given as a time variable (see example below).
Usage
shift(data, value, var)
Arguments
data |
A single-case data frame. See |
value |
Number by which to shift the values |
var |
Character string with the name of the target variable. Defaults to the measurement time variable. |
Value
A scdf with shifted data
See Also
Other data manipulation functions:
add_l2()
,
as.data.frame.scdf()
,
as_scdf()
,
fill_missing()
,
moving_median()
,
outlier()
,
ranks()
,
rescale()
,
scdf()
,
select_cases()
,
set_vars()
,
smooth_cases()
,
standardize()
,
truncate_phase()
Examples
### Shift the measurement time for a better estimation of the intercept
ex <- shift(example_A24, value = -1996)
plm(ex)
# Please use transform instead:
example_A24 |>
transform(year = year - 1996) |>
plm()
[Package scan version 0.65.1 Index]