Getting Started with ClinicoPathDescriptives
ClinicoPathDescriptives Team
Source:vignettes/clinicoPathDescriptives-introduction.Rmd
clinicoPathDescriptives-introduction.Rmd
Introduction
ClinicoPathDescriptives
provides a suite of functions
for summarising and visualising clinicopathological data. This vignette
showcases the main tools in the package with reproducible examples. The
package ships with example data sets histopathology
and
treatmentResponse
to illustrate typical workflows.
# install.packages("ClinicoPathDescriptives")
library(ClinicoPathDescriptives)
# Example data
data(histopathology)
head(histopathology)
Summaries of Continuous Variables
Use summarydata()
to obtain descriptive statistics for
numeric variables.
summarydata(data = histopathology, vars = vars(Age, TumorSize))
Summaries of Categorical Variables
reportcat()
creates frequency tables and counts for
categorical variables.
reportcat(data = histopathology, vars = vars(Sex, Grade))
Cross Tables
Generate cross tabulations with chi-square tests using
crosstable()
.
crosstable(
data = histopathology,
vars = vars(Sex, Grade),
group = "PreinvasiveComponent",
sty = "nejm",
excl = TRUE
)
Table One
tableone()
produces formatted baseline characteristic
tables for reports.
tableone(
data = histopathology,
vars = vars(Sex, PreinvasiveComponent, LVI, PNI, Grade, Age),
sty = "t3",
excl = TRUE
)
Visualisations
The package includes multiple plotting functions to explore data.
Age Pyramid
agepyramid(
data = histopathology,
age = "Age",
gender = "Sex",
female = "Female"
)
Alluvial Diagrams
alluvial(
data = histopathology,
vars = vars(Grade, LVI, PNI),
fill = "first_variable"
)
Benford Analysis
benford(data = histopathology, var = "TumorSize")
Waterfall Plots
waterfall()
visualises tumor response over time.
waterfall(
data = treatmentResponse,
patientID = "PatientID",
responseVar = "Response",
timeVar = "Month",
inputType = "percentage",
showWaterfallPlot = TRUE,
showSpiderPlot = TRUE
)