Learn R Programming

faux

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("scienceverse/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

6,007

Version

1.2.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Lisa DeBruine

Last Published

October 1st, 2025

Functions in faux (1.2.3)

cormat_from_triangle

Make Correlation Matrix from Triangle
contr_code_poly

Polynomial code a factor
contr_code_treatment

Treatment code a factor
faux_options

Set/get global faux options
contr_code_sum

Sum code a factor
get_design

Get design
convert_param

Convert parameter
get_design_long

Get design from long data
faux

faux: Simulation Functions.
long2wide

Convert data from long to wide format
is_pos_def

Check a Matrix is Positive Definite
json_design

Convert design to JSON
getcols

Get data columns
get_params

Get parameters from a data table
interactive_design

Set design interactively
make_id

Make ID
get_coefs

Get Coefficients from Data
get_contrast_vals

Get contrast values
dlikert

Likert density function
faceratings

Attractiveness ratings of faces
message

Less scary green messages
cormat

Make a correlation matrix
nested_list

Output a nested list in RMarkdown list format
fh_bounds

Get Fréchet-Hoefding bounds
messy

Simulate missing data
rmulti

Multiple correlated distributions
rnorm_multi

Multiple correlated normal distributions
norm2beta

Convert normal to beta
fix_name_labels

Fix name labels
rnorm_pre

Make a normal vector correlated to existing vectors
sample_from_pop

Sample Parameters from Population Parameters
norm2trunc

Convert normal to truncated normal
fr4

Attractiveness rating subset
distfuncs

Get distribution functions
norm2gamma

Convert normal to gamma
set_design

Set design
trunc2norm

Convert truncated normal to normal
norm2binom

Convert normal to binomial
sim_data

Simulate data from design (internal)
qlikert

Likert quantile function
norm2unif

Convert normal to uniform
print.psychds_codebook

Print Codebook Object
sim_joint_dist

Simulate category joint distribution
print.nested_list

Print Nested List
sim_mixed_cc

Generate a cross-classified sample
print.design

Print Design List
nbinom2norm

Convert negative binomial to normal
norm2norm

Convert normal to normal
unif2norm

Convert uniform to normal
unique_pairs

Make unique pairs of level names for correlations
wide2long

Convert data from wide to long format
std_alpha2average_r

Standardized Alpha to Average R
sim_mixed_df

Generate a mixed design from existing data
plikert

Likert distribution function
%>%

Pipe operator
gamma2norm

Convert gamma to normal
norm2pois

Convert normal to poisson
readline_check

Check readline input
sim_design

Simulate data from design
rlikert

Random Likert distribution
plot_design

Plot design
norm2likert

Convert normal to likert
norm2nbinom

Convert normal to negative binomial
pos_def_limits

Limits on Missing Value for Positive Definite Matrix
sim_df

Simulate an existing dataframe
add_random

Add random factors to a data structure
add_ranef

Add random effects to a data frame
binom2norm

Convert binomial to normal
add_between

Add between factors
OR

Piped OR
add_contrast

Add a contrast to a data frame
add_within

Add within factors
beta2norm

Convert beta to normal
add_recode

Recode a categorical column
average_r2tau_0

Average r to Random Intercept SD
contr_code_difference

Difference code a factor
check_mixed_design

Get random intercepts for subjects and items
check_design

Validates the specified design
contr_code_anova

Anova code a factor
cell_combos

Cell combos
codebook_interactive

Interactive Codebook
contr_code_helmert

Helmert code a factor
convert_r

Convert r for NORTA
codebook

Create PsychDS Codebook from Data