# NOT RUN {
# load planning unit data
data(sim_pu_raster)
zone_1 <- simulate_species(sim_pu_raster, 3)
zone_2 <- simulate_species(sim_pu_raster, 3)
# create zones using two raster stack objects
# each object corresponds to a different zone and each layer corresponds to
# a different species
z <- zones(zone_1, zone_2, zone_names = c("zone_1", "zone_2"),
feature_names = c("feature_1", "feature_2", "feature_3"))
print(z)
# note that the do.call function can also be used to create a Zones object
# this method for creating a Zones object can be helpful when there are many
# management zones
l <- list(zone_1, zone_2, zone_names = c("zone_1", "zone_2"),
feature_names = c("feature_1", "feature_2", "feature_3"))
z <- do.call(zones, l)
print(z)
# create zones using character vectors that represent the names of
# fields (columns) in a data.frame or Spatial object that contain the amount
# of each species expected different management zones
z <- zones(c("spp1_zone1", "spp2_zone1"),
c("spp1_zone2", "spp2_zone2"),
c("spp1_zone3", "spp2_zone3"),
zone_names = c("zone1", "zone2", "zone3"),
feature_names = c("spp1", "spp2"))
print(z)
# }
Run the code above in your browser using DataLab