R/baseline_sex_age.R

Defines functions baselineFunction_sex_age

## #' prepares a baseline function with sex and age of individuals 
## #' @name baselineFunction_sex_age
## #' @param cohortSize - the number of individuals in the cohort
## #' @usage
## #' baselineFunction_sex_age(1000) 
## #' # returns a data.frame with age and sex of individuals
## #' @author Zofia Baranczuk 
## #'  
## #' 
## #' @description This function prepares a data.frame baseline

## #'@export
baselineFunction_sex_age <- function(cohortSize) {
  age_lower_limit = 10
  age_upper_limit = 60
  data.frame(sex=rbinom(cohortSize, 1, .5), age=runif(cohortSize, age_lower_limit,age_upper_limit)) 
}

Try the GUIgems package in your browser

Any scripts or data that you put into this service are public.

GUIgems documentation built on May 29, 2017, 11:03 a.m.