Skip to content

Commit

Permalink
Update code to comply with R CMD Check
Browse files Browse the repository at this point in the history
  • Loading branch information
melantha-wang committed Mar 5, 2022
1 parent 748bc91 commit b96a1e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion SPLICE/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Suggests:
dplyr,
RColorBrewer,
actuar,
poisson,
ChainLadder
VignetteBuilder: knitr
Depends:
Expand Down
11 changes: 6 additions & 5 deletions SPLICE/R/generate_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,21 @@ get_params <- function(complexity) {
#'
#' @examples
#' # Generate datasets of full complexity
#' result <- generate_data(n_claims_per_period = 100, complexity = 5, random_seed = 42)
#' result <- generate_data(
#' n_claims_per_period = 50, data_type = c('claims', 'payments'),
#' complexity = 5, random_seed = 42)
#'
#' # Save individual datasets
#' claims <- result$claim_dataset
#' payments <- result$payment_dataset
#' incurred <- result$incurred_dataset
#'
#' # Generate chain-ladder compatible dataset
#' CL_simple <- generate_data(
#' n_claims_per_period = 100, data_type = 'claims', complexity = 1, random_seed = 42)
#' n_claims_per_period = 50, data_type = 'claims', complexity = 1, random_seed = 42)
#'
#' # To mute message output
#' CL_simple_2 <- generate_data(
#' n_claims_per_period = 100, verbose = FALSE, random_seed = 42)
#' n_claims_per_period = 50, data_type = 'claims', verbose = FALSE, random_seed = 42)
#'
#' # Ouput is reproducible with the same random_seed value
#' all.equal(CL_simple$claim_dataset, CL_simple_2$claim_dataset)
Expand Down Expand Up @@ -306,7 +307,7 @@ generate_data <- function(
# M1: Claim occurrence
# Number of claims occurring for each period i
freq_vector <- claim_frequency(
I = n_periods, simfun = rpois, lambda = n_claims_per_period)
I = n_periods, simfun = stats::rpois, lambda = n_claims_per_period)
# Occurrence time of each claim r, for each period i
occurrence_times <- claim_occurrence(freq_vector)

Expand Down
9 changes: 5 additions & 4 deletions SPLICE/man/generate_data.Rd

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

0 comments on commit b96a1e3

Please sign in to comment.