# \donttest{
# Create a dummy CSV file in a temporary directory for demonstration
temp_csv_path <- tempfile(fileext = ".csv")
dummy_data <- data.frame(
ID = paste0("Patient", 1:50),
Disease_Status = sample(c(0, 1), 50, replace = TRUE),
FeatureA = rnorm(50),
FeatureB = runif(50, 0, 100),
CategoricalFeature = sample(c("X", "Y", "Z"), 50, replace = TRUE)
)
write.csv(dummy_data, temp_csv_path, row.names = FALSE)
# Load and prepare data from the temporary file
prepared_data <- load_and_prepare_data_dia(
data_path = temp_csv_path,
label_col_name = "Disease_Status",
positive_label_value = 1,
negative_label_value = 0,
new_positive_label = "Case",
new_negative_label = "Control"
)
# Check prepared data structure
str(prepared_data$X)
table(prepared_data$y)
# Clean up the dummy file
unlink(temp_csv_path)
# }
Run the code above in your browser using DataLab