Description Usage Arguments Value Examples
Two inputs are needed, the path to the data file (data_file) and a data frame with information on variables to use (var_info; see [load_var_info]).
Only variables with entries in var_info are kept (accounting for the possibility that some are left/right variables).
1 | load_cp_data(data_file, var_info)
|
data_file |
The .csv data file |
var_info |
The data frame with variable information (see [load_var_info]) |
A named list containing 1) a data frame containing the cumulative probit data ("cp_df") and 2) the cumulative probit problem file ("problem")
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Load data file path from package yada
data_file <- syanalysis_name.file("extdata","US.csv",package="yada")
print(data_file)
# Load var_info_file from package yada
var_info_file <- syanalysis_name.file("extdata","US_var_info.csv",package="yada")
var_info <- load_var_info(var_info_file) # load var info file as data frame
head(var_info)
# Call load_cp_data to format data and problem file for cumulative probit
cp_data <- load_cp_data(data_file, var_info)
head(cp_data$cp_df) # Top rows of cumulative probit data frame
head(cp_data$problem) # cumulative probit problem as list
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.