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")

See the development version manual.

Please note that the [34m’faux’[39m 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,199

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Lisa DeBruine

Last Published

September 13th, 2021

Functions in faux (1.1.0)

cell_combos

Cell combos
contr_code_poly

Polynomial code a factor
add_random

Add random factors to a data structure
contr_code_sum

Sum code a factor
codebook

Create PsychDS Codebook from Data
fix_name_labels

Fix name labels
check_mixed_design

Get random intercepts for subjects and items
faux_options

Set/get global faux options
contr_code_treatment

Treatment code a factor
codebook_interactive

Interactive Codebook
contr_code_anova

Anova code a factor
messy

Simulate missing data
contr_code_difference

Difference code a factor
json_design

Convert design to JSON
fr4

Attractiveness rating subset
contr_code_helmert

Helmert code a factor
gamma2norm

Convert gamma to normal
getcols

Get data columns
get_params

Get parameters from a data table
norm2gamma

Convert normal to gamma
faceratings

Attractiveness ratings of faces
faux

faux: Simulation Functions.
norm2likert

Convert normal to likert
sample_from_pop

Sample Parameters from Population Parameters
is_pos_def

Check a Matrix is Positive Definite
interactive_design

Set design interactively
convert_param

Convert parameter
nested_list

Output a nested list in RMarkdown list format
cormat_from_triangle

Make Correlation Matrix from Triangle
get_design_long

Get design from long data
get_design

Get design
cormat

Make a correlation matrix
rnorm_multi

Multiple correlated normal distributions
pos_def_limits

Limits on Missing Value for Positive Definite Matrix
unif2norm

Convert uniform to normal
plot_design

Plot design
unique_pairs

Make unique pairs of level names for correlations
long2wide

Convert data from long to wide format
norm2unif

Convert normal to uniform
sim_data

Simulate data from design (internal)
sim_design

Simulate data from design
set_design

Set design
check_design

Validates the specified design
rnorm_pre

Make a normal vector correlated to existing vectors
norm2binom

Convert normal to binomial
std_alpha2average_r

Standardized Alpha to Average R
norm2beta

Convert normal to beta
trunc2norm

Convert truncated normal to normal
make_id

Make ID
message

Less scary green messages
sim_df

Simulate an existing dataframe
print.psychds_codebook

Print Codebook Object
%>%

Pipe operator
readline_check

Check readline input
sim_joint_dist

Simulate category joint distribution
wide2long

Convert data from wide to long format
norm2trunc

Convert normal to truncated normal
norm2pois

Convert normal to poisson
print.design

Print Design List
print.nested_list

Print Nested List
sim_mixed_cc

Generate a cross-classified sample
sim_mixed_df

Generate a mixed design from existing data
OR

Piped OR
add_recode

Recode a categorical column
add_within

Add within factors
add_ranef

Add random effects to a data frame
add_contrast

Add a contrast to a data frame
average_r2tau_0

Average r to Random Intercept SD
beta2norm

Convert beta to normal
binom2norm

Convert binomial to normal
add_between

Add between factors