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("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,624

Version

1.2.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Lisa DeBruine

Last Published

January 15th, 2025

Functions in faux (1.2.2)

contr_code_poly

Polynomial code a factor
average_r2tau_0

Average r to Random Intercept SD
codebook_interactive

Interactive Codebook
contr_code_difference

Difference code a factor
contr_code_helmert

Helmert code a factor
check_mixed_design

Get random intercepts for subjects and items
faux

faux: Simulation Functions.
contr_code_sum

Sum code a factor
contr_code_anova

Anova code a factor
contr_code_treatment

Treatment code a factor
convert_param

Convert parameter
faux_options

Set/get global faux options
check_design

Validates the specified design
cormat_from_triangle

Make Correlation Matrix from Triangle
cell_combos

Cell combos
codebook

Create PsychDS Codebook from Data
convert_r

Convert r for NORTA
cormat

Make a correlation matrix
distfuncs

Get distribution functions
get_design_long

Get design from long data
get_design

Get design
norm2beta

Convert normal to beta
nested_list

Output a nested list in RMarkdown list format
get_coefs

Get Coefficients from Data
make_id

Make ID
faceratings

Attractiveness ratings of faces
get_contrast_vals

Get contrast values
dlikert

Likert density function
gamma2norm

Convert gamma to normal
fr4

Attractiveness rating subset
nbinom2norm

Convert negative binomial to normal
messy

Simulate missing data
get_params

Get parameters from a data table
message

Less scary green messages
getcols

Get data columns
norm2unif

Convert normal to uniform
norm2trunc

Convert normal to truncated normal
interactive_design

Set design interactively
is_pos_def

Check a Matrix is Positive Definite
norm2likert

Convert normal to likert
fh_bounds

Get Fréchet-Hoefding bounds
fix_name_labels

Fix name labels
json_design

Convert design to JSON
norm2norm

Convert normal to normal
long2wide

Convert data from long to wide format
norm2pois

Convert normal to poisson
plikert

Likert distribution function
print.design

Print Design List
print.nested_list

Print Nested List
%>%

Pipe operator
rmulti

Multiple correlated distributions
norm2gamma

Convert normal to gamma
norm2binom

Convert normal to binomial
rnorm_multi

Multiple correlated normal distributions
sim_mixed_df

Generate a mixed design from existing data
plot_design

Plot design
set_design

Set design
rnorm_pre

Make a normal vector correlated to existing vectors
sim_data

Simulate data from design (internal)
pos_def_limits

Limits on Missing Value for Positive Definite Matrix
std_alpha2average_r

Standardized Alpha to Average R
trunc2norm

Convert truncated normal to normal
print.psychds_codebook

Print Codebook Object
norm2nbinom

Convert normal to negative binomial
sample_from_pop

Sample Parameters from Population Parameters
readline_check

Check readline input
rlikert

Random Likert distribution
sim_joint_dist

Simulate category joint distribution
unique_pairs

Make unique pairs of level names for correlations
sim_mixed_cc

Generate a cross-classified sample
sim_design

Simulate data from design
unif2norm

Convert uniform to normal
qlikert

Likert quantile function
wide2long

Convert data from wide to long format
sim_df

Simulate an existing dataframe
add_recode

Recode a categorical column
add_within

Add within factors
add_ranef

Add random effects to a data frame
OR

Piped OR
beta2norm

Convert beta to normal
binom2norm

Convert binomial to normal
add_between

Add between factors
add_random

Add random factors to a data structure
add_contrast

Add a contrast to a data frame