coefa_read {coefa}R Documentation

Obtain the factor loading matrices in the original study and delete Na value

Description

The data containing xlsx files(or txt files,or csv files)in the given path will be extracted by this function and imported into R.These data files are stored as a list in which the matrices in each file is stored in order(the order in which the files are displayed in the folder).In this step,the missing values of factor loading matrices from the original study stored in multiple xlsx files will be set the value of 0.

Usage

coefa_read(type=c("xlsx","txt","csv"),manual=FALSE)

Arguments

type

File type to extract

manual

The way to read the data.

Details

This function is mainly used to read xlsx files from a folder into R. In this process,the missing values in the xlsx files(or txt file,or csv files) will be set to 0.The options of the "type" parameter can be "xlsx", "txt", "csv".It should be noted that the folder containing data files should be in current workspace.If it is not in the current workspace, the setwd() function needs to be used to set its path.An important point is that all files in your folder should use the same format, for instance, all of them are the xlsx files(or txt files,or csv files).

The default "manual" parameter of this function is FALSE.When the "manual" is TRUE, the function will not automatically read files. you will need to choose other ways to manually input the data and put them in a list to ensure that the subsequent functions of 'coefa' can work. You can get more information about functions in the readme and vignettes in this package.

Value

a list containing all factor loading matrices without NA.

Examples

#The following only shows a case of manual reading.
#we recommend coefa_read(type="xlsx",manual=FALSE).
#You can get more information about functions in the readme and vignettes of this package.
coefa_read(manual=TRUE)

[Package coefa version 1.0.3 Index]