## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = FALSE,
  message = FALSE
)

## ----setup--------------------------------------------------------------------
library(CGMissingDataR)

## ----launch-app, eval = FALSE-------------------------------------------------
# run_app()

## ----launch-app-development, eval = FALSE-------------------------------------
# devtools::load_all()
# run_app()

## ----python-requirements, eval = FALSE----------------------------------------
# install.packages("reticulate")
# 
# reticulate::py_require(c(
#   "numpy",
#   "pandas",
#   "scikit-learn",
#   "statsmodels",
#   "xgboost"
# ))
# 
# # Optional, only needed for models = "lightgbm"
# reticulate::py_install("lightgbm", pip = TRUE)

## ----app-equivalent-call, eval = FALSE----------------------------------------
# out <- run_missing_glucose_imputation(
#   data = uploaded_data,
#   target_col = selected_target_col,
#   feature_cols = selected_feature_cols,
#   id_col = selected_id_col,
#   time_col = selected_time_col,
#   imputer_backend = selected_backend,
#   models = selected_method,
#   use_arima_if_missing_leq = selected_threshold,
#   xgb_nrounds = selected_xgb_rounds,
#   rf_n_estimators = selected_rf_trees,
#   knn_k = selected_knn_neighbors,
#   lgb_nrounds = selected_lightgbm_rounds,
#   n_threads = selected_threads,
#   seed = selected_seed,
#   export = FALSE
# )

## ----preview-logic, eval = FALSE----------------------------------------------
# imputed_rows <- out[is.na(out[[target_col]]), , drop = FALSE]
# head(imputed_rows, 15)

