read.mplus | R Documentation |
This function reads a Mplus data file and/or Mplus input/output file to return
a data frame with variable names extracted from the Mplus input/output file. Note
that by default -99
in the Mplus data file is replaced with to NA
.
read.mplus(file, sep = "", input = NULL, na = -99, print = FALSE, return.var = FALSE,
encoding = "UTF-8-BOM", check = TRUE)
file |
a character string indicating the name of the Mplus data
file with or without the file extension |
sep |
a character string indicating the field separator (i.e.,
delimiter) used in the data file specified in |
input |
a character string indicating the Mplus input ( |
na |
a numeric vector indicating values to replace with |
print |
logical: if |
return.var |
logical: if |
encoding |
character string declaring the encoding used on |
check |
logical: if |
A data frame containing a representation of the data in the file.
Takuya Yanagida takuya.yanagida@univie.ac.at
Muthen, L. K., & Muthen, B. O. (1998-2017). Mplus User's Guide (8th ed.). Muthen & Muthen.
read.dta
, write.dta
, read.sav
,
write.sav
, read.xlsx
, write.xlsx
## Not run:
# Example 1: Read Mplus data file and variable names extracted from the Mplus input file
dat <- read.mplus("Mplus_Data.dat", input = "Mplus_Input.inp")
# Example 2: Read Mplus data file and variable names extracted from the Mplus input file,
# print variable names on the console
dat <- read.mplus("Mplus_Data.dat", input = "Mplus_Input.inp", print = TRUE)
# Example 3: Read variable names extracted from the Mplus input file
varnames <- read.mplus(input = "Mplus_Input.inp", return.var = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.