diff --git a/grstat.Rproj b/grstat.Rproj index 028250a..6515568 100644 --- a/grstat.Rproj +++ b/grstat.Rproj @@ -1,5 +1,4 @@ Version: 1.0 -ProjectId: d350bac8-4795-42a0-a32d-ccb93a467950 RestoreWorkspace: No SaveWorkspace: No diff --git a/vignettes/ae_grade.Rmd b/vignettes/ae_grade.Rmd new file mode 100644 index 0000000..d520749 --- /dev/null +++ b/vignettes/ae_grade.Rmd @@ -0,0 +1,84 @@ +--- +title: "Adverse Event (AE)" +output: + rmarkdown::html_vignette: + number_sections: true +vignette: > + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +date: "2025-01-30" + +--- + + + +# Data + +The function grstat_example() is used as an example dataset to illustrate the data usage. + +This analysis focuses on two datasets: + +- ae, which contains data on adverse events. + +- enrolres, which includes all patients and their respective treatment arms." + +```{r setup} +library(grstat) +library(flextable) +library(dplyr) +``` + + +```{r} +# #| label: "setup" +# #| message: false +# #| warning: false +# library(grstat) +# library(flextable) +# library(dplyr) + +tm = grstat_example() +attach(tm) + +head(ae) + +head(enrolres) + +``` +# Tables Grade + +create table adverse event grades by using ae_table_grade() + +## Table of maximum grades per patient + +```{r} +ae_table_grade(df_ae=ae, df_enrol=enrolres, arm=NULL, variant="max") %>% + as_flextable(header_show_n=TRUE) %>% + # comment tu peux changer la size des footnotes? + add_footer_lines("Percentages reflect the proportion of patients whose maximum AE grade was as indicated.") +``` + +## Table of maximum grades per patient by arms + +```{r} +ae_table_grade(df_ae=ae, df_enrol=enrolres, arm="arm", variant="max") %>% + as_flextable(header_show_n=TRUE) %>% + add_footer_lines("Percentages reflect the proportion of patients presenting at most one AE of given grade") +``` + +## Table of all grades per patient + +```{r} +ae_table_grade(df_ae=ae, df_enrol=enrolres, arm=NULL, variant="eq") %>% + as_flextable(header_show_n=TRUE) %>% + add_footer_lines("Percentages reflect the proportion of patients presenting at least one AE of given grade") +``` + +## Table of all grades per patient by arms + +```{r} +ae_table_grade(df_ae=ae, df_enrol=enrolres, arm="arm", variant="eq") %>% + as_flextable(header_show_n=TRUE) %>% + add_footer_lines("Percentages reflect the proportion of patients presenting at least one AE of given grade") +``` +