Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umx_read_prolific_demog

Read and optionally merge demographics file from prolific academic


Description

prolific academic provides a demographics file. This reads it and merges with your data using PID and participant_id

Usage

umx_read_prolific_demog(
  file,
  base = "",
  df = NULL,
  verbose = FALSE,
  by.df = "PID",
  by.demog = "participant_id",
  vars = c("age", "Sex"),
  all.df = TRUE,
  all.demog = FALSE
)

Arguments

file

Path to a file to read.

base

Optional path to folder

df

Optional existing datafile

verbose

Whether to print names in the file.

by.df

The ID name in your datafile (default = "PID")

by.demog

The ID name in the prolific demographics file (default = "participant_id")

vars

Vars to keep from demographics file (default = age & Sex)

all.df

Whether to keep all lines of df (default = TRUE)

all.demog

Whether to keep all lines (people) in the demographics file (default = FALSE)

Value

References

See Also

Examples

## Not run: 
fp = "~/Desktop/prolific_export_5f20c3e662e3b6407dcd37a5.csv"
df = umx_read_prolific_demog(fp, df = df)
tmp = umx_read_prolific_demog(demog= fp, base = "", df = NULL, verbose = FALSE)

## End(Not run)

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.