Skip to content

Commit

Permalink
Added example data set AB#53208
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Zajichek authored and Alex Zajichek committed Nov 1, 2023
1 parent 5f4befa commit 752287c
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^docs$
^pkgdown$
^\.github$
^data-raw$
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ Imports:
stats,
survival
URL: https://clevelandclinicqhs.github.io/riskcalc/
Depends:
R (>= 2.10)
LazyData: true
17 changes: 17 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#' Radical Cystectomy for Bladder Cancer
#'
#' A fake data set representing the structure of what would be used to build the model for predicting 5-year recurrence-free survival after radical cystectomy (RC) for bladder cancer and subsequent risk calculator at https://riskcalc.org/bladderCancer/
#'
#' @format ## `bladderCancer`
#' A data frame with 1000 rows and 9 columns:
#' \describe{
#' \item{Gender}{Patient gender}
#' \item{Age}{Age of patient at time of RC}
#' \item{RCTumorPathology, RCTumorHistology, RCTumorGrade}{Pathology, histology, and grade of the tumor at time of RC}
#' \item{LymphNodeStatus}{Status of the lymph node}
#' \item{DaysBetweenDXRC}{Number of days between cancer diagnosis and RC}
#' \item{Recurrence}{Did the cancer re-occur? 1=Yes, 0=No (censored)}
#' \item{Time}{Years from RC in which the recurrent event occurred or the patient was censored}
#' }
#' @source <https://github.com/ClevelandClinicQHS/riskcalc/blob/main/data-raw/bladderCancer.R>
"bladderCancer"
25 changes: 25 additions & 0 deletions data-raw/bladderCancer.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## code to prepare `bladderCancer` dataset

# Load package
library(tibble)

# Set sample size
n <- 1000

# Randomly sample like-variables (see https://riskcalc.org/bladderCancer/)
set.seed(123)
bladderCancer <-
tibble(
Gender = sample(c("M", "F"), n, replace = TRUE),
Age = rnorm(n, 50, 10),
RCTumorPathology = sample(c("pT0", "pTa", "pTis", "pT1", "pT2", "pT3", "pT4"), n, replace = TRUE),
RCTumorHistology = sample(c("TCC", "SCC", "ADENOCARCINOMA"), n, replace = TRUE),
RCTumorGrade = sample(c("High", "Low", "GX"), n, replace = TRUE),
LymphNodeStatus = sample(c("Negative", "Positive", "NX"), n, replace = TRUE),
DaysBetweenDXRC = rnorm(n, 500, 100),
Recurrence = rbinom(n, 1, .5),
Time = rweibull(n, 2, 15)
)

# Add data to package
usethis::use_data(bladderCancer, overwrite = TRUE)
Binary file added data/bladderCancer.rda
Binary file not shown.
31 changes: 31 additions & 0 deletions man/bladderCancer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 752287c

Please sign in to comment.