forked from marlonecobos/kuenm2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.R
More file actions
780 lines (735 loc) · 37 KB
/
data.R
File metadata and controls
780 lines (735 loc) · 37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
#' Calibration Results (glm)
#'
#' @description
#' A `calibration_results` object resulted from \code{calibration()} using maxnet algorithm
#'
#' @usage data("calib_results_glm")
#'
#' @format A \code{calibration_results} with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{calibration_data}{A \code{data.frame} with the variables extracted to presence and background points}
#' \item{formula_grid}{A \code{data.frame} with the ID, formulas, and regularization multipliers of each candidate model}
#' \item{part_data}{A \code{list} with the partition data, where each element corresponds to a replicate and contains the **indices of the test points** for that replicate}
#' \item{partition_method}{A \code{character} indicating the partition method}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or k-folds}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used as train points when the partition method is 'subsample' or 'boostrap'}
#' \item{data_xy}{A \code{data.frame} with the coordinates of the occurrence and bakground points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{weights}{A \code{numeric} value specifying weights for the occurrence records. It's NULL, meaning it was not set weights.}
#' \item{pca}{A \code{prcomp} object storing PCA information. Is NULL, meaning PCA was not performed}
#' \item{algorithm}{A \code{character} indicanting the algorithm (glm)}
#' \item{calibration_results}{A \code{list} containing the evaluation metrics for each candidate model}
#' \item{omission_rate}{A \code{numeric} value indicating the omission rate used to evaluate the models (10%)}
#' \item{addsamplestobackground}{A \code{logical} value indicating whether to add to the background any presence sample that is not already there.}
#' \item{selected_models}{A \code{data.frame} with the formulas and evaluation metrics for each selected model}
#' \item{summary}{A \code{list} with the number and the ID of the models removed and selected during selection procedure}
#' }
"calib_results_glm"
#' Calibration Results (Maxnet)
#'
#' @description
#' A `calibration_results` object resulted from \code{calibration()} using maxnet algorithm
#'
#' @usage data("calib_results_maxnet")
#'
#' @format A \code{calibration_results} with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{calibration_data}{A \code{data.frame} with the variables extracted to presence and background points}
#' \item{formula_grid}{A \code{data.frame} with the ID, formulas, and regularization multipliers of each candidate model}
#' \item{part_data}{A \code{list} with the partition data, where each element corresponds to a replicate and contains the **indices of the test points** for that replicate}
#' \item{partition_method}{A \code{character} indicating the partition method}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or k-folds}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used as train points when the partition method is 'subsample' or 'boostrap'}
#' \item{data_xy}{A \code{data.frame} with the coordinates of the occurrence and bakground points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{weights}{A \code{numeric} value specifying weights for the occurrence records. It's NULL, meaning it was not set weights.}
#' \item{pca}{A \code{prcomp} object storing PCA information. Is NULL, meaning PCA was not performed}
#' \item{algorithm}{A \code{character} indicanting the algorithm (maxnet)}
#' \item{calibration_results}{A \code{list} containing the evaluation metrics for each candidate model}
#' \item{omission_rate}{A \code{numeric} value indicating the omission rate used to evaluate the models (10%)}
#' \item{addsamplestobackground}{A \code{logical} value indicating whether to add to the background any presence sample that is not already there.}
#' \item{selected_models}{A \code{data.frame} with the formulas and evaluation metrics for each selected model}
#' \item{summary}{A \code{list} with the number and the ID of the models removed and selected during selection procedure}
#' }
"calib_results_maxnet"
#' Spatial Blocks from ENMeval
#'
#' @description
#' A list resulting from \code{ENMeval::get.block()} to partition occurrence and background localities into bins for training and validation (or, evaluation and calibration). This object is used in the "Prepare Data for Model Calibration" vignette to demonstrate how to implement custom data partitions generated by \code{ENMeval} in \code{kuenm2}.
#'
#' @usage data("enmeval_block")
#'
#' @format A \code{list} with the following elements:
#' \describe{
#' \item{occs.grp}{A \code{numeric} vector indicating the spatial group to which each occurrence belongs}
#' \item{bg.grp}{A \code{numeric} vector indicating the spatial group to which each background point belongs}
#' }
"enmeval_block"
#' Fitted model with CHELSA variables
#'
#' @description
#' A `fitted_models` object resulting from \code{fit_selected()} using calibration data based on CHELSA variables.
#'
#' @usage data("fitted_model_chelsa")
#'
#' @format A \code{fitted_models} with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{Models}{A \code{list} with the fitted maxnet models (replicates and full models)}
#' \item{calibration_data}{A \code{data.frame} containing the variables extracted for presence and background points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{selected_models}{A \code{data.frame} with formulas and evaluation metrics for each selected model}
#' \item{weights}{A \code{numeric} vector specifying weights for the occurrence records. \code{NULL} if no weights were set.}
#' \item{pca}{A \code{prcomp} object containing PCA results. \code{NULL} if PCA was not performed.}
#' \item{addsamplestobackground}{A \code{logical} value indicating whether to add any presence point not already included to the background.}
#' \item{omission_rate}{A \code{numeric} value indicating the omission rate used to evaluate models.}
#' \item{thresholds}{A \code{numeric} vector with thresholds used to binarize each replicate and the consensus (mean and median), calculated based on the omission rate defined in \code{calibration()}.}
#' \item{algorithm}{A \code{character} string indicating the algorithm used (maxnet).}
#' \item{partition_method}{A \code{character} string indicating the partitioning method used.}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or folds.}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used for training when the partition method is 'subsample' or 'bootstrap'.}
#' }
"fitted_model_chelsa"
#' Fitted model with glm algorithm
#'
#' @description
#' A glm `fitted_models` object resulting from \code{fit_selected()} using calibration data with based on WorldCLim variables.
#'
#' @usage data("fitted_model_glm")
#'
#' @format A \code{fitted_models} with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{Models}{A \code{list} with the fitted maxnet models (replicates and full models)}
#' \item{calibration_data}{A \code{data.frame} containing the variables extracted for presence and background points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{selected_models}{A \code{data.frame} with formulas and evaluation metrics for each selected model}
#' \item{weights}{A \code{numeric} vector specifying weights for the occurrence records. \code{NULL} if no weights were set.}
#' \item{pca}{A \code{prcomp} object containing PCA results. \code{NULL} if PCA was not performed.}
#' \item{addsamplestobackground}{A \code{logical} value indicating whether to add any presence point not already included to the background.}
#' \item{omission_rate}{A \code{numeric} value indicating the omission rate used to evaluate models.}
#' \item{thresholds}{A \code{numeric} vector with thresholds used to binarize each replicate and the consensus (mean and median), calculated based on the omission rate defined in \code{calibration()}.}
#' \item{algorithm}{A \code{character} string indicating the algorithm used (glm).}
#' \item{partition_method}{A \code{character} string indicating the partitioning method used.}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or folds.}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used for training when the partition method is 'subsample' or 'bootstrap'.}
#' }
"fitted_model_glm"
#' Fitted model with maxnet algorithm
#'
#' @description
#' A maxnet `fitted_models` object resulting from \code{fit_selected()} using calibration data with based on WorldCLim variables.
#'
#' @usage data("fitted_model_maxnet")
#'
#' @format A \code{fitted_models} with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{Models}{A \code{list} with the fitted maxnet models (replicates and full models)}
#' \item{calibration_data}{A \code{data.frame} containing the variables extracted for presence and background points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{selected_models}{A \code{data.frame} with formulas and evaluation metrics for each selected model}
#' \item{weights}{A \code{numeric} vector specifying weights for the occurrence records. \code{NULL} if no weights were set.}
#' \item{pca}{A \code{prcomp} object containing PCA results. \code{NULL} if PCA was not performed.}
#' \item{addsamplestobackground}{A \code{logical} value indicating whether to add any presence point not already included to the background.}
#' \item{omission_rate}{A \code{numeric} value indicating the omission rate used to evaluate models.}
#' \item{thresholds}{A \code{numeric} vector with thresholds used to binarize each replicate and the consensus (mean and median), calculated based on the omission rate defined in \code{calibration()}.}
#' \item{algorithm}{A \code{character} string indicating the algorithm used (maxnet).}
#' \item{partition_method}{A \code{character} string indicating the partitioning method used.}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or folds.}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used for training when the partition method is 'subsample' or 'bootstrap'.}
#' }
"fitted_model_maxnet"
#' Spatial Blocks from flexsdm
#'
#' @description
#' A list resulting from \code{flexsdm::part_sblock()}, used to partition occurrence and background localities into bins for training and evaluation. This object is used in the "Prepare Data for Model Calibration" vignette to demonstrate how to implement custom data partitions generated by \code{flexsdm} in \code{kuenm2}
#'
#' @usage data("enmeval_block")
#'
#' @format A \code{list} with the following elements:
#' \describe{
#' \item{part}{A \code{tibble} object with information used in 'data' arguments and a additional column .part with partition group.}
#' \item{best_part_info}{A \code{tibble} with information about the best partition.}
#' }
"flexsdm_block"
#' Discrete palettes based on pals R package
#'
#' @description
#' Color palettes designed for discrete, categorical data. Palettes retrived from pals R package
#'
#' @usage data("kuenm2_discrete_palletes")
#' @format A \code{list} with the following color palettes: "alphabet",
#' "alphabet2", "cols25", "glasbey", "kelly", "polychrome", "stepped",
#' "stepped2", "stepped3", "okabe", "tableau20", "tol", "tol.groundcover",
#' "trubetskoy", and "watlington"
#'
#' @references
#' Wright K (2023). pals: Color Palettes, Colormaps, and Tools to Evaluate
#' Them_. R package version 1.8, <https://CRAN.R-project.org/package=pals>.
"kuenm2_discrete_palletes"
#' Species Occurrence with Erroneous Records
#'
#' @description
#' A \code{data.frame} containing the coordinates of 51 valid occurrences of *Myrcia hatschbachii* (a tree endemic to southern Brazil), along with a set of erroneous records used to demonstrate data cleaning procedures. The valid occurrences were sourced from Trindade & Marques (2024).
#'
#' @usage data("occ_data_noclean")
#'
#' @format A \code{data.frame} with the following columns:
#' \describe{
#' \item{species}{The species name.}
#' \item{x}{Longitude.}
#' \item{y}{Latitude.}
#' }
#' @references
#' Trindade, W.C.F., Marques, M.C.M., 2023. The Invisible Species: Big Data Unveil Coverage Gaps in the Atlantic Forest Hotspot. Diversity and Distributions 30, e13931. https://doi.org/10.1111/ddi.13931
"occ_data_noclean"
#' Species Occurrence
#'
#' @description
#' A \code{data.frame} containing the coordinates of 51 valid occurrences of *Myrcia hatschbachii* (a tree endemic to southern Brazil). The valid occurrences were sourced from Trindade & Marques (2024) and contains only the records retrieved
#' from GBIF and SpeciesLink.
#'
#' @usage data("occ_data")
#'
#' @format A \code{data.frame} with the following columns:
#' \describe{
#' \item{species}{The species name.}
#' \item{x}{Longitude.}
#' \item{y}{Latitude.}
#' }
#' @references
#' Trindade, W.C.F., Marques, M.C.M., 2023. The Invisible Species: Big Data Unveil Coverage Gaps in the Atlantic Forest Hotspot. Diversity and Distributions 30, e13931. https://doi.org/10.1111/ddi.13931
"occ_data"
#' Prepared Data for glm models
#'
#' @description
#' A `prepared_data` object resulted from \code{prepare_data()} to calibrate models using 'glm' algorithm.
#'
#' @usage data("sp_swd_glm")
#'
#' @format A \code{prepared_data} object with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{calibration_data}{A \code{data.frame} containing the variables extracted for presence and background points}
#' \item{formula_grid}{A \code{data.frame} with the ID, formulas, and regularization multipliers of each candidate model}
#' \item{part_data}{A \code{list} with the partition data, where each element corresponds to a replicate and contains the **indices of the test points** for that replicate}
#' \item{partition_method}{A \code{character} indicating the partition method}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or k-folds}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used as train points when the partition method is 'subsample' or 'boostrap'}
#' \item{data_xy}{A \code{data.frame} with the coordinates of the occurrence and bakground points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{weights}{A \code{numeric} value specifying weights for the occurrence records. It's NULL, meaning it was not set weights.}
#' \item{pca}{A \code{prcomp} object storing PCA information. Is NULL, meaning PCA was not performed}
#' \item{algorithm}{A \code{character} indicanting the algorithm (glm)}
#' }
"sp_swd_glm"
#' Prepared Data for maxnet models
#'
#' @description
#' A `prepared_data` object resulted from \code{prepare_data()} to calibrate models using 'glm' algorithm.
#'
#' @usage data("sp_swd")
#'
#' @format A \code{prepared_data} object with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{calibration_data}{A \code{data.frame} containing the variables extracted for presence and background points}
#' \item{formula_grid}{A \code{data.frame} with the ID, formulas, and regularization multipliers of each candidate model}
#' \item{part_data}{A \code{list} with the partition data, where each element corresponds to a replicate and contains the **indices of the test points** for that replicate}
#' \item{partition_method}{A \code{character} indicating the partition method}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or k-folds}
#' \item{train_proportion}{A \code{numeric} value indicating the proportion of occurrences used as train points when the partition method is 'subsample' or 'boostrap'}
#' \item{data_xy}{A \code{data.frame} with the coordinates of the occurrence and bakground points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{weights}{A \code{numeric} value specifying weights for the occurrence records. It's NULL, meaning it was not set weights.}
#' \item{pca}{A \code{prcomp} object storing PCA information. Is NULL, meaning PCA was not performed}
#' \item{algorithm}{A \code{character} indicanting the algorithm (glm)}
#' }
"sp_swd"
#' Prepared data with spatial blocks created with ENMeval
#'
#' @description
#' A `prepared_data` object resulted from \code{prepare_data()} to calibrate
#' models using 'glmnet' algorithm. In this object, the original partitioning
#' was replaced with spatial blocks generated using the \code{get.block()}
#' method from the ENMeval R package.
#'
#' @usage data("sp_swd")
"swd_spatial_block"
#' User Custom Calibration Data
#'
#' @description
#' A \code{data.frame} containing presence and background records along with environmental variables used to demonstrate data preparation with user-supplied data.
#'
#' @usage data("user_data")
#'
#' @format A \code{data.frame} with the following columns:
#' \describe{
#' \item{pr_bg}{Column indicating presences (1) and background (0).}
#' \item{bio_1}{The extracted values for the variable bio_1 at presence and background points.}
#' \item{bio_7}{The extracted values for the variable bio_12 at presence and background points.}
#' \item{bio_12}{The extracted values for the variable bio_12 at presence and background points.}
#' \item{bio_15}{The extracted values for the variable bio_15 at presence and background points.}
#' \item{bio_15}{The extracted values for the variable soilType at presence and background points.}
#' }
"user_data"
#' Fitted model with concave curves
#'
#' @description
#' A maxnet `fitted_models` object resulting from \code{fit_selected()} with a model presenting concave curves.
#'
#' @usage data("fitted_model_concave")
#'
#' @format A \code{fitted_models} with the following elements:
#' \describe{
#' \item{species}{Species names}
#' \item{Models}{A \code{list} with the fitted maxnet models (replicates and full models)}
#' \item{calibration_data}{A \code{data.frame} containing the variables extracted for presence and background points}
#' \item{continuous_variables}{A \code{character} indicating the names of the continuous variables}
#' \item{categorical_variables}{A \code{character} indicating the names of the categorical variables}
#' \item{selected_models}{A \code{data.frame} with formulas and evaluation metrics for each selected model}
#' \item{weights}{A \code{numeric} vector specifying weights for the occurrence records. \code{NULL} if no weights were set.}
#' \item{pca}{A \code{prcomp} object containing PCA results. \code{NULL} if PCA was not performed.}
#' \item{addsamplestobackground}{A \code{logical} value indicating whether to add any presence point not already included to the background.}
#' \item{omission_rate}{A \code{numeric} value indicating the omission rate used to evaluate models.}
#' \item{thresholds}{A \code{numeric} vector with thresholds used to binarize each replicate and the consensus (mean and median), calculated based on the omission rate defined in \code{calibration()}.}
#' \item{algorithm}{A \code{character} string indicating the algorithm used (maxnet).}
#' \item{partition_method}{A \code{character} string indicating the partitioning method used.}
#' \item{n_replicates}{A \code{numeric} value indicating the number of replicates or folds.}
#' }
"fitted_model_concave"
#' Independent Species Occurrence
#'
#' @description
#' A \code{data.frame} containing the coordinates of 82 occurrences of *Myrcia hatschbachii* (a tree endemic to southern Brazil). The valid occurrences were
#' sourced from NeotropicTree (Oliveira-Filho, 2017) and were used as
#' independent data to test the models fitted with the `occ_data`.
#'
#' @usage data("new_occ")
#'
#' @format A \code{data.frame} with the following columns:
#' \describe{
#' \item{species}{The species name.}
#' \item{x}{Longitude.}
#' \item{y}{Latitude.}
#' }
#' @references
#' Oliveira_Filho, A.T. 2017. NeoTropTree, Flora arbórea da Região Neotropical: Um banco de dados envolvendo biogeografia, diversidade e conservação. Universidade Federal de Minas Gerais. (http://www.neotroptree,info).
"new_occ"
#### Document ext data ####
#' Example Bias File
#'
#' A `SpatRaster` object representing a bias layer used for extracting
#' background points with the `prepare_data()` function.
#'
#' @format A `SpatRaster` object.
#'
#' @name bias
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' bias <- terra::rast(system.file("extdata", "bias_file.tif",
#' package = "kuenm2"))
#'
#' terra::plot(bias)
NULL
#' SpatRaster Representing LGM Conditions (GCM: CCSM4)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the CCSM4 General Circulation
#' Model (GCM). The variables were resampled to 10arc-minutes and masked using
#' the `m` provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_ccsm4
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_ccsm4 <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_CCSM4.tif",
#' package = "kuenm2"))
#'
#' terra::plot(chelsa_lgm_ccsm4)
NULL
#' SpatRaster Representing LGM Conditions (GCM: CNRM-CM5)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the CNRM-CM5 General Circulation
#' Model. The variables were resampled to 10arc-minutes and masked using the `m`
#' provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_cnrm_cm5
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_cnrm_cm5 <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_CNRM-CM5.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_lgm_cnrm_cm5)
NULL
#' SpatRaster Representing LGM Conditions (GCM: FGOALS-g2)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the FGOALS-g2 General Circulation
#' Model. The variables were resampled to 10arc-minutes and masked using the `m`
#' provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_fgoals_g2
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_fgoals_g2 <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_FGOALS-g2.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_lgm_fgoals_g2)
NULL
#' SpatRaster Representing LGM Conditions (GCM: IPSL-CM5A-LR)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the IPSL-CM5A-LR General
#' Circulation Model. The variables were resampled to 10arc-minutes and masked
#' using the `m` provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_ipsl
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_ipsl <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_IPSL-CM5A-LR.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_lgm_ipsl)
NULL
#' SpatRaster Representing LGM Conditions (GCM: MIROC-ESM)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the MIROC-ESM General Circulation
#' Model. The variables were resampled to 10arc-minutes and masked using the `m`
#' provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_miroc
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_miroc <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_MIROC-ESM.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_lgm_miroc)
NULL
#' SpatRaster Representing LGM Conditions (GCM: MPI-ESM-P)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the MPI-ESM-P General Circulation
#' Model. The variables were resampled to 10arc-minutes and masked using the `m`
#' provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_mpi
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_mpi <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_MPI-ESM-P.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_lgm_mpi)
NULL
#' SpatRaster Representing LGM Conditions (GCM: MRI-CGCM3)
#'
#' Raster layer containing bioclimatic variables representing Last Glacial
#' Maximum (LGM) climatic conditions based on the MRI-CGCM3 General Circulation
#' Model. The variables were resampled to 10arc-minutes and masked using the `m`
#' provided in the package.
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_lgm_mri
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_lgm_mri <- terra::rast(system.file("extdata",
#' "CHELSA_LGM_MRI-CGCM3.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_lgm_mri)
NULL
#' SpatRaster Representing present-day Conditions (CHELSA)
#'
#' Raster layer containing bioclimatic variables representing present-day
#' climatic conditions. The variables were resampled to a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from CHELSA:
#' \url{https://chelsa-climate.org/}
#'
#' @format A `SpatRaster` object.
#'
#' @name chelsa_current
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' chelsa_current <- terra::rast(system.file("extdata",
#' "Current_CHELSA.tif",
#' package = "kuenm2"))
#' terra::plot(chelsa_current)
NULL
#' SpatRaster Representing present-day Conditions (WorldClim)
#'
#' Raster layer containing bioclimatic variables representing present-day
#' climatic conditions. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim:
#' \url{https://worldclim.org/data/worldclim21.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name var
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' var <- terra::rast(system.file("extdata",
#' "Current_variables.tif",
#' package = "kuenm2"))
#' terra::plot(var)
NULL
#' SpatRaster Representing Future Conditions (2041-2060, SSP126, GCM: ACCESS-CM2)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2041-2060) based on the ACCESS-CM2 General Circulation Model
#' under the SSP126 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2050_ssp126_access
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2050_ssp126_access <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_ACCESS-CM2_ssp126_2041-2060.tif",
#' package = "kuenm2"))
#' terra::plot(future_2050_ssp126_access)
NULL
#' SpatRaster Representing Future Conditions (2081-2100, SSP126, GCM: ACCESS-CM2)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2081-2100) based on the ACCESS-CM2 General Circulation Model
#' under the SSP126 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2100_ssp126_access
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2100_ssp126_access <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_ACCESS-CM2_ssp126_2081-2100.tif",
#' package = "kuenm2"))
#' terra::plot(future_2100_ssp126_access)
NULL
#' SpatRaster Representing Future Conditions (2041-2060, SSP585, GCM: ACCESS-CM2)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2041-2060) based on the ACCESS-CM2 General Circulation Model
#' under the SSP585 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2050_ssp585_access
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2050_ssp585_access <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_ACCESS-CM2_ssp585_2041-2060.tif",
#' package = "kuenm2"))
#' terra::plot(future_2050_ssp585_access)
NULL
#' SpatRaster Representing Future Conditions (2081-2100, SSP585, GCM: ACCESS-CM2)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2081-2100) based on the ACCESS-CM2 General Circulation Model
#' under the SSP585 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2100_ssp585_access
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2100_ssp585_access <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_ACCESS-CM2_ssp585_2081-2100.tif",
#' package = "kuenm2"))
#' terra::plot(future_2100_ssp585_access)
NULL
#' SpatRaster Representing Future Conditions (2041-2060, SSP126, GCM: MIROC6)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2041-2060) based on the MIROC6 General Circulation Model
#' under the SSP126 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2050_ssp126_miroc
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2050_ssp126_miroc <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_MIROC6_ssp126_2041-2060.tif",
#' package = "kuenm2"))
#' terra::plot(future_2050_ssp126_miroc)
NULL
#' SpatRaster Representing Future Conditions (2081-2100, SSP126, GCM: MIROC6)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2081-2100) based on the MIROC6 General Circulation Model
#' under the SSP126 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2100_ssp126_miroc
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2100_ssp126_miroc <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_MIROC6_ssp126_2081-2100.tif",
#' package = "kuenm2"))
#' terra::plot(future_2100_ssp126_miroc)
NULL
#' SpatRaster Representing Future Conditions (2041-2060, SSP585, GCM: MIROC6)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2041-2060) based on the MIROC6 General Circulation Model
#' under the SSP585 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2050_ssp585_miroc
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2050_ssp585_miroc <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_MIROC6_ssp585_2041-2060.tif",
#' package = "kuenm2"))
#' terra::plot(future_2050_ssp585_miroc)
NULL
#' SpatRaster Representing Future Conditions (2081-2100, SSP585, GCM: MIROC6)
#'
#' A raster layer containing bioclimatic variables representing future climatic
#' conditions (2081-2100) based on the MIROC6 General Circulation Model
#' under the SSP585 scenario. The variables were obtained at a 10 arc-minute
#' resolution and masked using the `m` region provided in the package. Data
#' sourced from WorldClim: \url{https://worldclim.org/data/cmip6/cmip6climate.html}
#'
#' @format A `SpatRaster` object.
#'
#' @name future_2100_ssp585_miroc
#'
#' @return No return value. Used with function \code{\link[terra]{rast}} to
#' bring raster variables to analysis.
#'
#' @examples
#' future_2100_ssp585_miroc <- terra::rast(system.file("extdata",
#' "wc2.1_10m_bioc_MIROC6_ssp585_2081-2100.tif",
#' package = "kuenm2"))
#' terra::plot(future_2100_ssp585_miroc)
NULL
#' SpatVector Representing Calibration Area for *Myrcia hatschbachii*
#'
#' A spatial vector defining the calibration area used to extract background
#' points for fitting models of *Myrcia hatschbachii*. The area was generated by
#' creating a minimum convex polygon around presence records (`occ_data`), then
#' applying a 300 km buffer.
#'
#' @format A `Spatvector` object.
#'
#' @name m
#'
#' @return No return value. Used with function \code{\link[terra]{vect}} to
#' bring raster variables to analysis.
#'
#' @examples
#' m <- terra::vect(system.file("extdata",
#' "m.gpkg",
#' package = "kuenm2"))
#' terra::plot(m)
NULL
#' World country polygons from Natural Earth
#'
#' A spatial vector of the world countries. This is a simplified version of the `countries110` from rnaturalearth R package.
#'
#' @format A `Spatvector` object.
#'
#' @name world
#'
#' @return No return value. Used with function \code{\link[terra]{vect}} to
#' bring vector variables to analysis.
#'
#' @examples
#' m <- terra::vect(system.file("extdata",
#' "world.gpkg",
#' package = "kuenm2"))
#' terra::plot(m)
NULL