diff --git a/README.md b/README.md index 41ac4f1..9fe389b 100644 --- a/README.md +++ b/README.md @@ -349,7 +349,11 @@ map <- strip.text = element_text(color = "white"), strip.background = element_rect(fill = "black", color = "black") ) +``` + + ## |---------|---------|---------|---------|========================================= +``` r # display maps print(map) ``` diff --git a/docs/articles/aoh.html b/docs/articles/aoh.html index d76ca25..f61d28d 100644 --- a/docs/articles/aoh.html +++ b/docs/articles/aoh.html @@ -199,10 +199,10 @@

Tutorial## # A tibble: 4 × 5 ## id_no binomial seasonal path geometry ## <dbl> <chr> <int> <chr> <POLYGON [m]> -## 1 979 Alytes dickhilleni 1 /tmp/RtmpKBqCe… ((-105506.8 4465112, -10… -## 2 59448 Calotriton asper 1 /tmp/RtmpKBqCe… ((-238681 5029057, -2377… -## 3 4657 Chioglossa lusitanica 1 /tmp/RtmpKBqCe… ((-859201.6 4559278, -85… -## 4 58622 Rana iberica 1 /tmp/RtmpKBqCe… ((-849801.9 4614149, -84… +## 1 979 Alytes dickhilleni 1 /tmp/Rtmp0RZGK… ((-105506.8 4465112, -10… +## 2 59448 Calotriton asper 1 /tmp/Rtmp0RZGK… ((-238681 5029057, -2377… +## 3 4657 Chioglossa lusitanica 1 /tmp/Rtmp0RZGK… ((-859201.6 4559278, -85… +## 4 58622 Rana iberica 1 /tmp/Rtmp0RZGK… ((-849801.9 4614149, -84…

After generating the Area of Habitat data, we can import them.

 # import the Area of Habitat data
@@ -273,10 +273,10 @@ 

Tutorial## resolution : 100, 100 (x, y) ## extent : -914731, 318669, 4364377, 5066777 (xmin, xmax, ymin, ymax) ## coord. ref. : World_Behrmann -## sources : spat_264c02d6cbb37_156864.tif -## spat_264c05ed92c3c_156864.tif -## spat_264c02bbd0659_156864.tif -## spat_264c066b291a9_156864.tif +## sources : spat_30c5b11d0a858_199771.tif +## spat_30c5b19ff8c29_199771.tif +## spat_30c5b44d0936c_199771.tif +## spat_30c5b934878f_199771.tif ## varnames : 979_1 ## 59448_1 ## 4657_1 diff --git a/docs/articles/customization.html b/docs/articles/customization.html index d4dfe93..d7cdcd5 100644 --- a/docs/articles/customization.html +++ b/docs/articles/customization.html @@ -121,25 +121,25 @@

Tutorial# preview data ## dataset follows the same format as the IUCN Red List spatial data print(spp_range_data)

-
## Simple feature collection with 31 features and 26 fields
+
## Simple feature collection with 34 features and 26 fields
 ## Geometry type: MULTIPOLYGON
 ## Dimension:     XY
-## Bounding box:  xmin: -9.497 ymin: 36.006 xmax: 3.318 ymax: 43.793
+## Bounding box:  xmin: -9.497 ymin: 36.01108 xmax: 3.318 ymax: 43.793
 ## Geodetic CRS:  WGS 84
-## # A tibble: 31 × 27
+## # A tibble: 34 × 27
 ##    id_no seasonal presence origin binomial          compiler yrcompiled citation
 ##    <int>    <dbl>    <dbl>  <dbl> <chr>             <chr>         <dbl> <chr>   
-##  1   932        1        1      1 Simulus spp. 932  Simulat…         NA NA      
-##  2   932        1        6      6 Simulus spp. 932  Simulat…         NA NA      
-##  3   932        1        3      3 Simulus spp. 932  Simulat…         NA NA      
-##  4   932        1        3      2 Simulus spp. 932  Simulat…         NA NA      
-##  5  3032        1        1      1 Simulus spp. 3032 Simulat…         NA NA      
-##  6  3032        1        1      2 Simulus spp. 3032 Simulat…         NA NA      
-##  7  3032        1        3      6 Simulus spp. 3032 Simulat…         NA NA      
-##  8  3046        1        1      1 Simulus spp. 3046 Simulat…         NA NA      
-##  9  3046        3        1      1 Simulus spp. 3046 Simulat…         NA NA      
-## 10  3046        4        1      1 Simulus spp. 3046 Simulat…         NA NA      
-## # ℹ 21 more rows
+##  1   670        2        1      1 Simulus spp. 670  Simulat…         NA NA      
+##  2   670        3        1      1 Simulus spp. 670  Simulat…         NA NA      
+##  3   670        4        1      1 Simulus spp. 670  Simulat…         NA NA      
+##  4  2072        1        1      1 Simulus spp. 2072 Simulat…         NA NA      
+##  5  2072        1        4      4 Simulus spp. 2072 Simulat…         NA NA      
+##  6  2072        1        3      3 Simulus spp. 2072 Simulat…         NA NA      
+##  7  2072        1        3      5 Simulus spp. 2072 Simulat…         NA NA      
+##  8  2374        1        1      1 Simulus spp. 2374 Simulat…         NA NA      
+##  9  2374        1        4      2 Simulus spp. 2374 Simulat…         NA NA      
+## 10  2374        1        5      2 Simulus spp. 2374 Simulat…         NA NA      
+## # ℹ 24 more rows
 ## # ℹ 19 more variables: subspecies <chr>, subpop <chr>, source <chr>,
 ## #   island <chr>, tax_comm <chr>, dist_comm <chr>, generalisd <int>,
 ## #   legend <chr>, kingdom <chr>, phylum <chr>, class <chr>, order_ <chr>,
@@ -167,52 +167,51 @@ 

Tutorial # preview data print(spp_habitat_data, n = Inf)

-
## # A tibble: 43 × 6
+
## # A tibble: 42 × 6
 ##    id_no  code habitat                        suitability season majorimportance
 ##    <int> <dbl> <chr>                          <chr>       <chr>  <lgl>          
-##  1   932   1.4 Forest - Temperate             Suitable    Resid… NA             
-##  2   932   2.1 Savanna - Dry                  Suitable    Resid… NA             
-##  3   932  14.2 Pastureland                    Suitable    Resid… NA             
-##  4  3032   1.4 Forest - Temperate             Suitable    Resid… NA             
-##  5  3032   4   Grassland                      Suitable    Resid… NA             
-##  6  3032  14.5 Urban Areas                    Suitable    Resid… NA             
-##  7  3046   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-##  8  3046   5   Wetlands (inland)              Suitable    Resid… NA             
-##  9  3046   2.1 Savanna - Dry                  Suitable    Resid… NA             
-## 10  3046   3.5 Shrubland - Subtropical/tropi… Suitable    Non-b… NA             
-## 11  3046   1.4 Forest - Temperate             Suitable    Non-b… NA             
-## 12  3046  14.2 Pastureland                    Suitable    Non-b… NA             
-## 13  3046  14.1 Arable Land                    Suitable    Passa… NA             
-## 14  3046   5.5 Wetlands (inland) - Permanent… Suitable    Passa… NA             
-## 15  3046   5   Wetlands (inland)              Suitable    Passa… NA             
-## 16  3255   4.4 Grassland - Temperate          Suitable    Resid… NA             
-## 17  3255   5.5 Wetlands (inland) - Permanent… Suitable    Resid… NA             
-## 18  3255   2.1 Savanna - Dry                  Suitable    Resid… NA             
-## 19  4008   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 20  4008   4.5 Grassland - Subtropical/tropi… Suitable    Resid… NA             
-## 21  4008   6   Rocky Areas (e.g., inland cli… Suitable    Resid… NA             
-## 22  4785   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 23  4785   5   Wetlands (inland)              Suitable    Resid… NA             
-## 24  4973   3.4 Shrubland - Temperate          Suitable    Resid… NA             
-## 25  4973   1.4 Forest - Temperate             Suitable    Resid… NA             
-## 26  4973  14.2 Pastureland                    Suitable    Resid… NA             
-## 27  5854   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 28  5854   2.1 Savanna - Dry                  Suitable    Resid… NA             
-## 29  5854   5   Wetlands (inland)              Suitable    Resid… NA             
-## 30  6068   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 31  6068   6   Rocky Areas (e.g., inland cli… Suitable    Resid… NA             
-## 32  6068   4   Grassland                      Suitable    Resid… NA             
-## 33  6678   4.4 Grassland - Temperate          Suitable    Resid… NA             
-## 34  6678   1.5 Forest - Subtropical/tropical… Suitable    Resid… NA             
-## 35  6678   3.5 Shrubland - Subtropical/tropi… Suitable    Resid… NA             
-## 36  6678   3.8 Shrubland - Mediterranean-typ… Suitable    Breed… NA             
-## 37  6678   3.5 Shrubland - Subtropical/tropi… Suitable    Breed… NA             
-## 38  6678  14.2 Pastureland                    Suitable    Breed… NA             
-## 39  6678  14.5 Urban Areas                    Suitable    Non-b… NA             
-## 40  6678   5   Wetlands (inland)              Suitable    Non-b… NA             
-## 41  6678  14.5 Urban Areas                    Suitable    Passa… NA             
-## 42  6678   3.8 Shrubland - Mediterranean-typ… Suitable    Passa… NA             
-## 43  6678   5.5 Wetlands (inland) - Permanent… Suitable    Passa… NA
+## 1 670 14.5 Urban Areas Suitable Breed… NA +## 2 670 14.2 Pastureland Suitable Breed… NA +## 3 670 4.4 Grassland - Temperate Suitable Non-b… NA +## 4 670 3.5 Shrubland - Subtropical/tropi… Suitable Non-b… NA +## 5 670 6 Rocky Areas (e.g., inland cli… Suitable Non-b… NA +## 6 670 1.5 Forest - Subtropical/tropical… Suitable Passa… NA +## 7 670 3.8 Shrubland - Mediterranean-typ… Suitable Passa… NA +## 8 670 3.4 Shrubland - Temperate Suitable Passa… NA +## 9 2072 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 10 2072 1.4 Forest - Temperate Suitable Resid… NA +## 11 2072 2.1 Savanna - Dry Suitable Resid… NA +## 12 2374 4.4 Grassland - Temperate Suitable Resid… NA +## 13 2374 2.1 Savanna - Dry Suitable Resid… NA +## 14 2374 14.5 Urban Areas Suitable Resid… NA +## 15 3667 1.4 Forest - Temperate Suitable Resid… NA +## 16 3667 3.5 Shrubland - Subtropical/tropi… Suitable Resid… NA +## 17 3667 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 18 4421 3.5 Shrubland - Subtropical/tropi… Suitable Resid… NA +## 19 4421 4.4 Grassland - Temperate Suitable Resid… NA +## 20 4650 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 21 4650 4.4 Grassland - Temperate Suitable Resid… NA +## 22 4650 14.5 Urban Areas Suitable Resid… NA +## 23 5808 14.5 Urban Areas Suitable Resid… NA +## 24 5808 14.1 Arable Land Suitable Resid… NA +## 25 5808 14.2 Pastureland Suitable Resid… NA +## 26 5808 3.8 Shrubland - Mediterranean-typ… Suitable Breed… NA +## 27 5808 4.1 Grassland - Tundra Suitable Breed… NA +## 28 5808 2.1 Savanna - Dry Suitable Breed… NA +## 29 5808 14.1 Arable Land Suitable Non-b… NA +## 30 5808 5.5 Wetlands (inland) - Permanent… Suitable Non-b… NA +## 31 5808 3.8 Shrubland - Mediterranean-typ… Suitable Passa… NA +## 32 5808 5.5 Wetlands (inland) - Permanent… Suitable Passa… NA +## 33 5808 4 Grassland Suitable Passa… NA +## 34 6701 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 35 6701 5.5 Wetlands (inland) - Permanent… Suitable Resid… NA +## 36 6701 4.1 Grassland - Tundra Suitable Resid… NA +## 37 8110 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 38 8110 1.4 Forest - Temperate Suitable Resid… NA +## 39 8110 14.5 Urban Areas Suitable Resid… NA +## 40 8644 3.4 Shrubland - Temperate Suitable Resid… NA +## 41 8644 14.5 Urban Areas Suitable Resid… NA +## 42 8644 5 Wetlands (inland) Suitable Resid… NA

Next, we will import data to describe the species’ elevational limits. Although such data would be automatically obtained from the IUCN Red List by default (using the get_spp_summary_data() function), here we will import example data distributed with the package. As before, please note that these data were not obtained from the IUCN Red List, and were randomly generated. Since the dataset contains additional columns that aren’t strictly necessary, we will also update it to include only necessary columns. If you wish to use your own data, please ensure that they follow the same conventions (e.g., column names, data types).

After importing all the datasets with the species data, it is important to ensure that each and every species is associated with geographic range, habitat preference, and summary data. Here, the "id_no" column values are used to denote different taxa—meaning that each species should have a unique identifier. These identifiers are used when cross-referencing the datasets. For example, the species named "Simulus spp. 932" has an identifier ("id_no" value) of 932, and this identifier is used to denote its range in the spp_range_data dataset, its habitat preferences in the spp_habitat_data dataset, and its elevational limits in the spp_summary_data dataset. We can verify that each of the species have the required information across all three datasets using the following code.

 # verify all identifiers in range data are present in habitat preference data
@@ -299,9 +298,9 @@ 

Tutorial## extent : -929631, 338369, 4289077, 5081077 (xmin, xmax, ymin, ymax) ## coord. ref. : World_Behrmann ## source : sim_habitat_data.tif -## name : jung-10-5281_zenodo-4058819 -## min value : 104 -## max value : 1405

+## name : jung-lvl2-10-5281_zenodo-4058819 +## min value : 104 +## max value : 1405
 # visualize data
 plot(habitat_data, main = "Habitat classification data")
@@ -472,60 +471,60 @@

Tutorial## Simple feature collection with 15 features and 8 fields ## Geometry type: MULTIPOLYGON ## Dimension: XY -## Bounding box: xmin: -916330.2 ymin: 4303624 xmax: 320141.5 ymax: 5069358 +## Bounding box: xmin: -916330.2 ymin: 4304151 xmax: 320141.5 ymax: 5069358 ## Projected CRS: World_Behrmann ## # A tibble: 15 × 9 ## id_no binomial category migratory seasonal ## <int> <chr> <chr> <lgl> <int> -## 1 932 Simulus spp. 932 NT FALSE 1 -## 2 3032 Simulus spp. 3032 EN FALSE 1 -## 3 3046 Simulus spp. 3046 EN TRUE 1 -## 4 3046 Simulus spp. 3046 EN TRUE 3 -## 5 3046 Simulus spp. 3046 EN TRUE 4 -## 6 3255 Simulus spp. 3255 VU FALSE 1 -## 7 4008 Simulus spp. 4008 EN FALSE 1 -## 8 4785 Simulus spp. 4785 EN FALSE 1 -## 9 4973 Simulus spp. 4973 EN FALSE 1 -## 10 5854 Simulus spp. 5854 EN FALSE 1 -## 11 6068 Simulus spp. 6068 NT FALSE 1 -## 12 6678 Simulus spp. 6678 EN TRUE 1 -## 13 6678 Simulus spp. 6678 EN TRUE 2 -## 14 6678 Simulus spp. 6678 EN TRUE 3 -## 15 6678 Simulus spp. 6678 EN TRUE 4 -## full_habitat_code elevation_lower elevation_upper -## <chr> <dbl> <dbl> -## 1 1.4|2.1|14.2 76 830 -## 2 1.4|4|14.5 36 999 -## 3 1.4|2.1|3.5|3.8|5|14.2 23 874 -## 4 1.4|2.1|3.5|3.8|5|14.2 23 874 -## 5 2.1|3.8|5|5.5|14.1 23 874 -## 6 2.1|4.4|5.5 90 1050 -## 7 3.8|4.5|6 38 933 -## 8 3.8|5 45 942 -## 9 1.4|3.4|14.2 43 1058 -## 10 2.1|3.8|5 45 1018 -## 11 3.8|4|6 335 1052 -## 12 1.5|3.5|3.8|4.4|5|14.2|14.5 32 1017 -## 13 1.5|3.5|3.8|4.4|14.2 32 1017 -## 14 1.5|3.5|4.4|5|14.5 32 1017 -## 15 1.5|3.5|3.8|4.4|5.5|14.5 32 1017 +## 1 670 Simulus spp. 670 LC TRUE 2 +## 2 670 Simulus spp. 670 LC TRUE 3 +## 3 670 Simulus spp. 670 LC TRUE 4 +## 4 2072 Simulus spp. 2072 NT FALSE 1 +## 5 2374 Simulus spp. 2374 VU FALSE 1 +## 6 3667 Simulus spp. 3667 EN FALSE 1 +## 7 4421 Simulus spp. 4421 VU FALSE 1 +## 8 4650 Simulus spp. 4650 NT FALSE 1 +## 9 5808 Simulus spp. 5808 VU TRUE 1 +## 10 5808 Simulus spp. 5808 VU TRUE 2 +## 11 5808 Simulus spp. 5808 VU TRUE 3 +## 12 5808 Simulus spp. 5808 VU TRUE 4 +## 13 6701 Simulus spp. 6701 EN FALSE 1 +## 14 8110 Simulus spp. 8110 VU FALSE 1 +## 15 8644 Simulus spp. 8644 LC FALSE 1 +## full_habitat_code elevation_lower elevation_upper +## <chr> <dbl> <dbl> +## 1 14.2|14.5 82 942 +## 2 3.5|4.4|6 82 942 +## 3 1.5|3.4|3.8 82 942 +## 4 1.4|2.1|3.8 46 907 +## 5 2.1|4.4|14.5 65 1020 +## 6 1.4|3.5|3.8 15 598 +## 7 3.5|4.4 85 949 +## 8 3.8|4.4|14.5 54 951 +## 9 2.1|3.8|4.1|5.5|14.1|14.2|14.5 91 974 +## 10 2.1|3.8|4.1|14.1|14.2|14.5 91 974 +## 11 5.5|14.1|14.2|14.5 91 974 +## 12 3.8|4|5.5|14.1|14.2|14.5 91 974 +## 13 3.8|4.1|5.5 221 1069 +## 14 1.4|3.8|14.5 75 991 +## 15 3.4|5|14.5 182 1183 ## geometry ## <MULTIPOLYGON [m]> -## 1 (((-258785.9 4373975, -259388.9 4373961, -259722.7 4374219, -259763.3 437477… -## 2 (((-898611.5 4581120, -898487 4582068, -898568 4583427, -898710.8 4584912, -… -## 3 (((-543217.8 4306838, -544040.8 4307238, -530044.5 4307493, -536345 4305531,… -## 4 (((-702794.5 5010491, -697534.1 5010700, -691796 5010701, -686526.9 5010497,… -## 5 (((-846570.6 4526624, -846956.6 4532064, -847632 4538406, -848596.8 4543939,… -## 6 (((-115783.5 4463875, -117192.2 4464336, -117012.8 4464393, -116300.7 446450… -## 7 (((-714770.4 4422914, -716314.1 4423936, -718436.8 4424446, -720656 4424446,… -## 8 (((-916330.2 4589149, -915847.8 4590048, -914689.9 4591247, -912277.8 459314… -## 9 (((-892701.7 4574681, -892524.1 4574097, -892787.6 4574644, -892701.7 457468… -## 10 (((-563984.5 4317153, -563311 4316652, -562879.7 4316319, -562663.6 4316639,… -## 11 (((-397539.9 4378952, -397571.7 4379918, -397867 4380162, -398408.3 4379839,… -## 12 (((-284154 4390088, -283822.1 4400898, -283286.6 4407321, -282607.3 4409338,… -## 13 (((-397731.9 5034174, -397592 5032000, -397489.7 5029929, -397567.9 5028348,… -## 14 (((-617519.9 4370854, -616907.2 4370821, -616553.1 4371304, -616493.3 437237… -## 15 (((-715059.8 4425263, -714866.9 4424855, -714577.4 4424446, -713998.5 442434… +## 1 (((-744167.8 5065733, -744758.3 5065030, -745429.8 5064437, -745619 5064063,… +## 2 (((27902.87 4746365, 27056.68 4747482, 26787.49 4748880, 27030.63 4750311, 2… +## 3 (((-463308.8 4832969, -462721.2 4833049, -461995.6 4833183, -461258.5 483323… +## 4 (((-415672.5 4377074, -416862.2 4377160, -416399.1 4377219, -415731.4 437712… +## 5 (((-568331.2 4328892, -568572.4 4330309, -568690.1 4331566, -568471.1 433245… +## 6 (((-598890.3 4658362, -599068.8 4657037, -598638.5 4656082, -597329.2 465567… +## 7 (((-862522.7 4407131, -862193.7 4407172, -862201.4 4407165, -862640.4 440702… +## 8 (((-613250.4 4368112, -611865.8 4368219, -610831.5 4368152, -610384.8 436778… +## 9 (((-604205.8 4355480, -604258.8 4354866, -604481.7 4354214, -604629.3 435369… +## 10 (((-214939.6 4390035, -213485.5 4389897, -212252.4 4389503, -211509.5 438892… +## 11 (((-712163.3 4853217, -712938.1 4854392, -714015.8 4854814, -715276.9 485473… +## 12 (((-853538.9 4415882, -853532.1 4415239, -853670.1 4414456, -853800.3 441371… +## 13 (((-501888.8 5040197, -501188.3 5040426, -500444.4 5040511, -499781.6 504024… +## 14 (((-259653.3 4377133, -259650.4 4376545, -259928.2 4375843, -260216.7 437513… +## 15 (((166524.7 4944201, 165755.7 4943358, 165117 4942089, 164815 4940646, 16505…

Next, we can generate the Area of Habitat data.

 # specify folder to save Area of Habitat data
@@ -566,77 +565,77 @@ 

Tutorial## Simple feature collection with 15 features and 14 fields ## Geometry type: MULTIPOLYGON ## Dimension: XY -## Bounding box: xmin: -916330.2 ymin: 4303624 xmax: 320141.5 ymax: 5069358 +## Bounding box: xmin: -916330.2 ymin: 4304151 xmax: 320141.5 ymax: 5069358 ## Projected CRS: World_Behrmann ## # A tibble: 15 × 15 ## id_no binomial category migratory seasonal ## * <int> <chr> <chr> <lgl> <int> -## 1 932 Simulus spp. 932 NT FALSE 1 -## 2 3032 Simulus spp. 3032 EN FALSE 1 -## 3 3046 Simulus spp. 3046 EN TRUE 1 -## 4 3046 Simulus spp. 3046 EN TRUE 3 -## 5 3046 Simulus spp. 3046 EN TRUE 4 -## 6 3255 Simulus spp. 3255 VU FALSE 1 -## 7 4008 Simulus spp. 4008 EN FALSE 1 -## 8 4785 Simulus spp. 4785 EN FALSE 1 -## 9 4973 Simulus spp. 4973 EN FALSE 1 -## 10 5854 Simulus spp. 5854 EN FALSE 1 -## 11 6068 Simulus spp. 6068 NT FALSE 1 -## 12 6678 Simulus spp. 6678 EN TRUE 1 -## 13 6678 Simulus spp. 6678 EN TRUE 2 -## 14 6678 Simulus spp. 6678 EN TRUE 3 -## 15 6678 Simulus spp. 6678 EN TRUE 4 -## full_habitat_code habitat_code elevation_lower -## * <chr> <chr> <dbl> -## 1 1.4|2.1|14.2 1.4|2.1|14.2 76 -## 2 1.4|4|14.5 1.4|4|14.5 36 -## 3 1.4|2.1|3.5|3.8|5|14.2 1.4|2.1|3.5|3.8|5|14.2 23 -## 4 1.4|2.1|3.5|3.8|5|14.2 1.4|2.1|3.5|3.8|5|14.2 23 -## 5 2.1|3.8|5|5.5|14.1 2.1|3.8|5|5.5|14.1 23 -## 6 2.1|4.4|5.5 2.1|4.4|5.5 90 -## 7 3.8|4.5|6 3.8|4.5|6 38 -## 8 3.8|5 3.8|5 45 -## 9 1.4|3.4|14.2 1.4|3.4|14.2 43 -## 10 2.1|3.8|5 2.1|3.8|5 45 -## 11 3.8|4|6 3.8|4|6 335 -## 12 1.5|3.5|3.8|4.4|5|14.2|14.5 1.5|3.5|3.8|4.4|5|14.2|14.5 32 -## 13 1.5|3.5|3.8|4.4|14.2 1.5|3.5|3.8|4.4|14.2 32 -## 14 1.5|3.5|4.4|5|14.5 1.5|3.5|4.4|5|14.5 32 -## 15 1.5|3.5|3.8|4.4|5.5|14.5 1.5|3.5|3.8|4.4|5.5|14.5 32 +## 1 670 Simulus spp. 670 LC TRUE 2 +## 2 670 Simulus spp. 670 LC TRUE 3 +## 3 670 Simulus spp. 670 LC TRUE 4 +## 4 2072 Simulus spp. 2072 NT FALSE 1 +## 5 2374 Simulus spp. 2374 VU FALSE 1 +## 6 3667 Simulus spp. 3667 EN FALSE 1 +## 7 4421 Simulus spp. 4421 VU FALSE 1 +## 8 4650 Simulus spp. 4650 NT FALSE 1 +## 9 5808 Simulus spp. 5808 VU TRUE 1 +## 10 5808 Simulus spp. 5808 VU TRUE 2 +## 11 5808 Simulus spp. 5808 VU TRUE 3 +## 12 5808 Simulus spp. 5808 VU TRUE 4 +## 13 6701 Simulus spp. 6701 EN FALSE 1 +## 14 8110 Simulus spp. 8110 VU FALSE 1 +## 15 8644 Simulus spp. 8644 LC FALSE 1 +## full_habitat_code habitat_code elevation_lower +## * <chr> <chr> <dbl> +## 1 14.2|14.5 14.2|14.5 82 +## 2 3.5|4.4|6 3.5|4.4|6 82 +## 3 1.5|3.4|3.8 1.5|3.4|3.8 82 +## 4 1.4|2.1|3.8 1.4|2.1|3.8 46 +## 5 2.1|4.4|14.5 2.1|4.4|14.5 65 +## 6 1.4|3.5|3.8 1.4|3.5|3.8 15 +## 7 3.5|4.4 3.5|4.4 85 +## 8 3.8|4.4|14.5 3.8|4.4|14.5 54 +## 9 2.1|3.8|4.1|5.5|14.1|14.2|14.5 2.1|3.8|4.1|5.5|14.1|14.2|14.5 91 +## 10 2.1|3.8|4.1|14.1|14.2|14.5 2.1|3.8|4.1|14.1|14.2|14.5 91 +## 11 5.5|14.1|14.2|14.5 5.5|14.1|14.2|14.5 91 +## 12 3.8|4|5.5|14.1|14.2|14.5 3.8|4|5.5|14.1|14.2|14.5 91 +## 13 3.8|4.1|5.5 3.8|4.1|5.5 221 +## 14 1.4|3.8|14.5 1.4|3.8|14.5 75 +## 15 3.4|5|14.5 3.4|5|14.5 182 ## elevation_upper xmin xmax ymin ymax path ## * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -## 1 830 -896631 -61631 4373077 5070077 /tmp/RtmphzQloJ/932_1.tif -## 2 999 -902631 -60631 4303077 5070077 /tmp/RtmphzQloJ/3032_1.tif -## 3 874 -707631 320369 4305077 5058077 /tmp/RtmphzQloJ/3046_1.tif -## 4 874 -734631 -504631 4658077 5011077 /tmp/RtmphzQloJ/3046_3.tif -## 5 874 -916631 -708631 4520077 5015077 /tmp/RtmphzQloJ/3046_4.tif -## 6 1050 -620631 320369 4304077 5058077 /tmp/RtmphzQloJ/3255_1.tif -## 7 933 -916631 116369 4304077 5044077 /tmp/RtmphzQloJ/4008_1.tif -## 8 942 -916631 266369 4303077 5070077 /tmp/RtmphzQloJ/4785_1.tif -## 9 1058 -910631 65369 4574077 5070077 /tmp/RtmphzQloJ/4973_1.tif -## 10 1018 -565631 -96631 4304077 4587077 /tmp/RtmphzQloJ/5854_1.tif -## 11 1052 -752631 -66631 4374077 5058077 /tmp/RtmphzQloJ/6068_1.tif -## 12 1017 -284631 239369 4373077 4967077 /tmp/RtmphzQloJ/6678_1.tif -## 13 1017 -794631 -396631 4901077 5070077 /tmp/RtmphzQloJ/6678_2.tif -## 14 1017 -617631 -393631 4304077 4447077 /tmp/RtmphzQloJ/6678_3.tif -## 15 1017 -868631 -654631 4404077 4576077 /tmp/RtmphzQloJ/6678_4.tif +## 1 942 -896631 -648631 4946077 5067077 /tmp/RtmpGBs1TI/670_2.tif +## 2 942 -417631 320369 4742077 5033077 /tmp/RtmpGBs1TI/670_3.tif +## 3 942 -527631 -312631 4664077 4840077 /tmp/RtmpGBs1TI/670_4.tif +## 4 907 -916631 39369 4328077 5070077 /tmp/RtmpGBs1TI/2072_1.tif +## 5 1020 -868631 320369 4304077 5070077 /tmp/RtmpGBs1TI/2374_1.tif +## 6 598 -794631 -305631 4334077 4678077 /tmp/RtmpGBs1TI/3667_1.tif +## 7 949 -863631 -8631 4400077 5062077 /tmp/RtmpGBs1TI/4421_1.tif +## 8 951 -916631 203369 4304077 5070077 /tmp/RtmpGBs1TI/4650_1.tif +## 9 974 -621631 -354631 4304077 4456077 /tmp/RtmpGBs1TI/5808_1.tif +## 10 974 -375631 -201631 4373077 4519077 /tmp/RtmpGBs1TI/5808_2.tif +## 11 974 -771631 -651631 4781077 4861077 /tmp/RtmpGBs1TI/5808_3.tif +## 12 974 -868631 275369 4406077 5058077 /tmp/RtmpGBs1TI/5808_4.tif +## 13 1069 -896631 -74631 4634077 5070077 /tmp/RtmpGBs1TI/6701_1.tif +## 14 991 -868631 291369 4304077 5044077 /tmp/RtmpGBs1TI/8110_1.tif +## 15 1183 -402631 183369 4624077 5000077 /tmp/RtmpGBs1TI/8644_1.tif ## geometry ## * <MULTIPOLYGON [m]> -## 1 (((-258785.9 4373975, -259388.9 4373961, -259722.7 4374219, -259763.3 437477… -## 2 (((-898611.5 4581120, -898487 4582068, -898568 4583427, -898710.8 4584912, -… -## 3 (((-543217.8 4306838, -544040.8 4307238, -530044.5 4307493, -536345 4305531,… -## 4 (((-702794.5 5010491, -697534.1 5010700, -691796 5010701, -686526.9 5010497,… -## 5 (((-846570.6 4526624, -846956.6 4532064, -847632 4538406, -848596.8 4543939,… -## 6 (((-115783.5 4463875, -117192.2 4464336, -117012.8 4464393, -116300.7 446450… -## 7 (((-714770.4 4422914, -716314.1 4423936, -718436.8 4424446, -720656 4424446,… -## 8 (((-916330.2 4589149, -915847.8 4590048, -914689.9 4591247, -912277.8 459314… -## 9 (((-892701.7 4574681, -892524.1 4574097, -892787.6 4574644, -892701.7 457468… -## 10 (((-563984.5 4317153, -563311 4316652, -562879.7 4316319, -562663.6 4316639,… -## 11 (((-397539.9 4378952, -397571.7 4379918, -397867 4380162, -398408.3 4379839,… -## 12 (((-284154 4390088, -283822.1 4400898, -283286.6 4407321, -282607.3 4409338,… -## 13 (((-397731.9 5034174, -397592 5032000, -397489.7 5029929, -397567.9 5028348,… -## 14 (((-617519.9 4370854, -616907.2 4370821, -616553.1 4371304, -616493.3 437237… -## 15 (((-715059.8 4425263, -714866.9 4424855, -714577.4 4424446, -713998.5 442434…

+## 1 (((-744167.8 5065733, -744758.3 5065030, -745429.8 5064437, -745619 5064063,… +## 2 (((27902.87 4746365, 27056.68 4747482, 26787.49 4748880, 27030.63 4750311, 2… +## 3 (((-463308.8 4832969, -462721.2 4833049, -461995.6 4833183, -461258.5 483323… +## 4 (((-415672.5 4377074, -416862.2 4377160, -416399.1 4377219, -415731.4 437712… +## 5 (((-568331.2 4328892, -568572.4 4330309, -568690.1 4331566, -568471.1 433245… +## 6 (((-598890.3 4658362, -599068.8 4657037, -598638.5 4656082, -597329.2 465567… +## 7 (((-862522.7 4407131, -862193.7 4407172, -862201.4 4407165, -862640.4 440702… +## 8 (((-613250.4 4368112, -611865.8 4368219, -610831.5 4368152, -610384.8 436778… +## 9 (((-604205.8 4355480, -604258.8 4354866, -604481.7 4354214, -604629.3 435369… +## 10 (((-214939.6 4390035, -213485.5 4389897, -212252.4 4389503, -211509.5 438892… +## 11 (((-712163.3 4853217, -712938.1 4854392, -714015.8 4854814, -715276.9 485473… +## 12 (((-853538.9 4415882, -853532.1 4415239, -853670.1 4414456, -853800.3 441371… +## 13 (((-501888.8 5040197, -501188.3 5040426, -500444.4 5040511, -499781.6 504024… +## 14 (((-259653.3 4377133, -259650.4 4376545, -259928.2 4375843, -260216.7 437513… +## 15 (((166524.7 4944201, 165755.7 4943358, 165117 4942089, 164815 4940646, 16505…

Finally, let’s create some maps to compare the range data with the Area of habitat data. Although we could create these maps manually (e.g., using the ggplot2 R package), we will use a plotting function distributed with the aoh R package for convenience. Although the full dataset contains many species; for brevity, we will only show the first four species’ seasonal distributions.

 # create maps
diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png
index c596af3..49dde89 100644
Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png differ
diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png
index bfd1395..0f4efa8 100644
Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png
index ed9f16a..6265890 100644
Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/index.html b/docs/index.html
index 28ef042..5c57c83 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -306,9 +306,10 @@ 

Usage axis.text = element_text(size = 6), strip.text = element_text(color = "white"), strip.background = element_rect(fill = "black", color = "black") - ) - -# display maps + )

+
## |---------|---------|---------|---------|=========================================                                          
+
+# display maps
 print(map)

@@ -316,48 +317,48 @@

Usage

Citation

Please cite the aoh R package and the underlying datasets used to produce Area of Habitat data.

-
Area of Habitat data are created using a range of different datasets.
-Depending on which datasets are used, please cite the aoh package and
-relevant data using:
-
-  Hanson JO (2024) aoh: Create Area of Habitat Data. R package version
-  0.0.2.12. Available at https://github.com/prioritizr/aoh.
-
-  IUCN [insert year] IUCN Red List of Threatened Species. Version
-  [insert version]. Available at www.iucnredlist.org.
-
-  BirdLife International and Handbook of the Birds of the World
-  ([insert year]) Bird species distribution maps of the world. Version
-  [insert version]. Available at
-  https://datazone.birdlife.org/species/requestdis.
-
-  Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos
-  V, Rondinini C, Visconti P (2020). "A global map of terrestrial
-  habitat types." _Scientific Data_, *7*(1), 256.
-  doi:10.1038/s41597-020-00599-8
-  <https://doi.org/10.1038/s41597-020-00599-8>.
-
-  Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos
-  V, Rondinini C, and Visconti P (2020b) A global map of terrestrial
-  habitat types (insert version) [Data set]. Zenodo. Available at
-  https://doi.org/10.5281/zenodo.4058819.
-
-  Lumbierres M, Dahal PR, Di Marco M, Butchart SHM, Donald PF,
-  Rondinini C (2021). "Translating habitat class to land cover to map
-  area of habitat of terrestrial vertebrates." _Conservation Biology_,
-  *36*(3), e13851. doi:10.1111/cobi.13851
-  <https://doi.org/10.1111/cobi.13851>.
-
-  Robinson N, Regetz J, Guralnick RP (2014). "EarthEnv-DEM90: A
-  nearly-global, void-free, multi-scale smoothed 90m digital elevation
-  model from fused ASTER and SRTM data." _ISPRS Journal of
-  Photogrammetry and Remote Sensing_, *87*(1), 57-67.
-  doi:10.1016/j.isprsjprs.2013.11.002
-  <https://doi.org/10.1016/j.isprsjprs.2013.11.002>.
-
-To see these entries in BibTeX format, use 'print(<citation>,
-bibtex=TRUE)', 'toBibtex(.)', or set
-'options(citation.bibtex.max=999)'.
+
Area of Habitat data are created using a range of different datasets.
+Depending on which datasets are used, please cite the aoh package and
+relevant data using:
+
+  Hanson JO (2024) aoh: Create Area of Habitat Data. R package version
+  0.0.2.12. Available at https://github.com/prioritizr/aoh.
+
+  IUCN [insert year] IUCN Red List of Threatened Species. Version
+  [insert version]. Available at www.iucnredlist.org.
+
+  BirdLife International and Handbook of the Birds of the World
+  ([insert year]) Bird species distribution maps of the world. Version
+  [insert version]. Available at
+  https://datazone.birdlife.org/species/requestdis.
+
+  Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos
+  V, Rondinini C, Visconti P (2020). "A global map of terrestrial
+  habitat types." _Scientific Data_, *7*(1), 256.
+  doi:10.1038/s41597-020-00599-8
+  <https://doi.org/10.1038/s41597-020-00599-8>.
+
+  Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos
+  V, Rondinini C, and Visconti P (2020b) A global map of terrestrial
+  habitat types (insert version) [Data set]. Zenodo. Available at
+  https://doi.org/10.5281/zenodo.4058819.
+
+  Lumbierres M, Dahal PR, Di Marco M, Butchart SHM, Donald PF,
+  Rondinini C (2021). "Translating habitat class to land cover to map
+  area of habitat of terrestrial vertebrates." _Conservation Biology_,
+  *36*(3), e13851. doi:10.1111/cobi.13851
+  <https://doi.org/10.1111/cobi.13851>.
+
+  Robinson N, Regetz J, Guralnick RP (2014). "EarthEnv-DEM90: A
+  nearly-global, void-free, multi-scale smoothed 90m digital elevation
+  model from fused ASTER and SRTM data." _ISPRS Journal of
+  Photogrammetry and Remote Sensing_, *87*(1), 57-67.
+  doi:10.1016/j.isprsjprs.2013.11.002
+  <https://doi.org/10.1016/j.isprsjprs.2013.11.002>.
+
+To see these entries in BibTeX format, use 'print(<citation>,
+bibtex=TRUE)', 'toBibtex(.)', or set
+'options(citation.bibtex.max=999)'.
diff --git a/docs/news/index.html b/docs/news/index.html index 70ceb60..3f89335 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -63,7 +63,8 @@

Changelog

  • Fix bug in create_spp_info_data() in assigning habitat types for resident distributions of migratory and non-migratory species. This bug meant that (i) habitat types for resident distributions of migratory species would include those exclusively affiliated with the species’ passage distributions and (ii) habitat types for resident distributions of non-migratory species would not include those exclusively affiliated with the species’ passage distributions. Thanks to Jianqiao Zhao for raising this issue.
  • -
  • Fix bug in create_spp_aoh_data() that caused errors when using the GDAL engine on macOS systems.
  • +
  • Update built-in testing data to include multiple migratory species.
  • +
  • Update internal R script for creating test dataset (i.e., inst/scripts/test-data.R) to be compatible with current version of the package.
  • Fix URLs.
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index a9f3023..a36cfb0 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -4,5 +4,5 @@ pkgdown_sha: ~ articles: aoh: aoh.html customization: customization.html -last_built: 2024-07-23T01:23Z +last_built: 2024-07-23T10:03Z diff --git a/docs/reference/calc_spp_frc_data.html b/docs/reference/calc_spp_frc_data.html index f1264ad..4786500 100644 --- a/docs/reference/calc_spp_frc_data.html +++ b/docs/reference/calc_spp_frc_data.html @@ -237,19 +237,19 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [1.5s] +#> initializing [1.4s] #> #> cleaning species range data -#> cleaning species range data [1.9s] +#> cleaning species range data [1.8s] #> #> importing species summary data -#> importing species summary data [467ms] +#> importing species summary data [459ms] #> #> importing species habitat data -#> importing species habitat data [337ms] +#> importing species habitat data [334ms] #> #> collating species data -#> collating species data [159ms] +#> collating species data [155ms] #> #> post-processing results #> post-processing results [11ms] @@ -267,21 +267,21 @@

Examples

#> initializing [5ms] #> #> importing global elevation data -#> importing global elevation data [7.8s] +#> importing global elevation data [7.5s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5s] +#> importing global habitat data [5.4s] #> #> generating Area of Habitat data #> processing ■■■■■■■■■ [ 25% | ETA: 11s] -#> processing ■■■■■■■■■■■■■■■■ [ 50% | ETA: 8s] +#> processing ■■■■■■■■■■■■■■■■ [ 50% | ETA: 7s] #> processing ■■■■■■■■■■■■■■■■■■■■■■■ [ 75% | ETA: 5s] -#> processing [23.4s] +#> processing [22.7s] #> #> generating Area of Habitat data -#> generating Area of Habitat data [23.4s] +#> generating Area of Habitat data [22.7s] #> #> post-processing results #> post-processing results [11ms] @@ -296,7 +296,7 @@

Examples

cache_dir = cache_dir ) #> importing global habitat data -#> importing global habitat data [5.5s] +#> importing global habitat data [5.9s] #> # } diff --git a/docs/reference/create_spp_aoh_data.html b/docs/reference/create_spp_aoh_data.html index 4f43bcc..3436250 100644 --- a/docs/reference/create_spp_aoh_data.html +++ b/docs/reference/create_spp_aoh_data.html @@ -408,22 +408,22 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [333ms] +#> initializing [348ms] #> #> cleaning species range data -#> cleaning species range data [3.3s] +#> cleaning species range data [3.2s] #> #> importing species summary data #> importing species summary data [338ms] #> #> importing species habitat data -#> importing species habitat data [329ms] +#> importing species habitat data [336ms] #> #> collating species data -#> collating species data [220ms] +#> collating species data [216ms] #> #> post-processing results -#> post-processing results [12ms] +#> post-processing results [11ms] #> #> finished @@ -439,12 +439,12 @@

Examples

#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [7.5s] +#> importing global elevation data [6.9s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [4.9s] +#> importing global habitat data [5.3s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed diff --git a/docs/reference/create_spp_frc_data.html b/docs/reference/create_spp_frc_data.html index 2937a29..28b1800 100644 --- a/docs/reference/create_spp_frc_data.html +++ b/docs/reference/create_spp_frc_data.html @@ -445,22 +445,22 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [331ms] +#> initializing [341ms] #> #> cleaning species range data #> cleaning species range data [3.1s] #> #> importing species summary data -#> importing species summary data [341ms] +#> importing species summary data [339ms] #> #> importing species habitat data -#> importing species habitat data [331ms] +#> importing species habitat data [336ms] #> #> collating species data -#> collating species data [221ms] +#> collating species data [216ms] #> #> post-processing results -#> post-processing results [13ms] +#> post-processing results [11ms] #> #> finished @@ -476,12 +476,12 @@

Examples

#> initializing [5ms] #> #> importing global elevation data -#> importing global elevation data [7.9s] +#> importing global elevation data [7.5s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5.2s] +#> importing global habitat data [5.3s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed diff --git a/docs/reference/create_spp_info_data.html b/docs/reference/create_spp_info_data.html index 58ffb35..ca2935c 100644 --- a/docs/reference/create_spp_info_data.html +++ b/docs/reference/create_spp_info_data.html @@ -482,22 +482,22 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [334ms] +#> initializing [343ms] #> #> cleaning species range data -#> cleaning species range data [3.1s] +#> cleaning species range data [3s] #> #> importing species summary data -#> importing species summary data [335ms] +#> importing species summary data [338ms] #> #> importing species habitat data -#> importing species habitat data [333ms] +#> importing species habitat data [336ms] #> #> collating species data -#> collating species data [219ms] +#> collating species data [218ms] #> #> post-processing results -#> post-processing results [11ms] +#> post-processing results [12ms] #> #> finished # } diff --git a/docs/reference/plot_spp_aoh_data.html b/docs/reference/plot_spp_aoh_data.html index d57a81c..b7e8396 100644 --- a/docs/reference/plot_spp_aoh_data.html +++ b/docs/reference/plot_spp_aoh_data.html @@ -165,22 +165,22 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [573ms] +#> initializing [393ms] #> #> cleaning species range data #> cleaning species range data [3.3s] #> #> importing species summary data -#> importing species summary data [335ms] +#> importing species summary data [333ms] #> #> importing species habitat data -#> importing species habitat data [332ms] +#> importing species habitat data [325ms] #> #> collating species data -#> collating species data [214ms] +#> collating species data [215ms] #> #> post-processing results -#> post-processing results [11ms] +#> post-processing results [10ms] #> #> finished @@ -195,12 +195,12 @@

Examples

#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [7.5s] +#> importing global elevation data [7.6s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5.3s] +#> importing global habitat data [4.8s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed diff --git a/docs/reference/plot_spp_frc_data.html b/docs/reference/plot_spp_frc_data.html index 17db99a..9cb06d3 100644 --- a/docs/reference/plot_spp_frc_data.html +++ b/docs/reference/plot_spp_frc_data.html @@ -167,19 +167,19 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [336ms] +#> initializing [331ms] #> #> cleaning species range data #> cleaning species range data [3.4s] #> #> importing species summary data -#> importing species summary data [333ms] +#> importing species summary data [342ms] #> #> importing species habitat data -#> importing species habitat data [328ms] +#> importing species habitat data [324ms] #> #> collating species data -#> collating species data [231ms] +#> collating species data [235ms] #> #> post-processing results #> post-processing results [11ms] @@ -195,22 +195,22 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [5ms] +#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [6.9s] +#> importing global elevation data [7.5s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5.5s] +#> importing global habitat data [5.2s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed #> generating Area of Habitat data [32ms] #> #> post-processing results -#> post-processing results [33ms] +#> post-processing results [32ms] #> #> finished @@ -223,7 +223,7 @@

Examples

) #> importing global habitat data #> skipping 4 species distributions already processed -#> importing global habitat data [5.2s] +#> importing global habitat data [5.5s] #> # plot the data to visualize the range maps and fractional coverage data p <- plot_spp_frc_data(spp_frc_data) diff --git a/docs/reference/simulate_spp_data.html b/docs/reference/simulate_spp_data.html index f2865e5..1e19de6 100644 --- a/docs/reference/simulate_spp_data.html +++ b/docs/reference/simulate_spp_data.html @@ -250,10 +250,10 @@

Examples

n = 5, boundary_data = boundary_data, cache_dir = download_dir ) #> importing global elevation data -#> importing global elevation data [7.1s] +#> importing global elevation data [7.4s] #> #> importing global habitat data -#> importing global habitat data [43.3s] +#> importing global habitat data [45s] #> # preview species range data diff --git a/docs/reference/terra_gdal_calc.html b/docs/reference/terra_gdal_calc.html index 11ba24e..2bae23c 100644 --- a/docs/reference/terra_gdal_calc.html +++ b/docs/reference/terra_gdal_calc.html @@ -233,7 +233,7 @@

Examples

# run calculation y <- terra_gdal_calc(x, "(X < 20) * 1") -#> System command: gdal_calc.py -X "/tmp/Rtmpyk9VK4/file25df819f2b8dc.tif" --outfile="/tmp/Rtmpyk9VK4/file25df84f6556e2.tif" --calc="(X < 20) * 1" --type="Float32" --co="NUM_THREADS=1" --co="COMPRESS=LZW" --co="PREDICTOR=1" +#> System command: gdal_calc.py -X "/tmp/Rtmpfor5XR/file305317c662bc9.tif" --outfile="/tmp/Rtmpfor5XR/file305312388a802.tif" --calc="(X < 20) * 1" --type="Float32" --co="NUM_THREADS=1" --co="COMPRESS=LZW" --co="PREDICTOR=1" # preview result print(y) @@ -242,7 +242,7 @@

Examples

#> resolution : 0.5, 0.5 (x, y) #> extent : -110, -90, 40, 60 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> source : file25df84f6556e2.tif +#> source : file305312388a802.tif #> name : lyr.1 # }
diff --git a/docs/reference/terra_gdal_crop.html b/docs/reference/terra_gdal_crop.html index a54c57a..e715c7e 100644 --- a/docs/reference/terra_gdal_crop.html +++ b/docs/reference/terra_gdal_crop.html @@ -184,7 +184,7 @@

Examples

#> resolution : 0.5, 0.5 (x, y) #> extent : -105, -92.5, 41, 58.5 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> source : file25df869dd6245.tif +#> source : file30531b7fcfc0.tif #> name : lyr.1
diff --git a/docs/reference/terra_gdal_project.html b/docs/reference/terra_gdal_project.html index e471666..52f7a20 100644 --- a/docs/reference/terra_gdal_project.html +++ b/docs/reference/terra_gdal_project.html @@ -194,7 +194,7 @@

Examples

#> resolution : 19999.99, 20000 (x, y) #> extent : -944881, 935118, 4664377, 7144377 (xmin, xmax, ymin, ymax) #> coord. ref. : +proj=lcc +lat_0=0 +lon_0=-100 +lat_1=48 +lat_2=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs -#> source : file25df8697ddd22.tif +#> source : file305312576eda7.tif #> name : lyr.1 diff --git a/inst/doc/aoh.html b/inst/doc/aoh.html index 62353a0..d7304c8 100644 --- a/inst/doc/aoh.html +++ b/inst/doc/aoh.html @@ -282,10 +282,10 @@

Tutorial

## # A tibble: 4 × 5 ## id_no binomial seasonal path geometry ## <dbl> <chr> <int> <chr> <POLYGON [m]> -## 1 979 Alytes dickhilleni 1 /tmp/Rtmp4jowx… ((-105506.8 4465112, -10… -## 2 59448 Calotriton asper 1 /tmp/Rtmp4jowx… ((-238681 5029057, -2377… -## 3 4657 Chioglossa lusitanica 1 /tmp/Rtmp4jowx… ((-859201.6 4559278, -85… -## 4 58622 Rana iberica 1 /tmp/Rtmp4jowx… ((-849801.9 4614149, -84… +## 1 979 Alytes dickhilleni 1 /tmp/RtmpTR2H9… ((-105506.8 4465112, -10… +## 2 59448 Calotriton asper 1 /tmp/RtmpTR2H9… ((-238681 5029057, -2377… +## 3 4657 Chioglossa lusitanica 1 /tmp/RtmpTR2H9… ((-859201.6 4559278, -85… +## 4 58622 Rana iberica 1 /tmp/RtmpTR2H9… ((-849801.9 4614149, -84…

After generating the Area of Habitat data, we can import them.

# import the Area of Habitat data
 ## since the data for each species have a different spatial extent
@@ -340,7 +340,7 @@ 

Tutorial

We can see that the Area of Habitat data for each species are stored in separate spatial (raster) datasets with different extents. Although this is useful because it drastically reduces the total size of the data for each species, it can make it difficult to work with data for multiple species. To address this, we can use the terra_combine() function to automatically align and combine the spatial data for all species’ distributions into a single spatial dataset.

# combine raster data
 spp_aoh_rasters <- terra_combine(spp_aoh_rasters)
-
## |---------|---------|---------|---------|==========                                          |---------|---------|---------|---------|==========                                          |---------|---------|---------|---------|==========                                          |---------|---------|---------|---------|=====================                                          
+
## |---------|---------|---------|---------|========                                          |---------|---------|---------|---------|========                                          |---------|---------|---------|---------|========                                          |---------|---------|---------|---------|================                                          
# assign identifiers to layer names
 names(spp_aoh_rasters) <- paste0(
   "AOH_", spp_aoh_data$id_no, "_", spp_aoh_data$seasonal
@@ -353,10 +353,10 @@ 

Tutorial

## resolution : 100, 100 (x, y) ## extent : -914731, 318669, 4364377, 5066777 (xmin, xmax, ymin, ymax) ## coord. ref. : World_Behrmann -## sources : spat_2668b689624bd_157323.tif -## spat_2668b702b6cce_157323.tif -## spat_2668b1a6da19c_157323.tif -## spat_2668b52e3ef5_157323.tif +## sources : spat_30e2f660c336b_200239.tif +## spat_30e2f6fa2518_200239.tif +## spat_30e2f41f64d80_200239.tif +## spat_30e2f5c266dd2_200239.tif ## varnames : 979_1 ## 59448_1 ## 4657_1 diff --git a/inst/doc/customization.html b/inst/doc/customization.html index 6c3475e..6bd1dbc 100644 --- a/inst/doc/customization.html +++ b/inst/doc/customization.html @@ -206,25 +206,25 @@

Tutorial

# preview data ## dataset follows the same format as the IUCN Red List spatial data print(spp_range_data)
-
## Simple feature collection with 31 features and 26 fields
+
## Simple feature collection with 34 features and 26 fields
 ## Geometry type: MULTIPOLYGON
 ## Dimension:     XY
-## Bounding box:  xmin: -9.497 ymin: 36.006 xmax: 3.318 ymax: 43.793
+## Bounding box:  xmin: -9.497 ymin: 36.01108 xmax: 3.318 ymax: 43.793
 ## Geodetic CRS:  WGS 84
-## # A tibble: 31 × 27
+## # A tibble: 34 × 27
 ##    id_no seasonal presence origin binomial          compiler yrcompiled citation
 ##    <int>    <dbl>    <dbl>  <dbl> <chr>             <chr>         <dbl> <chr>   
-##  1   932        1        1      1 Simulus spp. 932  Simulat…         NA <NA>    
-##  2   932        1        6      6 Simulus spp. 932  Simulat…         NA <NA>    
-##  3   932        1        3      3 Simulus spp. 932  Simulat…         NA <NA>    
-##  4   932        1        3      2 Simulus spp. 932  Simulat…         NA <NA>    
-##  5  3032        1        1      1 Simulus spp. 3032 Simulat…         NA <NA>    
-##  6  3032        1        1      2 Simulus spp. 3032 Simulat…         NA <NA>    
-##  7  3032        1        3      6 Simulus spp. 3032 Simulat…         NA <NA>    
-##  8  3046        1        1      1 Simulus spp. 3046 Simulat…         NA <NA>    
-##  9  3046        3        1      1 Simulus spp. 3046 Simulat…         NA <NA>    
-## 10  3046        4        1      1 Simulus spp. 3046 Simulat…         NA <NA>    
-## # ℹ 21 more rows
+##  1   670        2        1      1 Simulus spp. 670  Simulat…         NA <NA>    
+##  2   670        3        1      1 Simulus spp. 670  Simulat…         NA <NA>    
+##  3   670        4        1      1 Simulus spp. 670  Simulat…         NA <NA>    
+##  4  2072        1        1      1 Simulus spp. 2072 Simulat…         NA <NA>    
+##  5  2072        1        4      4 Simulus spp. 2072 Simulat…         NA <NA>    
+##  6  2072        1        3      3 Simulus spp. 2072 Simulat…         NA <NA>    
+##  7  2072        1        3      5 Simulus spp. 2072 Simulat…         NA <NA>    
+##  8  2374        1        1      1 Simulus spp. 2374 Simulat…         NA <NA>    
+##  9  2374        1        4      2 Simulus spp. 2374 Simulat…         NA <NA>    
+## 10  2374        1        5      2 Simulus spp. 2374 Simulat…         NA <NA>    
+## # ℹ 24 more rows
 ## # ℹ 19 more variables: subspecies <chr>, subpop <chr>, source <chr>,
 ## #   island <chr>, tax_comm <chr>, dist_comm <chr>, generalisd <int>,
 ## #   legend <chr>, kingdom <chr>, phylum <chr>, class <chr>, order_ <chr>,
@@ -237,7 +237,7 @@ 

Tutorial

geom_sf(data = spp_range_data, fill = "darkblue") + facet_wrap(~ id_no + seasonal) print(map)
-

+

Next, we will import data to describe the species’ habitat preferences. Although such data would be automatically obtained from the IUCN Red List by default (using the get_spp_habitat_data() function), here we will import example data distributed with the package. As before, please note that these data were not obtained from the IUCN Red List, and were randomly generated. If you wish to use your own data, please ensure that they follow exactly the same conventions (e.g., column names, data types, and character values for the "suitability" and "season" columns).

# find file path for species habitat preference data
 spp_habitat_path <- system.file(
@@ -250,52 +250,51 @@ 

Tutorial

# preview data print(spp_habitat_data, n = Inf)
-
## # A tibble: 43 × 6
+
## # A tibble: 42 × 6
 ##    id_no  code habitat                        suitability season majorimportance
 ##    <int> <dbl> <chr>                          <chr>       <chr>  <lgl>          
-##  1   932   1.4 Forest - Temperate             Suitable    Resid… NA             
-##  2   932   2.1 Savanna - Dry                  Suitable    Resid… NA             
-##  3   932  14.2 Pastureland                    Suitable    Resid… NA             
-##  4  3032   1.4 Forest - Temperate             Suitable    Resid… NA             
-##  5  3032   4   Grassland                      Suitable    Resid… NA             
-##  6  3032  14.5 Urban Areas                    Suitable    Resid… NA             
-##  7  3046   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-##  8  3046   5   Wetlands (inland)              Suitable    Resid… NA             
-##  9  3046   2.1 Savanna - Dry                  Suitable    Resid… NA             
-## 10  3046   3.5 Shrubland - Subtropical/tropi… Suitable    Non-b… NA             
-## 11  3046   1.4 Forest - Temperate             Suitable    Non-b… NA             
-## 12  3046  14.2 Pastureland                    Suitable    Non-b… NA             
-## 13  3046  14.1 Arable Land                    Suitable    Passa… NA             
-## 14  3046   5.5 Wetlands (inland) - Permanent… Suitable    Passa… NA             
-## 15  3046   5   Wetlands (inland)              Suitable    Passa… NA             
-## 16  3255   4.4 Grassland - Temperate          Suitable    Resid… NA             
-## 17  3255   5.5 Wetlands (inland) - Permanent… Suitable    Resid… NA             
-## 18  3255   2.1 Savanna - Dry                  Suitable    Resid… NA             
-## 19  4008   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 20  4008   4.5 Grassland - Subtropical/tropi… Suitable    Resid… NA             
-## 21  4008   6   Rocky Areas (e.g., inland cli… Suitable    Resid… NA             
-## 22  4785   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 23  4785   5   Wetlands (inland)              Suitable    Resid… NA             
-## 24  4973   3.4 Shrubland - Temperate          Suitable    Resid… NA             
-## 25  4973   1.4 Forest - Temperate             Suitable    Resid… NA             
-## 26  4973  14.2 Pastureland                    Suitable    Resid… NA             
-## 27  5854   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 28  5854   2.1 Savanna - Dry                  Suitable    Resid… NA             
-## 29  5854   5   Wetlands (inland)              Suitable    Resid… NA             
-## 30  6068   3.8 Shrubland - Mediterranean-typ… Suitable    Resid… NA             
-## 31  6068   6   Rocky Areas (e.g., inland cli… Suitable    Resid… NA             
-## 32  6068   4   Grassland                      Suitable    Resid… NA             
-## 33  6678   4.4 Grassland - Temperate          Suitable    Resid… NA             
-## 34  6678   1.5 Forest - Subtropical/tropical… Suitable    Resid… NA             
-## 35  6678   3.5 Shrubland - Subtropical/tropi… Suitable    Resid… NA             
-## 36  6678   3.8 Shrubland - Mediterranean-typ… Suitable    Breed… NA             
-## 37  6678   3.5 Shrubland - Subtropical/tropi… Suitable    Breed… NA             
-## 38  6678  14.2 Pastureland                    Suitable    Breed… NA             
-## 39  6678  14.5 Urban Areas                    Suitable    Non-b… NA             
-## 40  6678   5   Wetlands (inland)              Suitable    Non-b… NA             
-## 41  6678  14.5 Urban Areas                    Suitable    Passa… NA             
-## 42  6678   3.8 Shrubland - Mediterranean-typ… Suitable    Passa… NA             
-## 43  6678   5.5 Wetlands (inland) - Permanent… Suitable    Passa… NA
+## 1 670 14.5 Urban Areas Suitable Breed… NA +## 2 670 14.2 Pastureland Suitable Breed… NA +## 3 670 4.4 Grassland - Temperate Suitable Non-b… NA +## 4 670 3.5 Shrubland - Subtropical/tropi… Suitable Non-b… NA +## 5 670 6 Rocky Areas (e.g., inland cli… Suitable Non-b… NA +## 6 670 1.5 Forest - Subtropical/tropical… Suitable Passa… NA +## 7 670 3.8 Shrubland - Mediterranean-typ… Suitable Passa… NA +## 8 670 3.4 Shrubland - Temperate Suitable Passa… NA +## 9 2072 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 10 2072 1.4 Forest - Temperate Suitable Resid… NA +## 11 2072 2.1 Savanna - Dry Suitable Resid… NA +## 12 2374 4.4 Grassland - Temperate Suitable Resid… NA +## 13 2374 2.1 Savanna - Dry Suitable Resid… NA +## 14 2374 14.5 Urban Areas Suitable Resid… NA +## 15 3667 1.4 Forest - Temperate Suitable Resid… NA +## 16 3667 3.5 Shrubland - Subtropical/tropi… Suitable Resid… NA +## 17 3667 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 18 4421 3.5 Shrubland - Subtropical/tropi… Suitable Resid… NA +## 19 4421 4.4 Grassland - Temperate Suitable Resid… NA +## 20 4650 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 21 4650 4.4 Grassland - Temperate Suitable Resid… NA +## 22 4650 14.5 Urban Areas Suitable Resid… NA +## 23 5808 14.5 Urban Areas Suitable Resid… NA +## 24 5808 14.1 Arable Land Suitable Resid… NA +## 25 5808 14.2 Pastureland Suitable Resid… NA +## 26 5808 3.8 Shrubland - Mediterranean-typ… Suitable Breed… NA +## 27 5808 4.1 Grassland - Tundra Suitable Breed… NA +## 28 5808 2.1 Savanna - Dry Suitable Breed… NA +## 29 5808 14.1 Arable Land Suitable Non-b… NA +## 30 5808 5.5 Wetlands (inland) - Permanent… Suitable Non-b… NA +## 31 5808 3.8 Shrubland - Mediterranean-typ… Suitable Passa… NA +## 32 5808 5.5 Wetlands (inland) - Permanent… Suitable Passa… NA +## 33 5808 4 Grassland Suitable Passa… NA +## 34 6701 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 35 6701 5.5 Wetlands (inland) - Permanent… Suitable Resid… NA +## 36 6701 4.1 Grassland - Tundra Suitable Resid… NA +## 37 8110 3.8 Shrubland - Mediterranean-typ… Suitable Resid… NA +## 38 8110 1.4 Forest - Temperate Suitable Resid… NA +## 39 8110 14.5 Urban Areas Suitable Resid… NA +## 40 8644 3.4 Shrubland - Temperate Suitable Resid… NA +## 41 8644 14.5 Urban Areas Suitable Resid… NA +## 42 8644 5 Wetlands (inland) Suitable Resid… NA

Next, we will import data to describe the species’ elevational limits. Although such data would be automatically obtained from the IUCN Red List by default (using the get_spp_summary_data() function), here we will import example data distributed with the package. As before, please note that these data were not obtained from the IUCN Red List, and were randomly generated. Since the dataset contains additional columns that aren’t strictly necessary, we will also update it to include only necessary columns. If you wish to use your own data, please ensure that they follow the same conventions (e.g., column names, data types).

# find file path for species habitat preference data
 spp_summary_path <- system.file(
@@ -315,16 +314,16 @@ 

Tutorial

## # A tibble: 10 × 4
 ##    id_no elevation_lower elevation_upper category
 ##    <int>           <int>           <int> <chr>   
-##  1   932              76             830 NT      
-##  2  3032              36             999 EN      
-##  3  3046              23             874 EN      
-##  4  3255              90            1050 VU      
-##  5  4008              38             933 EN      
-##  6  4785              45             942 EN      
-##  7  4973              43            1058 EN      
-##  8  5854              45            1018 EN      
-##  9  6068             335            1052 NT      
-## 10  6678              32            1017 EN
+## 1 670 82 942 LC +## 2 2072 46 907 NT +## 3 2374 65 1020 VU +## 4 3667 15 598 EN +## 5 4421 85 949 VU +## 6 4650 54 951 NT +## 7 5808 91 974 VU +## 8 6701 221 1069 EN +## 9 8110 75 991 VU +## 10 8644 182 1183 LC

After importing all the datasets with the species data, it is important to ensure that each and every species is associated with geographic range, habitat preference, and summary data. Here, the "id_no" column values are used to denote different taxa—meaning that each species should have a unique identifier. These identifiers are used when cross-referencing the datasets. For example, the species named "Simulus spp. 932" has an identifier ("id_no" value) of 932, and this identifier is used to denote its range in the spp_range_data dataset, its habitat preferences in the spp_habitat_data dataset, and its elevational limits in the spp_summary_data dataset. We can verify that each of the species have the required information across all three datasets using the following code.

# verify all identifiers in range data are present in habitat preference data
 ## if we see TRUE: then this means both datasets have the same taxa identifiers
@@ -376,9 +375,9 @@ 

Tutorial

## extent : -929631, 338369, 4289077, 5081077 (xmin, xmax, ymin, ymax) ## coord. ref. : World_Behrmann ## source : sim_habitat_data.tif -## name : jung-10-5281_zenodo-4058819 -## min value : 104 -## max value : 1405
+## name : jung-lvl2-10-5281_zenodo-4058819 +## min value : 104 +## max value : 1405
# visualize data
 plot(habitat_data, main = "Habitat classification data")

@@ -544,60 +543,60 @@

Tutorial

## Simple feature collection with 15 features and 8 fields
 ## Geometry type: MULTIPOLYGON
 ## Dimension:     XY
-## Bounding box:  xmin: -916330.2 ymin: 4303624 xmax: 320141.5 ymax: 5069358
+## Bounding box:  xmin: -916330.2 ymin: 4304151 xmax: 320141.5 ymax: 5069358
 ## Projected CRS: World_Behrmann
 ## # A tibble: 15 × 9
 ##    id_no binomial          category migratory seasonal
 ##    <int> <chr>             <chr>    <lgl>        <int>
-##  1   932 Simulus spp. 932  NT       FALSE            1
-##  2  3032 Simulus spp. 3032 EN       FALSE            1
-##  3  3046 Simulus spp. 3046 EN       TRUE             1
-##  4  3046 Simulus spp. 3046 EN       TRUE             3
-##  5  3046 Simulus spp. 3046 EN       TRUE             4
-##  6  3255 Simulus spp. 3255 VU       FALSE            1
-##  7  4008 Simulus spp. 4008 EN       FALSE            1
-##  8  4785 Simulus spp. 4785 EN       FALSE            1
-##  9  4973 Simulus spp. 4973 EN       FALSE            1
-## 10  5854 Simulus spp. 5854 EN       FALSE            1
-## 11  6068 Simulus spp. 6068 NT       FALSE            1
-## 12  6678 Simulus spp. 6678 EN       TRUE             1
-## 13  6678 Simulus spp. 6678 EN       TRUE             2
-## 14  6678 Simulus spp. 6678 EN       TRUE             3
-## 15  6678 Simulus spp. 6678 EN       TRUE             4
-##    full_habitat_code           elevation_lower elevation_upper
-##    <chr>                                 <dbl>           <dbl>
-##  1 1.4|2.1|14.2                             76             830
-##  2 1.4|4|14.5                               36             999
-##  3 1.4|2.1|3.5|3.8|5|14.2                   23             874
-##  4 1.4|2.1|3.5|3.8|5|14.2                   23             874
-##  5 2.1|3.8|5|5.5|14.1                       23             874
-##  6 2.1|4.4|5.5                              90            1050
-##  7 3.8|4.5|6                                38             933
-##  8 3.8|5                                    45             942
-##  9 1.4|3.4|14.2                             43            1058
-## 10 2.1|3.8|5                                45            1018
-## 11 3.8|4|6                                 335            1052
-## 12 1.5|3.5|3.8|4.4|5|14.2|14.5              32            1017
-## 13 1.5|3.5|3.8|4.4|14.2                     32            1017
-## 14 1.5|3.5|4.4|5|14.5                       32            1017
-## 15 1.5|3.5|3.8|4.4|5.5|14.5                 32            1017
+##  1   670 Simulus spp. 670  LC       TRUE             2
+##  2   670 Simulus spp. 670  LC       TRUE             3
+##  3   670 Simulus spp. 670  LC       TRUE             4
+##  4  2072 Simulus spp. 2072 NT       FALSE            1
+##  5  2374 Simulus spp. 2374 VU       FALSE            1
+##  6  3667 Simulus spp. 3667 EN       FALSE            1
+##  7  4421 Simulus spp. 4421 VU       FALSE            1
+##  8  4650 Simulus spp. 4650 NT       FALSE            1
+##  9  5808 Simulus spp. 5808 VU       TRUE             1
+## 10  5808 Simulus spp. 5808 VU       TRUE             2
+## 11  5808 Simulus spp. 5808 VU       TRUE             3
+## 12  5808 Simulus spp. 5808 VU       TRUE             4
+## 13  6701 Simulus spp. 6701 EN       FALSE            1
+## 14  8110 Simulus spp. 8110 VU       FALSE            1
+## 15  8644 Simulus spp. 8644 LC       FALSE            1
+##    full_habitat_code              elevation_lower elevation_upper
+##    <chr>                                    <dbl>           <dbl>
+##  1 14.2|14.5                                   82             942
+##  2 3.5|4.4|6                                   82             942
+##  3 1.5|3.4|3.8                                 82             942
+##  4 1.4|2.1|3.8                                 46             907
+##  5 2.1|4.4|14.5                                65            1020
+##  6 1.4|3.5|3.8                                 15             598
+##  7 3.5|4.4                                     85             949
+##  8 3.8|4.4|14.5                                54             951
+##  9 2.1|3.8|4.1|5.5|14.1|14.2|14.5              91             974
+## 10 2.1|3.8|4.1|14.1|14.2|14.5                  91             974
+## 11 5.5|14.1|14.2|14.5                          91             974
+## 12 3.8|4|5.5|14.1|14.2|14.5                    91             974
+## 13 3.8|4.1|5.5                                221            1069
+## 14 1.4|3.8|14.5                                75             991
+## 15 3.4|5|14.5                                 182            1183
 ##                                                                         geometry
 ##                                                               <MULTIPOLYGON [m]>
-##  1 (((-258785.9 4373975, -259388.9 4373961, -259722.7 4374219, -259763.3 437477…
-##  2 (((-898611.5 4581120, -898487 4582068, -898568 4583427, -898710.8 4584912, -…
-##  3 (((-543217.8 4306838, -544040.8 4307238, -530044.5 4307493, -536345 4305531,…
-##  4 (((-702794.5 5010491, -697534.1 5010700, -691796 5010701, -686526.9 5010497,…
-##  5 (((-846570.6 4526624, -846956.6 4532064, -847632 4538406, -848596.8 4543939,…
-##  6 (((-115783.5 4463875, -117192.2 4464336, -117012.8 4464393, -116300.7 446450…
-##  7 (((-714770.4 4422914, -716314.1 4423936, -718436.8 4424446, -720656 4424446,…
-##  8 (((-916330.2 4589149, -915847.8 4590048, -914689.9 4591247, -912277.8 459314…
-##  9 (((-892701.7 4574681, -892524.1 4574097, -892787.6 4574644, -892701.7 457468…
-## 10 (((-563984.5 4317153, -563311 4316652, -562879.7 4316319, -562663.6 4316639,…
-## 11 (((-397539.9 4378952, -397571.7 4379918, -397867 4380162, -398408.3 4379839,…
-## 12 (((-284154 4390088, -283822.1 4400898, -283286.6 4407321, -282607.3 4409338,…
-## 13 (((-397731.9 5034174, -397592 5032000, -397489.7 5029929, -397567.9 5028348,…
-## 14 (((-617519.9 4370854, -616907.2 4370821, -616553.1 4371304, -616493.3 437237…
-## 15 (((-715059.8 4425263, -714866.9 4424855, -714577.4 4424446, -713998.5 442434…
+## 1 (((-744167.8 5065733, -744758.3 5065030, -745429.8 5064437, -745619 5064063,… +## 2 (((27902.87 4746365, 27056.68 4747482, 26787.49 4748880, 27030.63 4750311, 2… +## 3 (((-463308.8 4832969, -462721.2 4833049, -461995.6 4833183, -461258.5 483323… +## 4 (((-415672.5 4377074, -416862.2 4377160, -416399.1 4377219, -415731.4 437712… +## 5 (((-568331.2 4328892, -568572.4 4330309, -568690.1 4331566, -568471.1 433245… +## 6 (((-598890.3 4658362, -599068.8 4657037, -598638.5 4656082, -597329.2 465567… +## 7 (((-862522.7 4407131, -862193.7 4407172, -862201.4 4407165, -862640.4 440702… +## 8 (((-613250.4 4368112, -611865.8 4368219, -610831.5 4368152, -610384.8 436778… +## 9 (((-604205.8 4355480, -604258.8 4354866, -604481.7 4354214, -604629.3 435369… +## 10 (((-214939.6 4390035, -213485.5 4389897, -212252.4 4389503, -211509.5 438892… +## 11 (((-712163.3 4853217, -712938.1 4854392, -714015.8 4854814, -715276.9 485473… +## 12 (((-853538.9 4415882, -853532.1 4415239, -853670.1 4414456, -853800.3 441371… +## 13 (((-501888.8 5040197, -501188.3 5040426, -500444.4 5040511, -499781.6 504024… +## 14 (((-259653.3 4377133, -259650.4 4376545, -259928.2 4375843, -260216.7 437513… +## 15 (((166524.7 4944201, 165755.7 4943358, 165117 4942089, 164815 4940646, 16505…

Next, we can generate the Area of Habitat data.

# specify folder to save Area of Habitat data
 ## although we use a temporary directory here to avoid polluting your computer
@@ -636,77 +635,77 @@ 

Tutorial

## Simple feature collection with 15 features and 14 fields
 ## Geometry type: MULTIPOLYGON
 ## Dimension:     XY
-## Bounding box:  xmin: -916330.2 ymin: 4303624 xmax: 320141.5 ymax: 5069358
+## Bounding box:  xmin: -916330.2 ymin: 4304151 xmax: 320141.5 ymax: 5069358
 ## Projected CRS: World_Behrmann
 ## # A tibble: 15 × 15
 ##    id_no binomial          category migratory seasonal
 ##  * <int> <chr>             <chr>    <lgl>        <int>
-##  1   932 Simulus spp. 932  NT       FALSE            1
-##  2  3032 Simulus spp. 3032 EN       FALSE            1
-##  3  3046 Simulus spp. 3046 EN       TRUE             1
-##  4  3046 Simulus spp. 3046 EN       TRUE             3
-##  5  3046 Simulus spp. 3046 EN       TRUE             4
-##  6  3255 Simulus spp. 3255 VU       FALSE            1
-##  7  4008 Simulus spp. 4008 EN       FALSE            1
-##  8  4785 Simulus spp. 4785 EN       FALSE            1
-##  9  4973 Simulus spp. 4973 EN       FALSE            1
-## 10  5854 Simulus spp. 5854 EN       FALSE            1
-## 11  6068 Simulus spp. 6068 NT       FALSE            1
-## 12  6678 Simulus spp. 6678 EN       TRUE             1
-## 13  6678 Simulus spp. 6678 EN       TRUE             2
-## 14  6678 Simulus spp. 6678 EN       TRUE             3
-## 15  6678 Simulus spp. 6678 EN       TRUE             4
-##    full_habitat_code           habitat_code                elevation_lower
-##  * <chr>                       <chr>                                 <dbl>
-##  1 1.4|2.1|14.2                1.4|2.1|14.2                             76
-##  2 1.4|4|14.5                  1.4|4|14.5                               36
-##  3 1.4|2.1|3.5|3.8|5|14.2      1.4|2.1|3.5|3.8|5|14.2                   23
-##  4 1.4|2.1|3.5|3.8|5|14.2      1.4|2.1|3.5|3.8|5|14.2                   23
-##  5 2.1|3.8|5|5.5|14.1          2.1|3.8|5|5.5|14.1                       23
-##  6 2.1|4.4|5.5                 2.1|4.4|5.5                              90
-##  7 3.8|4.5|6                   3.8|4.5|6                                38
-##  8 3.8|5                       3.8|5                                    45
-##  9 1.4|3.4|14.2                1.4|3.4|14.2                             43
-## 10 2.1|3.8|5                   2.1|3.8|5                                45
-## 11 3.8|4|6                     3.8|4|6                                 335
-## 12 1.5|3.5|3.8|4.4|5|14.2|14.5 1.5|3.5|3.8|4.4|5|14.2|14.5              32
-## 13 1.5|3.5|3.8|4.4|14.2        1.5|3.5|3.8|4.4|14.2                     32
-## 14 1.5|3.5|4.4|5|14.5          1.5|3.5|4.4|5|14.5                       32
-## 15 1.5|3.5|3.8|4.4|5.5|14.5    1.5|3.5|3.8|4.4|5.5|14.5                 32
+##  1   670 Simulus spp. 670  LC       TRUE             2
+##  2   670 Simulus spp. 670  LC       TRUE             3
+##  3   670 Simulus spp. 670  LC       TRUE             4
+##  4  2072 Simulus spp. 2072 NT       FALSE            1
+##  5  2374 Simulus spp. 2374 VU       FALSE            1
+##  6  3667 Simulus spp. 3667 EN       FALSE            1
+##  7  4421 Simulus spp. 4421 VU       FALSE            1
+##  8  4650 Simulus spp. 4650 NT       FALSE            1
+##  9  5808 Simulus spp. 5808 VU       TRUE             1
+## 10  5808 Simulus spp. 5808 VU       TRUE             2
+## 11  5808 Simulus spp. 5808 VU       TRUE             3
+## 12  5808 Simulus spp. 5808 VU       TRUE             4
+## 13  6701 Simulus spp. 6701 EN       FALSE            1
+## 14  8110 Simulus spp. 8110 VU       FALSE            1
+## 15  8644 Simulus spp. 8644 LC       FALSE            1
+##    full_habitat_code              habitat_code                   elevation_lower
+##  * <chr>                          <chr>                                    <dbl>
+##  1 14.2|14.5                      14.2|14.5                                   82
+##  2 3.5|4.4|6                      3.5|4.4|6                                   82
+##  3 1.5|3.4|3.8                    1.5|3.4|3.8                                 82
+##  4 1.4|2.1|3.8                    1.4|2.1|3.8                                 46
+##  5 2.1|4.4|14.5                   2.1|4.4|14.5                                65
+##  6 1.4|3.5|3.8                    1.4|3.5|3.8                                 15
+##  7 3.5|4.4                        3.5|4.4                                     85
+##  8 3.8|4.4|14.5                   3.8|4.4|14.5                                54
+##  9 2.1|3.8|4.1|5.5|14.1|14.2|14.5 2.1|3.8|4.1|5.5|14.1|14.2|14.5              91
+## 10 2.1|3.8|4.1|14.1|14.2|14.5     2.1|3.8|4.1|14.1|14.2|14.5                  91
+## 11 5.5|14.1|14.2|14.5             5.5|14.1|14.2|14.5                          91
+## 12 3.8|4|5.5|14.1|14.2|14.5       3.8|4|5.5|14.1|14.2|14.5                    91
+## 13 3.8|4.1|5.5                    3.8|4.1|5.5                                221
+## 14 1.4|3.8|14.5                   1.4|3.8|14.5                                75
+## 15 3.4|5|14.5                     3.4|5|14.5                                 182
 ##    elevation_upper    xmin    xmax    ymin    ymax path                      
 ##  *           <dbl>   <dbl>   <dbl>   <dbl>   <dbl> <chr>                     
-##  1             830 -896631  -61631 4373077 5070077 /tmp/Rtmp4jowxs/932_1.tif 
-##  2             999 -902631  -60631 4303077 5070077 /tmp/Rtmp4jowxs/3032_1.tif
-##  3             874 -707631  320369 4305077 5058077 /tmp/Rtmp4jowxs/3046_1.tif
-##  4             874 -734631 -504631 4658077 5011077 /tmp/Rtmp4jowxs/3046_3.tif
-##  5             874 -916631 -708631 4520077 5015077 /tmp/Rtmp4jowxs/3046_4.tif
-##  6            1050 -620631  320369 4304077 5058077 /tmp/Rtmp4jowxs/3255_1.tif
-##  7             933 -916631  116369 4304077 5044077 /tmp/Rtmp4jowxs/4008_1.tif
-##  8             942 -916631  266369 4303077 5070077 /tmp/Rtmp4jowxs/4785_1.tif
-##  9            1058 -910631   65369 4574077 5070077 /tmp/Rtmp4jowxs/4973_1.tif
-## 10            1018 -565631  -96631 4304077 4587077 /tmp/Rtmp4jowxs/5854_1.tif
-## 11            1052 -752631  -66631 4374077 5058077 /tmp/Rtmp4jowxs/6068_1.tif
-## 12            1017 -284631  239369 4373077 4967077 /tmp/Rtmp4jowxs/6678_1.tif
-## 13            1017 -794631 -396631 4901077 5070077 /tmp/Rtmp4jowxs/6678_2.tif
-## 14            1017 -617631 -393631 4304077 4447077 /tmp/Rtmp4jowxs/6678_3.tif
-## 15            1017 -868631 -654631 4404077 4576077 /tmp/Rtmp4jowxs/6678_4.tif
+##  1             942 -896631 -648631 4946077 5067077 /tmp/RtmpTR2H9Y/670_2.tif 
+##  2             942 -417631  320369 4742077 5033077 /tmp/RtmpTR2H9Y/670_3.tif 
+##  3             942 -527631 -312631 4664077 4840077 /tmp/RtmpTR2H9Y/670_4.tif 
+##  4             907 -916631   39369 4328077 5070077 /tmp/RtmpTR2H9Y/2072_1.tif
+##  5            1020 -868631  320369 4304077 5070077 /tmp/RtmpTR2H9Y/2374_1.tif
+##  6             598 -794631 -305631 4334077 4678077 /tmp/RtmpTR2H9Y/3667_1.tif
+##  7             949 -863631   -8631 4400077 5062077 /tmp/RtmpTR2H9Y/4421_1.tif
+##  8             951 -916631  203369 4304077 5070077 /tmp/RtmpTR2H9Y/4650_1.tif
+##  9             974 -621631 -354631 4304077 4456077 /tmp/RtmpTR2H9Y/5808_1.tif
+## 10             974 -375631 -201631 4373077 4519077 /tmp/RtmpTR2H9Y/5808_2.tif
+## 11             974 -771631 -651631 4781077 4861077 /tmp/RtmpTR2H9Y/5808_3.tif
+## 12             974 -868631  275369 4406077 5058077 /tmp/RtmpTR2H9Y/5808_4.tif
+## 13            1069 -896631  -74631 4634077 5070077 /tmp/RtmpTR2H9Y/6701_1.tif
+## 14             991 -868631  291369 4304077 5044077 /tmp/RtmpTR2H9Y/8110_1.tif
+## 15            1183 -402631  183369 4624077 5000077 /tmp/RtmpTR2H9Y/8644_1.tif
 ##                                                                         geometry
 ##  *                                                            <MULTIPOLYGON [m]>
-##  1 (((-258785.9 4373975, -259388.9 4373961, -259722.7 4374219, -259763.3 437477…
-##  2 (((-898611.5 4581120, -898487 4582068, -898568 4583427, -898710.8 4584912, -…
-##  3 (((-543217.8 4306838, -544040.8 4307238, -530044.5 4307493, -536345 4305531,…
-##  4 (((-702794.5 5010491, -697534.1 5010700, -691796 5010701, -686526.9 5010497,…
-##  5 (((-846570.6 4526624, -846956.6 4532064, -847632 4538406, -848596.8 4543939,…
-##  6 (((-115783.5 4463875, -117192.2 4464336, -117012.8 4464393, -116300.7 446450…
-##  7 (((-714770.4 4422914, -716314.1 4423936, -718436.8 4424446, -720656 4424446,…
-##  8 (((-916330.2 4589149, -915847.8 4590048, -914689.9 4591247, -912277.8 459314…
-##  9 (((-892701.7 4574681, -892524.1 4574097, -892787.6 4574644, -892701.7 457468…
-## 10 (((-563984.5 4317153, -563311 4316652, -562879.7 4316319, -562663.6 4316639,…
-## 11 (((-397539.9 4378952, -397571.7 4379918, -397867 4380162, -398408.3 4379839,…
-## 12 (((-284154 4390088, -283822.1 4400898, -283286.6 4407321, -282607.3 4409338,…
-## 13 (((-397731.9 5034174, -397592 5032000, -397489.7 5029929, -397567.9 5028348,…
-## 14 (((-617519.9 4370854, -616907.2 4370821, -616553.1 4371304, -616493.3 437237…
-## 15 (((-715059.8 4425263, -714866.9 4424855, -714577.4 4424446, -713998.5 442434…
+## 1 (((-744167.8 5065733, -744758.3 5065030, -745429.8 5064437, -745619 5064063,… +## 2 (((27902.87 4746365, 27056.68 4747482, 26787.49 4748880, 27030.63 4750311, 2… +## 3 (((-463308.8 4832969, -462721.2 4833049, -461995.6 4833183, -461258.5 483323… +## 4 (((-415672.5 4377074, -416862.2 4377160, -416399.1 4377219, -415731.4 437712… +## 5 (((-568331.2 4328892, -568572.4 4330309, -568690.1 4331566, -568471.1 433245… +## 6 (((-598890.3 4658362, -599068.8 4657037, -598638.5 4656082, -597329.2 465567… +## 7 (((-862522.7 4407131, -862193.7 4407172, -862201.4 4407165, -862640.4 440702… +## 8 (((-613250.4 4368112, -611865.8 4368219, -610831.5 4368152, -610384.8 436778… +## 9 (((-604205.8 4355480, -604258.8 4354866, -604481.7 4354214, -604629.3 435369… +## 10 (((-214939.6 4390035, -213485.5 4389897, -212252.4 4389503, -211509.5 438892… +## 11 (((-712163.3 4853217, -712938.1 4854392, -714015.8 4854814, -715276.9 485473… +## 12 (((-853538.9 4415882, -853532.1 4415239, -853670.1 4414456, -853800.3 441371… +## 13 (((-501888.8 5040197, -501188.3 5040426, -500444.4 5040511, -499781.6 504024… +## 14 (((-259653.3 4377133, -259650.4 4376545, -259928.2 4375843, -260216.7 437513… +## 15 (((166524.7 4944201, 165755.7 4943358, 165117 4942089, 164815 4940646, 16505…

Finally, let’s create some maps to compare the range data with the Area of habitat data. Although we could create these maps manually (e.g., using the ggplot2 R package), we will use a plotting function distributed with the aoh R package for convenience. Although the full dataset contains many species; for brevity, we will only show the first four species’ seasonal distributions.

# create maps
 ## N.B. you might need to install the ggmap package to create the maps
@@ -729,7 +728,7 @@ 

Tutorial

# display maps print(map)
-

+

Conclusion