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

> ### Name: feature_representation
> ### Title: Feature representation
> ### Aliases: feature_representation
> ###   feature_representation,ConservationProblem,numeric-method
> ###   feature_representation,ConservationProblem,matrix-method
> ###   feature_representation,ConservationProblem,data.frame-method
> ###   feature_representation,ConservationProblem,Spatial-method
> ###   feature_representation,ConservationProblem,Raster-method
> 
> ### ** Examples
> 
> # set seed for reproducibility
> set.seed(500)
> 
> # load data
> data(sim_pu_raster, sim_pu_polygons, sim_features, sim_pu_zones_stack,
+      sim_pu_zones_polygons, sim_features_zones)
> 
> 
> # create a simple conservation planning data set so we can see exactly
> # how feature representation is calculated
> pu <- data.frame(id = seq_len(10), cost = c(0.2, NA, runif(8)),
+                  spp1 = runif(10), spp2 = c(rpois(9, 4), NA))
> 
> # create problem
> p1 <- problem(pu, c("spp1", "spp2"), cost_column = "cost") %>%
+       add_min_set_objective() %>%
+       add_relative_targets(0.1) %>%
+       add_binary_decisions()
> 
> # create a solution
> s1 <- data.frame(solution = c(1, NA, rep(c(1, 0), 4)))
> print(s1)
   solution
1         1
2        NA
3         1
4         0
5         1
6         0
7         1
8         0
9         1
10        0
> 
> # calculate feature representation
> r1 <- feature_representation(p1, s1)
> print(r1)
# A tibble: 2 x 3
  feature absolute_held relative_held
  <chr>           <dbl>         <dbl>
1 spp1             3.12         0.541
2 spp2            14            0.424
> 
> # verify that feature representation calculations are correct
> all.equal(r1$absolute_held, c(sum(pu$spp1 * s1[[1]], na.rm = TRUE),
+                               sum(pu$spp2 * s1[[1]], na.rm = TRUE)))
[1] TRUE
> all.equal(r1$relative_held, c(sum(pu$spp1 * s1[[1]], na.rm = TRUE) /
+                               sum(pu$spp1),
+                               sum(pu$spp2 * s1[[1]], na.rm = TRUE) /
+                               sum(pu$spp2, na.rm = TRUE)))
[1] TRUE
> 
> # solve the problem using an exact algorithm solver
> s1_2 <- solve(p1)
Error in res(x, ...) : no optimization problem solvers found on system.
Calls: solve ... solve -> .local -> <Anonymous> -> res -> <Anonymous> -> res
Execution halted