Running examples in ‘ecotox-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: LC_logit
> ### Title: Lethal Concentration Logit
> ### Aliases: LC_logit
> 
> ### ** Examples
> 
> head(lamprey_tox)
# A tibble: 6 x 7
  nominal.dose tank  month  dose response survive total
         <dbl> <chr> <chr> <dbl>    <int>   <int> <int>
1          0.7 A     May    0.79        0      20    20
2          0.7 L     May    0.8         1      19    20
3          0.7 M     May    0.76        0      20    20
4          1.1 B     May    1.36       13       8    21
5          1.1 K     May    1.22       10       9    19
6          1.1 N     May    1.18        7      11    18
> 
> # within the dataframe used, control dose, unless produced a value
> # during experimentation, are removed from the dataframe,
> # as glm cannot handle values of infinite. Other statistical programs
> # make note of the control dose but do not include within analysis
> 
> 
> # calculate LC50 and LC99 for May
> 
> m <- LC_logit((response / total) ~ log10(dose), p = c(50, 99),
+          weights = total,
+          data = lamprey_tox,
+          subset = c(month == "May"))
> 
> # view calculated LC50 and LC99 for seasonal toxicity of a pisicide,
> #to lamprey in 2011
> 
> m
# A tibble: 2 x 19
      p     n  dose   LCL   UCL LCL_dis UCL_dis chi_square    df pgof_sig     h
  <dbl> <dbl> <dbl> <dbl> <dbl>   <dbl>   <dbl>      <dbl> <int>    <dbl> <dbl>
1    50    18  1.26  1.19  1.31  0.0674  0.0563       15.2    16    0.509     1
2    99    18  2.24  2.04  2.59  0.202   0.350        15.2    16    0.509     1
# … with 8 more variables: slope <dbl>, slope_se <dbl>, slope_sig <dbl>,
#   intercept <dbl>, intercept_se <dbl>, intercept_sig <dbl>, z <dbl>,
#   var_m <dbl>
> 
> #dose-response curve can be plotted using 'ggplot2'
> 
> library(ggplot2)
> 
> lc_may <- subset(lamprey_tox, month %in% c("May"))
> 
> p1 <- ggplot(data = lc_may,
+              aes(x = log10(dose), y = (response / total))) +
+   geom_point() +
+   geom_smooth(method = "glm",
+             method.args = list(family = binomial(link = "logit")),
+             aes(weight = total), colour = "#FF0000", se = TRUE)
> 
> p1
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... lapply -> FUN -> push.vp.viewport -> grid.Call.graphics
Execution halted