Learn R Programming

⚠️There's a newer version (1.2.2) of this package.Take me there.

It is useful to be able to simulate data with a specified structure. The faux package provides some functions to make this process easier. See the package website for more details.

Installation

You can install the released version of faux from CRAN with:

install.packages("faux")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("debruine/faux")

Please note that the 'faux' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('faux')

Monthly Downloads

1,023

Version

1.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Lisa DeBruine

Last Published

February 6th, 2023

Functions in faux (1.2.0)

add_between

Add between factors
binom2norm

Convert binomial to normal
beta2norm

Convert beta to normal
cormat_from_triangle

Make Correlation Matrix from Triangle
cell_combos

Cell combos
distfuncs

Get distribution functions
contr_code_poly

Polynomial code a factor
check_design

Validates the specified design
add_contrast

Add a contrast to a data frame
add_ranef

Add random effects to a data frame
faux

faux: Simulation Functions.
average_r2tau_0

Average r to Random Intercept SD
faux_options

Set/get global faux options
contr_code_difference

Difference code a factor
get_design_long

Get design from long data
contr_code_helmert

Helmert code a factor
get_params

Get parameters from a data table
contr_code_sum

Sum code a factor
get_coefs

Get Coefficients from Data
add_random

Add random factors to a data structure
add_recode

Recode a categorical column
is_pos_def

Check a Matrix is Positive Definite
get_design

Get design
convert_r

Convert r for NORTA
codebook_interactive

Interactive Codebook
json_design

Convert design to JSON
cormat

Make a correlation matrix
long2wide

Convert data from long to wide format
contr_code_anova

Anova code a factor
check_mixed_design

Get random intercepts for subjects and items
make_id

Make ID
pos_def_limits

Limits on Missing Value for Positive Definite Matrix
plikert

Likert distribution function
dlikert

Likert density function
plot_design

Plot design
contr_code_treatment

Treatment code a factor
convert_param

Convert parameter
faceratings

Attractiveness ratings of faces
print.nested_list

Print Nested List
print.psychds_codebook

Print Codebook Object
norm2pois

Convert normal to poisson
getcols

Get data columns
print.design

Print Design List
interactive_design

Set design interactively
fr4

Attractiveness rating subset
nested_list

Output a nested list in RMarkdown list format
rnorm_multi

Multiple correlated normal distributions
norm2trunc

Convert normal to truncated normal
qlikert

Likert quantile function
rnorm_pre

Make a normal vector correlated to existing vectors
codebook

Create PsychDS Codebook from Data
std_alpha2average_r

Standardized Alpha to Average R
gamma2norm

Convert gamma to normal
norm2binom

Convert normal to binomial
sim_mixed_cc

Generate a cross-classified sample
norm2beta

Convert normal to beta
rlikert

Random Likert distribution
trunc2norm

Convert truncated normal to normal
readline_check

Check readline input
fh_bounds

Get Fréchet-Hoefding bounds
norm2gamma

Convert normal to gamma
fix_name_labels

Fix name labels
norm2unif

Convert normal to uniform
sim_mixed_df

Generate a mixed design from existing data
%>%

Pipe operator
sim_df

Simulate an existing dataframe
rmulti

Multiple correlated distributions
message

Less scary green messages
messy

Simulate missing data
sim_joint_dist

Simulate category joint distribution
wide2long

Convert data from wide to long format
norm2likert

Convert normal to likert
norm2norm

Convert normal to normal
unif2norm

Convert uniform to normal
sample_from_pop

Sample Parameters from Population Parameters
unique_pairs

Make unique pairs of level names for correlations
set_design

Set design
sim_data

Simulate data from design (internal)
sim_design

Simulate data from design
OR

Piped OR
add_within

Add within factors