You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear Benjamin,
Thank you for the package, the tables are absolutely fantastic.
Currently I am trying to make a table in which I have grouped variables under a heading as described in #98 .
The render I used is the following: rndr <- function(x, name, ...){ if(name=="disease"){ d<- Albumin[x, c("Myocardialinfarction", "Congestiveheartfailure", "Peripheralvasculardisease", "Cerebrovasculardisease", "Chronicpulmonarydisease", "Diabetes", "Liverdisease", "Renaldisease")] l <-lapply(Albumin, label)[names(d)] names(d)[!sapply(l,is.null)] <-l[!sapply(l,is.null)] c("", sapply(d, render.default)[2,,drop=T]) }else if(name =="treatment"){ f<- Albumin[x,c("Steroids", "IL_blockers", "Remdesivir","LMWH", "Albumin")] k<- lapply(Albumin, label)[names(f)] names(f)[!sapply(k,is.null)] <-k[!sapply(k,is.null)] c("",sapply(f,render.default)[2,,drop=T]) }else if(name=="Score"){ g<-Albumin[x,c("CharlsonScore","Admission_SOFA","ICU_day_1_SOFA","Max_SOFA", "SAPS_Total")] m<-lapply(Albumin,label)[names(g)] names(g)[!sapply(m,is.null)]<- m[!sapply(m,is.null)] c("", sapply(g,render.continuous.default)[3,,drop=T]) }else if(name== "HNAfractions"){ h<- Albumin[x,c("HMA","HNA1","HNA2")] n<-lapply(Albumin,label)[names(h)] names(h)[!sapply(n,is.null)]<-n[!sapply(n,is.null)] c("",sapply(h,render.continuous.default)[2,,drop=T]) }else{ render.default(x,name,...) } }
This gave me the result I wanted for grouping like this:
However, now I wanted to use statistical tests to see if any significant differences exist between the groups, which probably means I have to reverse the render before it is possible to perform the tests on the groups. Probably this is some really simple coding but I haven't been able to pull it off.
I was wondering if you could possibly help me. If not possible or too hard I can of course do the statistics by hand and add them to the table manually.
Kind regards
Teun
The text was updated successfully, but these errors were encountered:
Dear Benjamin,
Thank you for the package, the tables are absolutely fantastic.
Currently I am trying to make a table in which I have grouped variables under a heading as described in #98 .
The render I used is the following:
rndr <- function(x, name, ...){
if(name=="disease"){
d<- Albumin[x, c("Myocardialinfarction", "Congestiveheartfailure", "Peripheralvasculardisease", "Cerebrovasculardisease", "Chronicpulmonarydisease", "Diabetes", "Liverdisease", "Renaldisease")]
l <-lapply(Albumin, label)[names(d)]
names(d)[!sapply(l,is.null)] <-l[!sapply(l,is.null)]
c("", sapply(d, render.default)[2,,drop=T])
}else if(name =="treatment"){
f<- Albumin[x,c("Steroids", "IL_blockers", "Remdesivir","LMWH", "Albumin")]
k<- lapply(Albumin, label)[names(f)]
names(f)[!sapply(k,is.null)] <-k[!sapply(k,is.null)]
c("",sapply(f,render.default)[2,,drop=T])
}else if(name=="Score"){
g<-Albumin[x,c("CharlsonScore","Admission_SOFA","ICU_day_1_SOFA","Max_SOFA", "SAPS_Total")]
m<-lapply(Albumin,label)[names(g)]
names(g)[!sapply(m,is.null)]<- m[!sapply(m,is.null)]
c("", sapply(g,render.continuous.default)[3,,drop=T])
}else if(name== "HNAfractions"){
h<- Albumin[x,c("HMA","HNA1","HNA2")]
n<-lapply(Albumin,label)[names(h)]
names(h)[!sapply(n,is.null)]<-n[!sapply(n,is.null)]
c("",sapply(h,render.continuous.default)[2,,drop=T])
}else{
render.default(x,name,...)
}
}
or in plain text:
rndr <- function(x, name, ...){
if(name=="disease"){
d<- Albumin[x, c("Myocardialinfarction", "Congestiveheartfailure", "Peripheralvasculardisease", "Cerebrovasculardisease", "Chronicpulmonarydisease", "Diabetes", "Liverdisease", "Renaldisease")]
l <-lapply(Albumin, label)[names(d)]
names(d)[!sapply(l,is.null)] <-l[!sapply(l,is.null)]
c("", sapply(d, render.default)[2,,drop=T])
}else if(name =="treatment"){
f<- Albumin[x,c("Steroids", "IL_blockers", "Remdesivir","LMWH", "Albumin")]
k<- lapply(Albumin, label)[names(f)]
names(f)[!sapply(k,is.null)] <-k[!sapply(k,is.null)]
c("",sapply(f,render.default)[2,,drop=T])
}else if(name=="Score"){
g<-Albumin[x,c("CharlsonScore","Admission_SOFA","ICU_day_1_SOFA","Max_SOFA", "SAPS_Total")]
m<-lapply(Albumin,label)[names(g)]
names(g)[!sapply(m,is.null)]<- m[!sapply(m,is.null)]
c("", sapply(g,render.continuous.default)[3,,drop=T])
}else if(name== "HNAfractions"){
h<- Albumin[x,c("HMA","HNA1","HNA2")]
n<-lapply(Albumin,label)[names(h)]
names(h)[!sapply(n,is.null)]<-n[!sapply(n,is.null)]
c("",sapply(h,render.continuous.default)[2,,drop=T])
}else{
render.default(x,name,...)
}
}
This gave me the result I wanted for grouping like this:
![Schermafbeelding 2024-03-06 om 10 37 32](https://private-user-images.githubusercontent.com/161312638/310442410-ddf77122-a252-468f-9162-9639394214fa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NzIyMTMsIm5iZiI6MTcxOTc3MTkxMywicGF0aCI6Ii8xNjEzMTI2MzgvMzEwNDQyNDEwLWRkZjc3MTIyLWEyNTItNDY4Zi05MTYyLTk2MzkzOTQyMTRmYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjMwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYzMFQxODI1MTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZGY0ZjU1NmY4NmY5OWQyNWY2NDU5N2U5ZDVlNmQzZjA2YTZhMDAzZThhNWNkOTNmYjE5YzgwM2Y1YTBmMWEzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.xc62eyEfMAykcjUxVSVlS9enR10MVDTBgbM-M_upKvw)
However, now I wanted to use statistical tests to see if any significant differences exist between the groups, which probably means I have to reverse the render before it is possible to perform the tests on the groups. Probably this is some really simple coding but I haven't been able to pull it off.
I was wondering if you could possibly help me. If not possible or too hard I can of course do the statistics by hand and add them to the table manually.
Kind regards
Teun
The text was updated successfully, but these errors were encountered: