#' PCA_prep
#' This function is meant to prepare the data before the PCA since all features need to be numeric
#' @return my_data_clean_PCA
#' @export
#'
#' @examples
PCA_prep <- function(){
my_data_clean_PCA <- select(my_data_clean , patient_cohort,age,sex, diagnosis ,stage , plasma_CA19_9,creatinine , LYVE1, REG1B, TFF1) %>%
mutate(patient_cohort = case_when(
patient_cohort == "Cohort1" ~ 0,
patient_cohort == "Cohort2" ~ 1),
diagnosis = case_when(
diagnosis == "control" ~ 0,
diagnosis == "benign" ~ 1,
diagnosis == "malignant" ~ 2),
sex = case_when(
sex == "Male" ~ 0,
sex == "Female" ~ 1),
stage = case_when(
stage == "IA" ~ 1,
stage == "IB" ~ 1,
stage == "IIA" ~ 2,
stage == "IIB" ~ 2,
stage == "III" ~ 3,
stage == "IV" ~ 4),
stage = replace_na(stage,0)) %>%
drop_na(REG1B, LYVE1, TFF1, plasma_CA19_9)
return(my_data_clean_PCA)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.