inst/virtual_patient_simulator/bs4/patient_selector.R

patient_selector <- function() {
  # read the datas folder and 
  # find the number of patients
  data_folder <- paste0(getwd(), "/www/patients_datas")
  file_list <- list.files(data_folder)
  n_patients <- length(file_list)
  
  # generate a random number
  random_patient <- sample(1:n_patients, 1)
  readRDS(file = paste0(data_folder, "/", "patient_", random_patient, ".rds"))
}

Try the CaPO4Sim package in your browser

Any scripts or data that you put into this service are public.

CaPO4Sim documentation built on March 21, 2021, 9:06 a.m.