Skip to contents

Recode and transform data

data_cut()
Recode (or "cut") data into groups of values.
data_recode()
Recode old values of variables into new values
data_rescale() change_scale()
Rescale Variables to a New Range
data_reverse() reverse_scale()
Reverse-Score Variables
data_shift()
Shift numeric value range
adjust() data_adjust()
Adjust data for the effect of other variable(s)
center() centre()
Centering (Grand-Mean Centering)
demean() degroup() detrend()
Compute group-meaned and de-meaned variables
normalize() unnormalize()
Normalize numeric variable to 0-1 range
ranktransform()
(Signed) rank transformation
rescale_weights()
Rescale design weights for multilevel analysis
standardize() standardise() unstandardize() unstandardise()
Standardization (Z-scoring)
standardize(<default>)
Re-fit a model with standardized data
winsorize()
Winsorize data

Reshape data

data_rotate() data_transpose()
Rotate a data frame
data_to_wide() reshape_wider()
Reshape (pivot) data from long to wide
data_to_long() reshape_longer()
Reshape (pivot) data from wide to long
reshape_ci()
Reshape CI between wide/long formats

Select and filter data

data_extract()
Extract one or more columns or elements from an object
data_match() data_filter()
Return filtered or sliced data frame, or row indices
find_columns() data_find() get_columns() data_select()
Find or get columns in a data frame based on search patterns

Rename data

Reorder and remove data

data_relocate() data_reorder() data_remove()
Relocate (reorder) columns of a data frame
empty_columns() empty_rows() remove_empty_columns() remove_empty_rows() remove_empty()
Return or remove variables or observations that are completely missing

Convert and replace data

data_to_numeric() convert_data_to_numeric()
Convert data to numeric
to_numeric()
Convert to Numeric (if possible)
data_to_factor()
Convert data to factors
data_restoretype()
Restore the type of columns according to a reference data frame
replace_nan_inf()
Convert infinite or NaN values into NA
convert_na_to()
Replace missing values in a variable or a dataframe.
convert_to_na()
Convert non-missing values in a variable into missing values.

Split and merge data

data_merge() data_join()
Merge (join) two data frames, or a list of data frames
data_partition()
Partition data

Read (import) data

data_read()
Read (import) data files from various sources

Data properties

data_tabulate()
Create frequency tables of variables
describe_distribution()
Describe a distribution
distribution_mode()
Compute mode for a statistical distribution
skewness() kurtosis() print(<parameters_kurtosis>) print(<parameters_skewness>) summary(<parameters_skewness>) summary(<parameters_kurtosis>)
Compute Skewness and (Excess) Kurtosis
smoothness()
Quantify the smoothness of a vector
weighted_mean() weighted_median() weighted_sd() weighted_mad()
Weighted Mean, Median, SD, and MAD

Utilities

data_group() data_ungroup()
Create a grouped data frame
rownames_as_column() column_as_rownames()
Tools for working with row names
row_to_colnames() colnames_to_row()
Tools for working with column names
reexports
Objects exported from other packages
find_columns() data_find() get_columns() data_select()
Find or get columns in a data frame based on search patterns

Text formatting helpers

Visualization helpers

visualisation_recipe()
Prepare objects for visualisation

Data

efc
Sample dataset from the EFC Survey
nhanes_sample
Sample dataset from the National Health and Nutrition Examination Survey