Running ‘testthat.R’ [3s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > 
  > library(testthat)
  > 
  > test_check("timelineR")
  Loading required package: timelineR
  'data.frame':	6 obs. of  6 variables:
   $ start_time: POSIXct, format: "2017-01-01 00:00:07" "2017-01-01 00:00:10" ...
   $ state_1   : Factor w/ 3 levels "A","B","C": 2 1 3 2 1 3
   $ state_2   : Factor w/ 2 levels "User1","User2": 2 1 2 1 1 1
   $ num_1     : num  4 1 3 3 2 2
   $ num_2     : num  1230 200 123 529 250 12
   $ state_3   : Factor w/ 1 level "employee": 1 1 1 1 1 1
  INFO [2019-03-29 22:17:32] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:32] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:32] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:32] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:32] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:32] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:32] creating state plot layers
  INFO [2019-03-29 22:17:32] creating sample plot layers
  -- 1. Error: Default Plotting (@test-visualize.R#20)  --------------------------
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: plot_timeline(test_data) at testthat/test-visualize.R:20
  2: align_the_plots(all_plots, overlap_plots_grob, plot_size_ratios, order_plots)
  3: lapply(all_plots, ggplotGrob)
  4: FUN(X[[i]], ...)
  5: ggplot_gtable(ggplot_build(x))
  6: ggplot_gtable.ggplot_built(ggplot_build(x))
  7: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  8: guides_gengrob(gdefs, theme)
  9: lapply(gdefs, guide_gengrob, theme)
  10: FUN(X[[i]], ...)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  INFO [2019-03-29 22:17:33] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:33] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:33] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:33] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:33] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:33] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:33] creating state plot layers
  INFO [2019-03-29 22:17:33] creating sample plot layers
  -- 2. Error: Default Plotting (@test-visualize.R#30)  --------------------------
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: plot_timeline(test_data, add_legend = F) at testthat/test-visualize.R:30
  2: align_the_plots(all_plots, overlap_plots_grob, plot_size_ratios, order_plots)
  3: rbind_grob_plots(all_plots_grob_scaled)
  4: Reduce(f = grid::unit.pmax, x = lapply(all_plots_grob_scaled, function(x) x$widths))
  5: f(init, x[[i]])
  6: pSummary(..., op = "max")
  
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] creating state plot layers
  INFO [2019-03-29 22:17:34] creating sample plot layers
  -- 3. Error: Different Time ranges (@test-visualize.R#35)  ---------------------
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: plot_timeline(test_data) at testthat/test-visualize.R:35
  2: align_the_plots(all_plots, overlap_plots_grob, plot_size_ratios, order_plots)
  3: lapply(all_plots, ggplotGrob)
  4: FUN(X[[i]], ...)
  5: ggplot_gtable(ggplot_build(x))
  6: ggplot_gtable.ggplot_built(ggplot_build(x))
  7: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  8: guides_gengrob(gdefs, theme)
  9: lapply(gdefs, guide_gengrob, theme)
  10: FUN(X[[i]], ...)
  ...
  20: pushvpgp(x)
  21: pushgrobvp(x$vp)
  22: pushgrobvp.viewport(x$vp)
  23: pushViewport(vp, recording = FALSE)
  24: lapply(vps, push.vp, recording)
  25: FUN(X[[i]], ...)
  26: push.vp.vpTree(X[[i]], ...)
  27: push.vp(vp$parent, recording)
  28: push.vp.viewport(vp$parent, recording)
  29: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] Scaling data accoding to 'scale_vals'
  INFO [2019-03-29 22:17:34] creating state plot layers
  INFO [2019-03-29 22:17:34] creating sample plot layers
  INFO [2019-03-29 22:17:34] Adding new plot titles
  INFO [2019-03-29 22:17:34] Adding new y-labels
  -- 4. Error: Fully fledged test case (@test-visualize.R#81)  -------------------
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: plot_timeline(test_data, data_cols, start_time, end_time, ylimits, scale_vals, titles, 
         ylabels, save_path = save_path, add_legend, plot_size_ratios, overlap_plots_names = overlap_plots_names, 
         color_mapping = color_mapping, order_plots = order_plots, plot_output = T) at testthat/test-visualize.R:81
  2: create_all_overlapping_plots(all_plots, col_type$state_cols, col_type$numeric_cols, 
         overlap_plots_names, titles)
  3: sapply(names(overlap_plots), function(name_plot) {
         x = overlap_plots[[name_plot]]
         if (name_plot %in% names(titles)) {
             create_overlapping_plot(all_plots[[x[1]]], all_plots[[x[2]]], titles[[name_plot]])
         }
         else {
             create_overlapping_plot(all_plots[[x[1]]], all_plots[[x[2]]], name_plot)
         }
     }, USE.NAMES = T, simplify = F)
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: create_overlapping_plot(all_plots[[x[1]]], all_plots[[x[2]]], titles[[name_plot]])
  7: ggplot_build(state_plot) %>% ggplot_gtable()
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  ...
  30: pushvpgp(x)
  31: pushgrobvp(x$vp)
  32: pushgrobvp.viewport(x$vp)
  33: pushViewport(vp, recording = FALSE)
  34: lapply(vps, push.vp, recording)
  35: FUN(X[[i]], ...)
  36: push.vp.vpTree(X[[i]], ...)
  37: push.vp(vp$parent, recording)
  38: push.vp.viewport(vp$parent, recording)
  39: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] creating state plot layers
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:34] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:34] creating state plot layers
  INFO [2019-03-29 22:17:34] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:34] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:35] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:35] start_time has been selected as the timestamp column
  INFO [2019-03-29 22:17:35] num_1, num_2 has been selected as the numeric column(s)
  INFO [2019-03-29 22:17:35] state_1, state_2, state_3 has been selected as the state column(s)
  INFO [2019-03-29 22:17:35] creating state plot layers
  == testthat results  ===========================================================
  OK: 3 SKIPPED: 0 FAILED: 4
  1. Error: Default Plotting (@test-visualize.R#20) 
  2. Error: Default Plotting (@test-visualize.R#30) 
  3. Error: Different Time ranges (@test-visualize.R#35) 
  4. Error: Fully fledged test case (@test-visualize.R#81) 
  
  Error: testthat unit tests failed
  Execution halted