Running 'test-add_sim_index_number.R' [164s]
  Running 'test-filter_dv.R' [149s]
  Running 'test-labeller.R' [163s]
  Running 'test-scales.R' [4s]
  Running 'test-softwaretype.R' [175s]
  Running 'test-strat-col-detection.R' [1s]
  Running 'test-vpc.R' [4s]
  Running 'test-vpc_cat.R' [2s]
  Running 'test-vpc_cens.R' [158s]
  Running 'test-vpc_tte.R' [167s]
Running the tests in 'tests/test-add_sim_index_number.R' failed.
Complete output:
  > library(dplyr)
  
  Attaching package: 'dplyr'
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  > library(vpc)
  > library(testit)
  > Sys.setenv("R_TESTS" = "")
  > 
  > ## Load the theophylline PK dataset
  > obs <- Theoph
  > colnames(obs) <- c("id", "wt", "dose", "time", "dv")
  > obs <- obs %>%
  +   dplyr::group_by(id) %>%
  +   mutate(sex = round(runif(1))) # randomly assign a "sex" covariate
  > sim <- sim_data(obs, # the design of the dataset
  +                 model = function(x) { # the model
  +                   vpc:::pk_oral_1cmt (t = x$time, dose=x$dose * x$wt, ka = x$ka, ke = x$ke, cl = x$cl * x$wt)
  +                 },
  +                 error = list(additive = 0.1),
  +                 theta = c(2.774, 0.0718, .0361),                 # parameter values
  +                 omega_mat = c(0.08854,                           # specified as lower triangle by default;
  +                               0.02421, 0.02241,                  # note: assumed that every theta has iiv, set to 0 if no iiv.
  +                               0.008069, 0.008639, 0.02862),
  +                 par_names = c("ka", "ke", "cl"),                 # link the parameters in the model to the thetas/omegas
  +                 n = 500)
  Warning message:
  `arrange_()` was deprecated in dplyr 0.7.0.
  ℹ Please use `arrange()` instead.
  ℹ See vignette('programming') for more help
  ℹ The deprecated feature was likely used in the vpc package.
    Please report the issue to the authors. 
  > 
  > s <- vpc:::add_sim_index_number(sim)
  > h <- hist(s)
  > assert("all simulated dataset-indices of equal length",
  +   vpc:::is_equal(length(unique(h$counts)), 1))
  > 
  > proc.time()
     user  system elapsed 
     7.54    0.21    7.75 
Running the tests in 'tests/test-filter_dv.R' failed.
Complete output:
  > library(vpc)
  > library(testit)
  > 
  > nonmem_df <- data.frame(ID = 1, ADV = c(1, 0, 0), DV = 1)
  > nonmem_mdv <- data.frame(ID = 1, MDV = c(1, 0, 0), DV = 1)
  > nonmem_evid <- data.frame(ID = 1, EVID = c(1, 0, 0), DV = 1)
  > nonmem <- data.frame(ID = 1, MDV = c(1, 0, 0), EVID = c(0, 1, 0), DV = 1)
  > nonmem_filtered_mdv <- nonmem_mdv[2:3, c("ID", "MDV", "DV")]
  > nonmem_filtered_evid <- nonmem_evid[2:3, c("ID", "EVID", "DV")]
  > nonmem_filtered <- nonmem[3, ]
  > class(nonmem_mdv)      <- c("nonmem", "data.frame")
  > class(nonmem_evid)     <- c("nonmem", "data.frame")
  > class(nonmem)          <- c("nonmem", "data.frame")
  > class(nonmem_filtered) <- c("nonmem", "data.frame")
  > class(nonmem_df)       <- c("nonmem", "data.frame")
  > class(nonmem_filtered_mdv) <- c("nonmem", "data.frame")
  > class(nonmem_filtered_evid) <- c("nonmem", "data.frame")
  > 
  > assert("filtering values for nonmem works properly", vpc:::is_equal(vpc:::filter_dv(nonmem_mdv), nonmem_filtered_mdv, relative=F))
  > assert("filtering values for nonmem works properly", vpc:::is_equal(vpc:::filter_dv(nonmem_evid), nonmem_filtered_evid, relative=F))
  > assert("filtering values for nonmem works properly", vpc:::is_equal(vpc:::filter_dv(nonmem), nonmem_filtered, relative=F))
  > assert("filtering values for nonmem works properly", vpc:::is_equal(vpc:::filter_dv(nonmem_df), nonmem_df, relative=F))
  > 
  > proc.time()
     user  system elapsed 
     0.64    0.17    0.81 
Running the tests in 'tests/test-labeller.R' failed.
Complete output:
  > library(vpc)
  > library(testit)
  > Sys.setenv("R_TESTS" = "")
  > 
  > tmp <- simple_data
  > sex <- (tmp$obs$ID) %% 2
  > race <- (tmp$obs$ID) %% 3
  > tmp$obs$sex <- sex
  > tmp$obs$race <- race
  > tmp$sim$sex <- sex
  > tmp$sim$race <- race
  > 
  > v1 <- vpc(sim = tmp$sim, obs = tmp$obs, stratify = "race",
  +           facet = "wrap", vpcdb = F, labeller = ggplot2::label_both)
  > assert("plot succeeded", "ggplot" %in% class(v1))
  > assert("facets succeeded", vpc:::is_equal(length(v1$facet$params$facets), 1))
  > 
  > proc.time()
     user  system elapsed 
     3.37    0.37    3.73 
Running the tests in 'tests/test-softwaretype.R' failed.
Complete output:
  > library(testit)
  > library(vpc)
  > 
  > nonmem_df <- data.frame(ID = 0, MDV = 0, DV = 0)
  > phx_df <- data.frame(ID = 0, COBS = 0)
  > 
  > assert("software type returned properly", 
  +        vpc:::guess_software("NONmem", nonmem_df) == "nonmem")
  > assert("software type returned properly", 
  +        vpc:::guess_software("nonmem", phx_df) == "nonmem")
  > assert("software type returned properly", 
  +        vpc:::guess_software("auto", nonmem_df) == "nonmem")
  > assert("software type returned properly", 
  +        vpc:::guess_software("auto", phx_df) == "phoenix") 
  > 
  > proc.time()
     user  system elapsed 
     0.65    0.20    0.84 
Running the tests in 'tests/test-vpc_cens.R' failed.
Complete output:
  > library(vpc)
  > library(testit)
  > Sys.setenv("R_TESTS" = "")
  > 
  > ## Test regular vpc in presence of lloq / uloq data
  > obj1 <- vpc(sim = vpc::simple_data$sim, obs = vpc::simple_data$obs, uloq = 120, vpcdb = TRUE)
  > obj2 <- vpc(sim = vpc::simple_data$sim, obs = vpc::simple_data$obs, lloq = 20, vpcdb = TRUE)
  > assert("6 values in upper percentile flagged as >uloq", vpc:::is_equal(sum(is.na(obj1$aggr_obs$obs95)), 6))
  > assert("4 values in upper percentile flagged as <lloq", vpc:::is_equal(sum(is.na(obj2$aggr_obs$obs5)), 4))
  > assert("1 values in upper percentile flagged as <lloq", vpc:::is_equal(sum(is.na(obj2$aggr_obs$obs50)), 1))
  > 
  > ## test vpc func
  > obj <- vpc_cens(sim = vpc::simple_data$sim, 
  +                 obs = vpc::simple_data$obs, 
  +               lloq = 30, n_bins = 8, vpcdb = TRUE)
  > 
  > #vpc_cens(sim = vpc::simple_data$sim, obs = vpc::simple_data$obs, lloq = 30)
  > 
  > obs50 <- c(0.56, 0.08, 0.00, 0.0, 0.02, 0.14, 0.42, 0.52)
  > sim50 <- c(0.48, 0.07, 0.00, 0.00, 0.02, 0.18, 0.46, 0.52)
  > sim5  <- c(0.34, 0.02, 0.00, 0.00, 0.0, 0.10, 0.40, 0.5)
  > sim95 <- c(0.58, 0.12, 0.01, 0.01, 0.08, 0.26, 0.50, 0.55)
  > 
  > assert("vpc_cens returned proper object",
  +   all(c("obs", "sim", "aggr_obs", "vpc_dat", "stratify", "bins") %in% names(obj)))
  > 
  > assert("vpc_cens parsed data correctly", vpc:::is_equal(obs50, obj$aggr_obs$obs50, relative=FALSE))
  > assert("vpc_cens parsed data correctly", vpc:::is_equal(sim50, obj$vpc_dat$q50.med, relative=FALSE))
  > assert("vpc_cens parsed data correctly", vpc:::is_equal(sim5, obj$vpc_dat$q50.low, relative=FALSE))
  > assert("vpc_cens parsed data correctly", vpc:::is_equal(sim95, obj$vpc_dat$q50.up, relative=FALSE))
  > 
  > 
  > proc.time()
     user  system elapsed 
     3.46    0.28    3.75 
Running the tests in 'tests/test-vpc_tte.R' failed.
Complete output:
  > library(vpc)
  > library(testit)
  > Sys.setenv("R_TESTS" = "")
  > 
  > ## Test for bug AR 20171025 column name simulation dataset
  > test <- vpc::rtte_sim_nm[1:200000,]
  > test$bla <- test$t
  > test$t <- NULL
  > obj <- vpc_tte(sim = test,  # stratified for covariate and study arm
  +                obs = vpc::rtte_obs_nm, 
  +                rtte = FALSE,
  +                sim_cols = list(dv = "dv", idv = "bla"), 
  +                obs_cols = list(idv = "t"),
  +                labeller = ggplot2::label_both)
  Initializing.
  Calculating simulation stats.
  ================================================================================
  Plotting.
  Warning messages:
  1: `group_by_()` was deprecated in dplyr 0.7.0.
  ℹ Please use `group_by()` instead.
  ℹ See vignette('programming') for more help
  ℹ The deprecated feature was likely used in the vpc package.
    Please report the issue to the authors. 
  2: `arrange_()` was deprecated in dplyr 0.7.0.
  ℹ Please use `arrange()` instead.
  ℹ See vignette('programming') for more help
  ℹ The deprecated feature was likely used in the vpc package.
    Please report the issue to the authors. 
  > 
  > assert("vpc_tte no stratification succeeded","ggplot" %in% class(obj))
  > 
  > 
  > obj <- vpc_tte(sim = vpc::rtte_sim_nm[1:200000,],  # stratified for covariate and study arm
  +                obs = vpc::rtte_obs_nm, 
  +                stratify = c("sex","drug"), 
  +                rtte = FALSE,
  +                show = list(obs_ci = TRUE),
  +                vpc_theme = new_vpc_theme(list(obs_ci_fill = rgb(0.5,0,0,.7))),
  +                sim_cols = list(dv = "dv", idv = "t"), 
  +                obs_cols = list(idv = "t"),
  +                labeller = ggplot2::label_both)
  Initializing.
  Calculating simulation stats.
  ================================================================================
  Plotting.
  > 
  > assert("vpc_tte plot succeeded","ggplot" %in% class(obj))
  > 
  > ## without observations:
  > obj2 <- vpc_tte(sim = vpc::rtte_sim_nm[1:500000,],  # stratified for covariate and study arm
  +                stratify = c("sex"), 
  +                rtte = FALSE,
  +                sim_cols = list(dv = "dv", idv = "t"), 
  +                obs_cols = list(idv = "t"), vpcdb=T)
  Initializing.
  Calculating simulation stats.
  ================================================================================> pl2 <- plot_vpc(obj2)
  > 
  > assert("vpc_tte without obs succeeded","ggplot" %in% class(pl2))
  > 
  > 
  > proc.time()
     user  system elapsed 
     6.12    0.60    6.70