slide | R Documentation |
This functions shifts the value range of a numeric variable, so that the new range starts at a given value.
slide(x, ...)
## S3 method for class 'numeric'
slide(x, lowest = 0, ...)
## S3 method for class 'data.frame'
slide(
x,
select = NULL,
exclude = NULL,
lowest = 0,
append = FALSE,
ignore_case = FALSE,
regex = FALSE,
verbose = TRUE,
...
)
x |
A data frame or numeric vector. |
... |
not used. |
lowest |
Numeric, indicating the lowest (minimum) value when converting factors or character vectors to numeric values. |
select |
Variables that will be included when performing the required tasks. Can be either
If |
exclude |
See |
append |
Logical or string. If |
ignore_case |
Logical, if |
regex |
Logical, if |
verbose |
Toggle warnings. |
x
, where the range of numeric variables starts at a new value.
select
argumentFor most functions that have a select
argument (including this function),
the complete input data frame is returned, even when select
only selects
a range of variables. That is, the function is only applied to those variables
that have a match in select
, while all other variables remain unchanged.
In other words: for this function, select
will not omit any non-included
variables, so that the returned data frame will include all variables
from the input data frame.
Functions to rename stuff: data_rename()
, data_rename_rows()
, data_addprefix()
, data_addsuffix()
Functions to reorder or remove columns: data_reorder()
, data_relocate()
, data_remove()
Functions to reshape, pivot or rotate data frames: data_to_long()
, data_to_wide()
, data_rotate()
Functions to recode data: rescale()
, reverse()
, categorize()
,
recode_values()
, slide()
Functions to standardize, normalize, rank-transform: center()
, standardize()
, normalize()
, ranktransform()
, winsorize()
Split and merge data frames: data_partition()
, data_merge()
Functions to find or select columns: data_select()
, extract_column_names()
Functions to filter rows: data_match()
, data_filter()
# numeric
head(mtcars$gear)
head(slide(mtcars$gear))
head(slide(mtcars$gear, lowest = 10))
# data frame
sapply(slide(mtcars, lowest = 1), min)
sapply(mtcars, min)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.