# NOT RUN {
dat <- data.frame(id = 1:5,
x = c(NA, 2, 1, 5, 6),
y = c(5, 3, 6, 8, 2),
z = c(2, 1, 1, NA, 4), stringsAsFactors = FALSE)
# Write Mplus Data File and a text file with variable names
write.mplus(dat)
# Write Mplus Data File "Data.dat" and a text file with variable name,
# print variable names on the console, missing values coded with -999
write.mplus(dat, file = "Data.dat", print = TRUE, na = -999)
# }
Run the code above in your browser using DataLab