Skip to content

Commit

Permalink
change xMax
Browse files Browse the repository at this point in the history
  • Loading branch information
cyk0315 committed Feb 23, 2024
1 parent 8668c02 commit 0b2efb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/forestcox.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ forestcoxServer<-function(id,data,data_label,data_varStruct=NULL,nfactor.limit=1
output$xlim_forest<-renderUI({
req(tbsub)
data<-tbsub()

numericInput(session$ns('xMax'), 'max HR for forestplot', value= round(max(as.numeric(data$Upper[data$Upper!='Inf']),na.rm=TRUE),2))
data<-data[!(HR==0|Lower==0)]$Upper
numericInput(session$ns('xMax'), 'max HR for forestplot', value= round(max(as.numeric(data[data!='Inf']),na.rm=TRUE),2))

})

Expand Down
6 changes: 5 additions & 1 deletion R/forestglm.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ forestglmServer<-function(id,data,data_label,family,data_varStruct=NULL,nfactor.
output$xlim_forest<-renderUI({
req(tbsub)
data<-tbsub()
numericInput(session$ns('xMax'), 'max beta(OR) for forestplot', value= max(as.numeric(data$Upper),na.rm=TRUE))
data<-ifelse(family=='binomial',data[!(OR==0|Lower==0)]$Upper,data[!(Beta==0|Lower==0)]$Upper)
numericInput(session$ns('xMax'), 'max beta(OR) for forestplot', value= max(as.numeric(data[data!='Inf']),na.rm=TRUE))

})

Expand Down Expand Up @@ -369,11 +370,13 @@ forestglmServer<-function(id,data,data_label,family,data_varStruct=NULL,nfactor.
colnames(tbsub)[1:(1+nrow(label[variable==group.tbsub]))] <- c("Subgroup", paste0("N(%): ", label[variable == group.tbsub, val_label]))

}

return(tbsub)

})

res <- reactive({

list(
datatable(tbsub(), caption = paste0(input$dep, " subgroup analysis"), rownames = F, extensions= "Buttons",
options = c(opt.tb1(paste0("tbsub_",input$dep)),
Expand Down Expand Up @@ -446,6 +449,7 @@ forestglmServer<-function(id,data,data_label,family,data_varStruct=NULL,nfactor.
arrow_lab = c(input$arrow_left, input$arrow_right),
theme=tm
)-> zz

l<-dim(zz)
h<-zz$height[(l[1]-2):(l[1]-1)]
zz<-print(zz[,2:(l[2]-1)],autofit=TRUE)
Expand Down

0 comments on commit 0b2efb9

Please sign in to comment.