R/tidy_functions.R
tidy_functions.Rd
These function are deprecated to the benefit of the functions whose name
ends with an underscore _
(e.g., select()
-> svTidy::select_()
) in the
svTidy package.
The Tidyverse defines a coherent set of tools to manipulate
data frames that use a non-standard evaluation and sometimes require extra
care. These functions, like dplyr::mutate()
or dplyr::summarise()
are
defined in the {dplyr} and {tidyr} packages. When using variants, like
{dtplyr} for data.frame objects, or {dbplyr} to work with external
databases, successive commands in a pipeline are pooled together but not
computed. One has to dplyr::collect()
the result to get its final form.
Most of the tidy functions that have their "speedy" counterpart prefixed with
"s" are listed withlist_tidy_functions()
. Their main usages are (excluding
less used arguments, or those that are not compatibles with the speedy "s"
counterpart functions):
group_by(.data, ...)
ungroup(.data)
rename(.data, ...)
rename_with(.data, .fn, .cols = everything(), ...)
filter(.data, ...)
select(.data, ...)
mutate(.data, ..., .keep = "all")
transmute(.data, ...)
summarise(.data, ...)
full_join(x, y, by = NULL, suffix = c(".x", ".y"), copy = FALSE, ...)
left_join(x, y, by = NULL, suffix = c(".x", ".y"), copy = FALSE, ...)
right_join(x, y, by = NULL, suffix = c(".x", ".y"), copy = FALSE, ...)
inner_join(x, y, by = NULL, suffix = c(".x", ".y"), copy = FALSE, ...)
bind_rows(..., .id = NULL)
bind_cols(..., .name_repair = c("unique", "universal", "check_unique", "minimal"))
arrange(.data, ..., .by_group = FALSE)
count(x, ..., wt = NULL, sort = FALSE, name = NULL)
tally(x, wt = NULL, sort = FALSE, name = NULL)
add_count(x, ..., wt = NULL, sort = FALSE, name = NULL)
add_tally(x, wt = NULL, sort = FALSE, name = NULL)
pull(.data, var = -1, name = NULL)
distinct(.data, ..., .keep_all = FALSE)
drop_na(data, ...)
replace_na(data, replace)
pivot_longer(data, cols, names_to = "name", values_to = "value")
pivot_wider(data, names_from = name, values_from = value)
uncount(data, weights, .remove = TRUE, .id = NULL)
unite(data, col, ..., sep = "_", remove = TRUE, na.rm = FALSE)
separate(data, col, into, sep = "[^[:alnum:]]+", remove = TRUE, convert = FALSE)
separate_rows(data, ..., sep = "[^[:alnum:].]+", convert = FALSE)
fill(data, ..., .direction = c("down", "up", "downup", "updown"))
extract(data, col, into, regex = "([[:alnum:]]+)", remove = TRUE, convert = FALSE)
plus the functions defined here under.
list_tidy_functions()
filter_ungroup(.data, ...)
mutate_ungroup(.data, ..., .keep = "all")
transmute_ungroup(.data, ...)
A data frame, data frame extension (e.g. a tibble), or a lazy
data frame (e.g. from dbplyr or dtplyr). See dplyr::mutate()
for more
details.
Arguments dependent to the context of the function and most of the time, not evaluated in a standard way (cf. the tidyverse approach).
Which columns to keep. The default is "all"
, possible values
are "used"
, "unused"
, or "none"
(see dplyr::mutate()
).
See corresponding "non-t" function for the full help page with
indication of the return values. list_tidy_functions()
returns a list of
all the tidy(verse) functions that have their speedy "s" counterpart, see
speedy_functions.
The help page here is very basic and it aims mainly to list all the
tidy functions. For more complete help, see the {dplyr} or {tidyr}
packages. From {dplyr}, the slice()
and slice_xxx()
functions are not
added yet because they are not available for {dbplyr}. Also
dplyr::anti_join()
, dplyr::semi_join()
and dplyr::nest_join()
are not
implemented yet. From {dplyr}, the dplyr::slice()
and slice_xxx()
functions are not added yet because they are not available for {dbplyr}.
From {tidyr} tidyr::expand()
, tidyr::chop()
, tidyr::unchop()
,
tidyr::nest()
, tidyr::unnest()
, tidyr::unnest_longer()
,
tidyr::unnest_wider()
, tidyr::hoist()
, tidyr::pack()
and
tidyr::unpack()
are not implemented yet.
collapse::num_vars()
to easily keep only numeric columns from a
data frame, collapse::fscale()
for scaling and centering matrix-like
objects and data frames.
# TODO...