R: Data and Variable Transformation Functions

# Data and Variable Transformation Functions

## Documentation for package ‘sjmisc’ version 2.8.11

- DESCRIPTION file
- User guides, package vignettes and other documentation
- Package NEWS
- Package README

## Help Pages

sjmisc-package | Data and Variable Transformation Functions
%nin% | Value matching
add_case | Add variables or cases to data frames
add_columns | Add or replace data frame columns
add_id | Add or replace data frame columns
add_rows | Merge labelled data frames
add_variables | Add variables or cases to data frames
all_na | Check if vector only has NA values
big_mark | Format numbers
center | Standardize and center variables
center_if | Standardize and center variables
clean_values | Clean values of character vectors.
col_count | Count row or column indices
complete_cases | Check if variables or cases have missing / infinite values
complete_vars | Check if variables or cases have missing / infinite values
count_na | Frequency table of tagged NA values
descr | Basic descriptive statistics
de_mean | Compute group-meaned and de-meaned variables
dicho | Dichotomize variables
dicho_if | Dichotomize variables
efc | Sample dataset from the EUROFAMCARE project
empty_cols | Return or remove variables or observations that are completely missing
empty_rows | Return or remove variables or observations that are completely missing
find_in_data | Find variable by name or label
find_var | Find variable by name or label
flat_table | Flat (proportional) tables
frq | Frequency table of labelled variables
group_labels | Recode numeric variables into equal-ranged groups
group_labels_if | Recode numeric variables into equal-ranged groups
group_str | Group near elements of string vectors
group_var | Recode numeric variables into equal-ranged groups
group_var_if | Recode numeric variables into equal-ranged groups
has_na | Check if variables or cases have missing / infinite values
incomplete_cases | Check if variables or cases have missing / infinite values
incomplete_vars | Check if variables or cases have missing / infinite values
is_crossed | Check whether two factors are crossed or nested
is_cross_classified | Check whether two factors are crossed or nested
is_empty | Check whether string, list or vector is empty
is_even | Check whether value is even or odd
is_float | Check if a variable is of (non-integer) double type or a whole number
is_nested | Check whether two factors are crossed or nested
is_num_chr | Check whether a factor has numeric levels only
is_num_fac | Check whether a factor has numeric levels only
is_odd | Check whether value is even or odd
is_whole | Check if a variable is of (non-integer) double type or a whole number
merge_df | Merge labelled data frames
merge_imputations | Merges multiple imputed data frames into a single data frame
move_columns | Move columns to other positions in a data frame
numeric_to_factor | Convert numeric vectors into factors associated value labels
prcn | Format numbers
rec | Recode variables
recode_to | Recode variable categories into new values
recode_to_if | Recode variable categories into new values
rec_if | Recode variables
rec_pattern | Create recode pattern for 'rec' function
ref_lvl | Change reference level of (numeric) factors
remove_cols | Remove variables from a data frame
remove_empty_cols | Return or remove variables or observations that are completely missing
remove_empty_rows | Return or remove variables or observations that are completely missing
remove_var | Remove variables from a data frame
rename_columns | Rename variables
rename_variables | Rename variables
replace_columns | Add or replace data frame columns
replace_na | Replace NA with specific values
reshape_longer | Reshape data into long format
rotate_df | Rotate a data frame
round_num | Round numeric variables in a data frame
row_count | Count row or column indices
row_means | Row sums and means for data frames
row_means.default | Row sums and means for data frames
row_means.mids | Row sums and means for data frames
row_sums | Row sums and means for data frames
row_sums.default | Row sums and means for data frames
row_sums.mids | Row sums and means for data frames
seq_col | Sequence generation for column or row counts of data frames
seq_row | Sequence generation for column or row counts of data frames
set_na_if | Replace specific values in vector with NA
shorten_string | Shorten character strings
sjmisc | Data and Variable Transformation Functions
split_var | Split numeric variables into smaller groups
split_var_if | Split numeric variables into smaller groups
spread_coef | Spread model coefficients of list-variables into columns
std | Standardize and center variables
std_if | Standardize and center variables
str_contains | Check if string contains pattern
str_end | Find start and end index of pattern in string
str_find | Find partial matching and close distance elements in strings
str_start | Find start and end index of pattern in string
tidy_values | Clean values of character vectors.
total_mean | Row sums and means for data frames
to_dummy | Split (categorical) vectors into dummy variables
to_long | Convert wide data to long format
to_value | Convert factors to numeric variables
trim | Trim leading and trailing whitespaces from strings
typical_value | Return the typical value of a vector
var_rename | Rename variables
var_type | Determine variable type
word_wrap | Insert line breaks in long labels
zap_inf | Convert infiite or NaN values into regular NA