Commit 22652dec authored by wuzekai's avatar wuzekai

update

parent 0f3629ae
...@@ -12,15 +12,15 @@ COPY . /srv/shiny-server/ ...@@ -12,15 +12,15 @@ COPY . /srv/shiny-server/
COPY set_path.R /usr/local/lib/R/etc/Rprofile.site.d/00-radiant-path.R COPY set_path.R /usr/local/lib/R/etc/Rprofile.site.d/00-radiant-path.R
# 安装所有子模块 # 安装所有子模块
RUN R -e "remotes::install_local('/srv/shiny-server/radiant.data',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant.data',dependencies=TRUE, type='source', upgrade='never')"
RUN R -e "remotes::install_local('/srv/shiny-server/radiant.basics',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant.basics',dependencies=TRUE, type='source', upgrade='never')"
RUN R -e "remotes::install_local('/srv/shiny-server/radiant.model',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant.model',dependencies=TRUE, type='source', upgrade='never')"
RUN R -e "remotes::install_local('/srv/shiny-server/radiant.multivariate',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant.multivariate',dependencies=TRUE, type='source', upgrade='never')"
RUN R -e "remotes::install_local('/srv/shiny-server/radiant.design',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant.design',dependencies=TRUE, type='source', upgrade='never')"
RUN R -e "remotes::install_local('/srv/shiny-server/radiant.quickgen',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant.quickgen',dependencies=TRUE, type='source', upgrade='never')"
# 安装主 radiant 应用 # 安装主 radiant 应用
RUN R -e "remotes::install_local('/srv/shiny-server/radiant-master',dependencies=TRUE, type='source', upgrade='never',force=TRUE)" RUN R -e "remotes::install_local('/srv/shiny-server/radiant-master',dependencies=TRUE, type='source', upgrade='never')"
WORKDIR /data WORKDIR /data
CMD ["R", "-e", "radiant::radiant(host='0.0.0.0', port=3838)"] CMD ["R", "-e", "radiant::radiant(host='0.0.0.0', port=3838)"]
......
## ========== coxp_ui.R ========== ## ========== coxp_ui.R ==========
source(file.path("../../../R", "cox.R"))
## 1. 常量 ----------------------------------------------------------------- ## 1. 常量 -----------------------------------------------------------------
coxp_predict <- setNames(c("none", "data", "cmd", "datacmd"), coxp_predict <- setNames(c("none", "data", "cmd", "datacmd"),
...@@ -39,10 +38,10 @@ coxp_plot_inputs <- reactive({ list() }) ...@@ -39,10 +38,10 @@ coxp_plot_inputs <- reactive({ list() })
coxp_pred_inputs <- reactive({ coxp_pred_inputs <- reactive({
args <- coxp_pred_args args <- coxp_pred_args
# 收集所有预测参数(含新增的coxp_conf_lev) # 收集所有预测参数
for (i in names(args)) args[[i]] <- input[[paste0("coxp_", i)]] for (i in names(args)) args[[i]] <- input[[paste0("coxp_", i)]]
# 处理预测数据/命令(保留原有逻辑) # 处理预测数据/命令
args$pred_cmd <- "" args$pred_cmd <- ""
args$pred_data <- "" args$pred_data <- ""
if (input$coxp_predict == "cmd") { if (input$coxp_predict == "cmd") {
...@@ -315,7 +314,7 @@ coxp_available <- reactive({ ...@@ -315,7 +314,7 @@ coxp_available <- reactive({
if (is.factor(surv_vec) || is.character(surv_vec)) { if (is.factor(surv_vec) || is.character(surv_vec)) {
lev <- unique(surv_vec) lev <- unique(surv_vec)
if (length(lev) != 2) if (length(lev) != 2)
return("状态变量必须是二分类(0/1 或两个水平)" %>% add_class("coxp")) return("状态变量必须是二分类(两个水平)" %>% add_class("coxp"))
ds[[status_var]] <- as.numeric(factor(surv_vec, levels = lev)) - 1L ds[[status_var]] <- as.numeric(factor(surv_vec, levels = lev)) - 1L
} else if (!all(unique(surv_vec) %in% c(0, 1))) { } else if (!all(unique(surv_vec) %in% c(0, 1))) {
return("状态变量必须只包含 0 和 1" %>% add_class("coxp")) return("状态变量必须只包含 0 和 1" %>% add_class("coxp"))
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cox.R % Please edit documentation in R/coxp.R
\name{coxp} \name{coxp}
\alias{coxp} \alias{coxp}
\title{Cox Proportional Hazards Regression} \title{Cox Proportional Hazards Regression}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment