diff --git a/.Rbuildignore b/.Rbuildignore index b24da4604..689873b25 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ cmip5* # worldclim files ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^LICENSE$ diff --git a/DESCRIPTION b/DESCRIPTION index 5097a52a1..befadf205 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: wallace -Version: 2023.03.16 -Date: 2023-03-16 +Version: 2024.02.23 +Date: 2024-02-23 Title: A Modular Platform for Reproducible Modeling of Species Niches and Distributions Description: The 'shiny' application Wallace is a modular platform for @@ -13,14 +13,14 @@ Description: The 'shiny' application Wallace is a modular platform for website: . Authors@R: c(person("Jamie M.", "Kass", email = "jamie.kass@oist.jp", role = "aut"), - person("Gonzalo E.", "Pinilla-Buitrago", email = "gpinillabuitrago@gradcenter.cuny.edu", role = c("aut", "cre")), + person("Gonzalo E.", "Pinilla-Buitrago", email = "gepinillab@gmail.com", role = "aut"), person("Andrea", "Paz", email = "paz.andreita@gmail.com", role = "aut"), person("Bethany A.", "Johnson", email = "bjohnso005@citymail.cuny.edu", role = "aut"), person("Valentina", "Grisales-Betancur", email = "vgrisale@eafit.edu.co", role = "aut"), person("Dean", "Attali", email = "daattali@gmail.com", role = "aut"), person("Matthew E.", "Aiello-Lammens", email = "matt.lammens@gmail.com", role = "aut"), person("Cory", "Merow", email = "corymerow@gmail.com", role = "aut"), - person("Mary E.", "Blair", email = "mblair1@amnh.org", role = "aut"), + person("Mary E.", "Blair", email = "mblair1@amnh.org", role = c("aut", "cre")), person("Robert P.", "Anderson", email = "randerson@ccny.cuny.edu", role = "aut"), person("Sarah I.", "Meenan", email = "sarah.meenan@gmail.com", role = "ctb"), person("Olivier", "Broennimann", email = "olivier.broennimann@unil.ch", role = "ctb"), @@ -35,10 +35,10 @@ Depends: shiny (>= 1.6.0), leaflet (>= 2.0.2) Imports: - dplyr (>= 1.0.2), changeRangeR, + dplyr (>= 1.0.2), DT (>= 0.5), - ecospat, + ecospat (>= 4.0.0), ENMeval (>= 2.0.3), knitcitations, leafem, @@ -46,11 +46,15 @@ Imports: magrittr, maskRangeR, RColorBrewer, + rJava, rlang, rmarkdown, + sf, shinyalert, shinyjs, shinyWidgets (>= 0.6.0), + spocc (>= 1.2.0), + spThin, terra (>= 1.6-7), zip Suggests: @@ -60,6 +64,7 @@ Suggests: geojsonsf, glue, httr, + glue, jsonlite, knitr, lubridate, @@ -67,20 +72,15 @@ Suggests: maxnet, methods, occCite, - paleobioDB, rangeModelMetadata, raster, rgbif (>= 3.3.0), - rgdal, - rgeos, - rJava, sf, sp, - spThin, - spocc (>= 1.2.0), stars, testthat, - tidyselect + tidyselect, + tools Remotes: cmerow/changeRangeR License: GPL-3 URL: http://wallaceecomod.github.io/wallace/, diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/NAMESPACE b/NAMESPACE index 3f10174a4..c2c65e636 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ export(clearAll) export(create_module) export(ecoClimate_getdata) export(ecoClimate_select) +export(ecospat.plot.nicheDEV) export(envs_ecoClimate) export(envs_userEnvs) export(envs_worldclim) @@ -32,7 +33,6 @@ export(model_bioclim) export(model_maxent) export(mxNonzeroCoefs) export(occs_biomodelos) -export(occs_paleoDb) export(occs_queryDb) export(occs_userOccs) export(part_partitionOccs) diff --git a/NEWS.md b/NEWS.md index e0abc219a..15bec38d4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,28 @@ +wallace 2.1.1 +============= +- Fixed bug in occ density grid & niche overlap +- Updated licensing +- Updated developers & pkg maintainer + +wallace 2.1.0 +============= +- Removed `rgeos` (package expiring) +- Updated team bios +- Added clarification to occs_queryDb guidance text +- Added error msgs to xfer_time + +wallace 2.0.6 +============= +- Removed `paleobioDB` (package off CRAN) +- Removed `rgdal` (package expiring) +- Changed Maintainer e-mail + +wallace 2.0.5 +============= +- added try() to test_envs_worldclim.R +- fixed broken links in guidance texts refs +- fixed typo in thinOccs documentation + wallace 2.0.4 ============= - Added Spanish translation of vignette diff --git a/R/custom_modules.R b/R/custom_modules.R index 3a0268275..0268ddf6e 100644 --- a/R/custom_modules.R +++ b/R/custom_modules.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# custom_modules.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' Register a Wallace module #' #' Before running the Wallace application with \code{run_wallace()}, you can diff --git a/R/envs_ecoClimate.R b/R/envs_ecoClimate.R index 61e3917c0..4e7172a04 100644 --- a/R/envs_ecoClimate.R +++ b/R/envs_ecoClimate.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# envs_ecoClimate.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title envs_ecoClimate Obtain ecoClimate variables #' @description download ecoClimate variables. See www.ecoclimate.org. @@ -32,7 +55,7 @@ #' #' @author Sara Varela #' @author Jamie M. Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' #' @export #' diff --git a/R/envs_userEnvs.R b/R/envs_userEnvs.R index 44fbc57cd..18a153199 100644 --- a/R/envs_userEnvs.R +++ b/R/envs_userEnvs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# envs_userEnvs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' #' @title envs_userEnvs #' @description Load user provided rasters @@ -30,7 +53,7 @@ #' provided rasters #' #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @export #' #' diff --git a/R/envs_worldclim.R b/R/envs_worldclim.R index 84b536d48..98ed0c045 100644 --- a/R/envs_worldclim.R +++ b/R/envs_worldclim.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# envs_worldclim.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title envs_worldclim Obtain WorldClim variables #' @description download WorldClim variables. See www.worldclim.com. #' @@ -29,7 +52,7 @@ #' worldclim rasters at the requested resolution. #' #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' #' @seealso \code{\link[raster]{getData}} #' diff --git a/R/espace_nicheOv.R b/R/espace_nicheOv.R index 5e0824d1b..b30f67736 100644 --- a/R/espace_nicheOv.R +++ b/R/espace_nicheOv.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# espace_nicheOv.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title espace_nicheOv Niche Overlap #' @description Function evaluates niche overlap between the two species for #' which the occurrence density grid was computed @@ -54,7 +77,7 @@ #' } #' #' @return A list of 4 elements if all is set to TRUE. Elements are overlap -#' (Schoener's D), USE (ecopstat.niche.dyn.index), equiv and simil. +#' (Schoener's D), USE (ecospat.niche.dyn.index), equiv and simil. #' @author Jamie Kass #' @author Olivier Broennimann #' @seealso \code{\link{espace_pca}} \code{\link{espace_occDens}} @@ -80,7 +103,7 @@ espace_nicheOv <- function(z1, z2, iter = 100, equivalency = FALSE, if (equivalency == TRUE) { smartProgress(logger, message = "Calculating niche equivalency...", { nicheOv$equiv <- ecospat::ecospat.niche.equivalency.test( - z1, z2, iter, overlap.alternative = "higher" + z1, z2, rep = 100, overlap.alternative = "higher" ) }) } @@ -88,7 +111,7 @@ espace_nicheOv <- function(z1, z2, iter = 100, equivalency = FALSE, if (similarity == TRUE) { smartProgress(logger, message = "Calculating niche similarity", { nicheOv$simil <- ecospat::ecospat.niche.similarity.test( - z1, z2, iter, overlap.alternative = "higher", rand.type = 1 + z1, z2, rep = 100, overlap.alternative = "higher", rand.type = 1 ) }) } diff --git a/R/espace_occDens.R b/R/espace_occDens.R index ff4ea0b62..a83546fa5 100644 --- a/R/espace_occDens.R +++ b/R/espace_occDens.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# espace_occDens.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title Occurrence density grid #' @description calculates the part of environmental space more densely @@ -48,7 +71,7 @@ #' } #' #' @return Returns a list of 2 lists (one for each species). Each list is an -#' ecospat noche object that contains 10 species specific slots with +#' ecospat niche object that contains 10 species specific slots with #' information outputed by ecospat::grid.clim.dyn. z.uncor is the density of #' occurrence of the species and z.cor the occupancy of the environment by #' the species. It has the input parameters as individual slots. diff --git a/R/espace_pca.R b/R/espace_pca.R index 7c27992f8..2911a2df9 100644 --- a/R/espace_pca.R +++ b/R/espace_pca.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# espace_pca.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title espace_pca Principal component analysis #' @description Principal component analysis to reduce dimensionality of #' environmental space diff --git a/R/helper_functions.R b/R/helper_functions.R index b308d72e5..d72aae496 100644 --- a/R/helper_functions.R +++ b/R/helper_functions.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# helper_functions.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# ####################### # # MISC # ####################### # @@ -362,6 +385,50 @@ remEnvsValsNA <- function(occs, occsEnvsVals, spN, logger) { }) } +####################### # +# ESPACE # +####################### # +#' @title ecospat.plot.nicheDEV +#' @description For internal use. Plot occ density +#' @param z A gridclim object for the species distribution created by ecospat.grid.clim.dyn()/espace_occDens(). +#' @param title A title for the plot. +#' @param name.axis1 A label for the first axis. +#' @param name.axis2 A label for the second axis. +#' @param cor Correct the occurrence densities of the species by the prevalence of the environments in its range (TRUE = yes, FALSE = no). +#' @keywords internal +#' @export +ecospat.plot.nicheDEV <- function(z, title = "", name.axis1 = "Axis 1", name.axis2 = "Axis 2", cor = FALSE) { + if (is.null(z$y)) { + R <- length(z$x) + x <- z$x + xx <- sort(rep(1:length(x), 2)) + if (cor == FALSE) + y1 <- z$z.uncor/max(z$z.uncor) + if (cor == TRUE) + y1 <- z$z.cor/max(z$z.cor) + Y1 <- z$Z/max(z$Z) + yy1 <- sort(rep(1:length(y1), 2))[-c(1:2, length(y1) * 2)] + YY1 <- sort(rep(1:length(Y1), 2))[-c(1:2, length(Y1) * 2)] + plot(x, y1, type = "n", xlab = name.axis1, ylab = "density of occurrence") + graphics::polygon(x[xx], c(0, y1[yy1], 0, 0), col = "grey") + graphics::lines(x[xx], c(0, Y1[YY1], 0, 0)) + } + if (!is.null(z$y)) { + if (cor == FALSE) + terra::plot(z$z.uncor,col=grDevices::gray(100:0 / 100),legend=FALSE, xlab = name.axis1, + ylab = name.axis2,mar = c(3.1,3.1,2.1,3.1)) + if (cor == TRUE) + terra::plot(z$z.cor,col=grDevices::gray(100:0 / 100),legend=FALSE, xlab = name.axis1, + ylab = name.axis2,mar = c(3.1,3.1,2.1,3.1)) + terra::contour( + z$Z, add = TRUE, levels = stats::quantile(z$Z[z$Z > 0], c(0, 0.5)), + drawlabels = FALSE, lty = c(1, 2) + ) + } + title(title) +} +# end of espace. BAJ added 10/31/2023 after ecospat.plot.niche() from ecospat 4.0.0 wasn't working + ####################### # # VISUALIZE & TRANSFER # ####################### # diff --git a/R/mask_spatialPoly.R b/R/mask_spatialPoly.R index a3b9d6abb..d52b89e18 100644 --- a/R/mask_spatialPoly.R +++ b/R/mask_spatialPoly.R @@ -5,7 +5,7 @@ #' x #' #' @param bgShp_path Path to the user provided shapefile -#' @param bgShp_name Name of the user porvided shapefile +#' @param bgShp_name Name of the user provided shapefile #' @param sdm x #' @param logger stores all notification messages to be displayed in the Log Window of Wallace GUI. insert the logger reactive list here for running in shiny, #' otherwise leave the default NULL @@ -40,7 +40,8 @@ mask_spatialPoly <- function(bgShp_path, bgShp_name, sdm, file.rename(bgShp_path, file.path(pathdir, bgShp_name)) } smartProgress(logger, message = "Uploading shapefile ...", { - polyData <- rgdal::readOGR(file.path(pathdir, bgShp_name)[i]) + polyData <- sf::st_read(file.path(pathdir, bgShp_name)[i]) + polyData <- sf::as_Spatial(polyData) }) } else { @@ -57,11 +58,14 @@ mask_spatialPoly <- function(bgShp_path, bgShp_name, sdm, "is WGS84 (**)" ) } - if (!rgeos::gIntersects(methods::as(raster::extent(sdm), 'SpatialPolygons'), - polyData)) { + + sdm_ext <- methods::as(raster::extent(sdm), 'SpatialPolygons') + sdm_sfc <- sf::st_as_sfc(sdm_ext) #sdm extent to sfc + polyData_sfc <- sf::st_as_sfc(polyData) #convert polyData to sfc + if (!sf::st_intersects(sdm_sfc, polyData_sfc, sparse = FALSE)[1,1]) { logger %>% writeLog( type = 'error', hlSpp(spN), - "Shapefile does not match with sdm extent. Please specify a new polygon. (**)" + "Shapefile does not match with SDM extent. Please specify a new polygon. " ) return() } @@ -73,8 +77,9 @@ mask_spatialPoly <- function(bgShp_path, bgShp_name, sdm, polR <- sf::st_as_sf(terra::as.polygons(sdm, trunc = TRUE, dissolve = TRUE, values = TRUE), as_points = FALSE, merge = TRUE) - polyData <- rgeos::gBuffer(polyData, byid = TRUE, width = 0) + # polyData <- rgeos::gBuffer(polyData, byid = TRUE, width = 0) polyData <- sf::st_as_sf(polyData) + polyData <- sf::st_buffer(polyData, dist = 0) # BAJ not sure why buffer of 0 is needed? polyData <- replace(polyData, is.na(polyData), values = "NA") # Check for NAs v <- terra::extract(sdm, polyData) diff --git a/R/model_bioclim.R b/R/model_bioclim.R index 3ff630ee8..699afcd62 100644 --- a/R/model_bioclim.R +++ b/R/model_bioclim.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# model_bioclim.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title model_bioclim Generate Bioclim model #' @description The function generates a BIOCLIM model using @@ -39,7 +62,7 @@ #' and a selection of appropriate fields. #' @author Jamie M. Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note #' @seealso \code{\link[ENMeval]{ENMevaluate}} diff --git a/R/model_maxent.R b/R/model_maxent.R index bc61a651e..6e2db6824 100644 --- a/R/model_maxent.R +++ b/R/model_maxent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# model_maxent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title model_maxent Generate maxent.jar or maxnet model #' @description This functions generates maxent.jar or maxnet models using @@ -61,7 +84,7 @@ #' @return Function returns an ENMevaluate object with all the evaluated models #' and a selection of appropriate fields. #' @author Jamie M. Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note #' @seealso \code{\link[ENMeval]{ENMevaluate}} diff --git a/R/occs_paleoDb.R b/R/occs_paleoDb.R index 91975915a..2eb27f60b 100644 --- a/R/occs_paleoDb.R +++ b/R/occs_paleoDb.R @@ -1,124 +1,147 @@ -#' @title `occs_paleoDb` query paleobioDB database -#' @description -#' query paleobioDB database and returns the complete list of data, data with -#' coordinates, and data with no duplicates +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# occs_paleoDb.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# +#' #' @title `occs_paleoDb` query paleobioDB database +#' #' @description +#' #' query paleobioDB database and returns the complete list of data, data with +#' #' coordinates, and data with no duplicates +#' #' +#' #' @details +#' #' This function is called by the module occs_queryDb to query the paleobioDB +#' #' database for species occurrence records in the Holocene. It removes +#' #' records with duplicate coordinates, and selects some columns with fields +#' #' appropriate to studies in biogeography. +#' #' +#' #' @param spName character. Species name. For paleobioDb it returns records +#' #' associated with the specified taxonomic name, including any synonyms. +#' #' @param occNum integer maximum number of records. +#' #' @param timeInterval character currently a single timeInterval is allowed: +#' #' "Holocene" (Holocene). +#' #' @param logger Stores all notification messages to be displayed in the +#' #' Log Window of Wallace GUI. Insert the logger reactive list here for +#' #' running in shiny, otherwise leave the default NULL +#' #' @return A list of 2 dataframes. First dataframe is the original downloaded +#' #' dataset, second dataframe without duplicates and with appropriate fields +#' #' for analyses. +#' #' @author Jamie Kass +#' #' @author Gonzalo E. Pinilla-Buitrago +#' #' @author Sara Varela +#' #' @examples +#' #' \dontrun{ +#' #' spName <- "Didelphis virginiana" +#' #' occNum <- 100 +#' #' timeInterval <- "Holocene" +#' #' occsPaleo <- occs_paleoDb(spName, occNum, timeInterval) +#' #' } +#' #' @export #' -#' @details -#' This function is called by the module occs_queryDb to query the paleobioDB -#' database for species occurrence records in the Holocene. It removes -#' records with duplicate coordinates, and selects some columns with fields -#' appropriate to studies in biogeography. +#' occs_paleoDb <- function(spName, occNum, timeInterval, logger = NULL) { +#' if (!requireNamespace("paleobioDB", quietly = TRUE)) { +#' logger %>% +#' writeLog( +#' type = "warning", +#' "This module is available if you install the 'paleobioDB' package ", +#' "(which is a suggested package for Wallace, not a required dependency). If you ", +#' "want to install it, close Wallace and run the following line in the ", +#' "R Console: ", em("install.packages('paleobioDB')") +#' ) +#' return() +#' } +#' spName <- trimws(spName) +#' # figure out how many separate names (components of scientific name) were entered +#' nameSplit <- length(unlist(strsplit(spName, " "))) +#' # if two names not entered, throw error and return +#' if (nameSplit != 2) { +#' logger %>% writeLog(type = 'error', +#' 'Please input both genus and species names of ONE species.') +#' return() +#' } +#' spName <- paste0(toupper(substring(spName, 1, 1)), +#' substring(spName, 2, nchar(spName))) +#' smartProgress(logger, message = paste0("Querying paleobioDB ..."), { +#' occsOrig <- try(paleobioDB::pbdb_occurrences(taxon_name = spName, +#' limit = occNum, +#' interval = timeInterval, +#' vocab = 'pbdb', +#' show = c("coords", "bin", "loc")), +#' silent = TRUE) +#' }) #' -#' @param spName character. Species name. For paleobioDb it returns records -#' associated with the specified taxonomic name, including any synonyms. -#' @param occNum integer maximum number of records. -#' @param timeInterval character currently a single timeInterval is allowed: -#' "Holocene" (Holocene). -#' @param logger Stores all notification messages to be displayed in the -#' Log Window of Wallace GUI. Insert the logger reactive list here for -#' running in shiny, otherwise leave the default NULL -#' @return A list of 2 dataframes. First dataframe is the original downloaded -#' dataset, second dataframe without duplicates and with appropriate fields -#' for analyses. -#' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago -#' @author Sara Varela -#' @examples -#' \dontrun{ -#' spName <- "Didelphis virginiana" -#' occNum <- 100 -#' timeInterval <- "Holocene" -#' occsPaleo <- occs_paleoDb(spName, occNum, timeInterval) +#' if (inherits(occsOrig, "try-error")) { +#' logger %>% writeLog( +#' type = 'error', +#' hlSpp(hlSpp(fmtSpN(spName))), +#' "No records found, please check the spelling.") +#' return() +#' } +#' +#' occsOrig <- dplyr::as_tibble(occsOrig) +#' occsOrig$lng <- as.numeric(occsOrig$lng) +#' occsOrig$lat <- as.numeric(occsOrig$lat) +#' # get total number of records found in database +#' totRows <- nrow(occsOrig) +#' # extract occurrence tibble +#' names(occsOrig)[names(occsOrig) == "lng"] <- "longitude" +#' names(occsOrig)[names(occsOrig) == "lat"] <- "latitude" +#' names(occsOrig)[names(occsOrig) == "cc"] <- "country" +#' occsOrig$taxon_name <- as.character(occsOrig$taxon_name) +#' names(occsOrig)[names(occsOrig) == "taxon_name"] <- "scientific_name" +#' +#' # make new column for original ID +#' occsOrig$occID <- 1:nrow(occsOrig) +#' +#' # subset to just records with latitude and longitude +#' # all plaeobioDB recors have coords, so this warning is commented until future database +#' # occsXY <- occsOrig[!is.na(occsOrig$longitude) & !is.na(occsOrig$latitude),] +#' # if (nrow(occsXY) == 0) { +#' # logger %>% writeLog( +#' # type = 'warning', +#' # hlSpp(spName), "No records with coordinates found in paleobioDB.") +#' # } +#' occsXY <- occsOrig +#' +#' dups <- duplicated(occsXY[,c('longitude','latitude')]) +#' occs <- occsXY[!dups, ] +#' +#' # subset by key columns and make id and popup columns +#' cols <- c("occID", "scientific_name", "longitude", "latitude", +#' # "early_interval", "late_interval", +#' "country", "collection_no", "record_type", +#' "early_age", "late_age") +#' occs <- occs %>% dplyr::select(dplyr::one_of(cols)) %>% +#' # make new column for leaflet marker popup content +#' dplyr::mutate(pop = unlist(apply(occs, 1, popUpContent))) %>% +#' dplyr::arrange(dplyr::across(cols)) +#' occs$early_age <- as.numeric(occs$early_age) +#' occs$late_age <- as.numeric(occs$late_age) +#' noCoordsRem <- nrow(occsOrig) - nrow(occsXY) +#' +#' dupsRem <- nrow(occsXY) - nrow(occs) +#' logger %>% writeLog( +#' hlSpp(fmtSpN(spName)), +#' 'Total paleobioDb records returned [', nrow(occsOrig), '] (limit ', occNum, +#' '). Records without coordinates removed [', +#' noCoordsRem, ']. Duplicated records removed [', dupsRem, +#' ']. Remaining records [', nrow(occs), '].') +#' return(list(orig = occsOrig, cleaned = as.data.frame(occs))) #' } -#' @export - -occs_paleoDb <- function(spName, occNum, timeInterval, logger = NULL) { - if (!requireNamespace("paleobioDB", quietly = TRUE)) { - logger %>% - writeLog( - type = "warning", - "This module is available if you install the 'paleobioDB' package ", - "(which is a suggested package for Wallace, not a required dependency). If you ", - "want to install it, close Wallace and run the following line in the ", - "R Console: ", em("install.packages('paleobioDB')") - ) - return() - } - spName <- trimws(spName) - # figure out how many separate names (components of scientific name) were entered - nameSplit <- length(unlist(strsplit(spName, " "))) - # if two names not entered, throw error and return - if (nameSplit != 2) { - logger %>% writeLog(type = 'error', - 'Please input both genus and species names of ONE species.') - return() - } - spName <- paste0(toupper(substring(spName, 1, 1)), - substring(spName, 2, nchar(spName))) - smartProgress(logger, message = paste0("Querying paleobioDB ..."), { - occsOrig <- try(paleobioDB::pbdb_occurrences(taxon_name = spName, - limit = occNum, - interval = timeInterval, - vocab = 'pbdb', - show = c("coords", "bin", "loc")), - silent = TRUE) - }) - - if (inherits(occsOrig, "try-error")) { - logger %>% writeLog( - type = 'error', - hlSpp(hlSpp(fmtSpN(spName))), - "No records found, please check the spelling.") - return() - } - - occsOrig <- dplyr::as_tibble(occsOrig) - occsOrig$lng <- as.numeric(occsOrig$lng) - occsOrig$lat <- as.numeric(occsOrig$lat) - # get total number of records found in database - totRows <- nrow(occsOrig) - # extract occurrence tibble - names(occsOrig)[names(occsOrig) == "lng"] <- "longitude" - names(occsOrig)[names(occsOrig) == "lat"] <- "latitude" - names(occsOrig)[names(occsOrig) == "cc"] <- "country" - occsOrig$taxon_name <- as.character(occsOrig$taxon_name) - names(occsOrig)[names(occsOrig) == "taxon_name"] <- "scientific_name" - - # make new column for original ID - occsOrig$occID <- 1:nrow(occsOrig) - - # subset to just records with latitude and longitude - # all plaeobioDB recors have coords, so this warning is commented until future database - # occsXY <- occsOrig[!is.na(occsOrig$longitude) & !is.na(occsOrig$latitude),] - # if (nrow(occsXY) == 0) { - # logger %>% writeLog( - # type = 'warning', - # hlSpp(spName), "No records with coordinates found in paleobioDB.") - # } - occsXY <- occsOrig - - dups <- duplicated(occsXY[,c('longitude','latitude')]) - occs <- occsXY[!dups, ] - - # subset by key columns and make id and popup columns - cols <- c("occID", "scientific_name", "longitude", "latitude", - # "early_interval", "late_interval", - "country", "collection_no", "record_type", - "early_age", "late_age") - occs <- occs %>% dplyr::select(dplyr::one_of(cols)) %>% - # make new column for leaflet marker popup content - dplyr::mutate(pop = unlist(apply(occs, 1, popUpContent))) %>% - dplyr::arrange(dplyr::across(cols)) - occs$early_age <- as.numeric(occs$early_age) - occs$late_age <- as.numeric(occs$late_age) - noCoordsRem <- nrow(occsOrig) - nrow(occsXY) - - dupsRem <- nrow(occsXY) - nrow(occs) - logger %>% writeLog( - hlSpp(fmtSpN(spName)), - 'Total paleobioDb records returned [', nrow(occsOrig), '] (limit ', occNum, - '). Records without coordinates removed [', - noCoordsRem, ']. Duplicated records removed [', dupsRem, - ']. Remaining records [', nrow(occs), '].') - return(list(orig = occsOrig, cleaned = as.data.frame(occs))) -} diff --git a/R/occs_queryDb.R b/R/occs_queryDb.R index 2645baca7..0e5cea1fc 100644 --- a/R/occs_queryDb.R +++ b/R/occs_queryDb.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# occs_queryDb.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' occs_queryDb Query online database for species occurrence records. #' #' @description Queries a given database for occurrence data on the provided species @@ -32,7 +55,7 @@ #' individual species list with appropriate fields for analysis #' #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @author Hannah Owens #' @author Andrea Paz #' @examples diff --git a/R/occs_userOccs.R b/R/occs_userOccs.R index 23a0702d6..cb423a21c 100644 --- a/R/occs_userOccs.R +++ b/R/occs_userOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# occs_userOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title occs_userOccs Loads user provided occurrence records #' @description #' Load user database with species occurrence records. Returns a list of lists, @@ -26,7 +49,7 @@ #' @return List of lists. One list per species with occurrence records. Each #' individual species list with appropriate fields for analysis #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @importFrom rlang .data #' @export diff --git a/R/part_partitionOccs.R b/R/part_partitionOccs.R index dece2e5a0..4fe048bd3 100644 --- a/R/part_partitionOccs.R +++ b/R/part_partitionOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# part_partitionOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title part_partitionOccs Partition occurrence data #' @description This function partitions occurrence data and background points @@ -50,7 +73,7 @@ #' @return A list of two vectors containing group assignments for occurrences #' (occs.grp) and background points (bg.grp). #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @author Andrea Paz # @note #' @seealso \code{\link[ENMeval]{partitions}} diff --git a/R/penvs_bgExtent.R b/R/penvs_bgExtent.R index ca0f8b5ff..182ce02f5 100644 --- a/R/penvs_bgExtent.R +++ b/R/penvs_bgExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_bgExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title penvs_bgExtent Generate background extent #' @description This function generates a background area according to a user- @@ -26,9 +49,10 @@ #' occs$occID <- 1:nrow(occs) #' bgExt <- penvs_bgExtent(occs, bgSel = 'bounding box', bgBuf = 0.5) #' -#' @return A SpatialPolygonsDataFrame object that contains all occurrences from occs +#' @return A SpatialPolygons object that contains all occurrences from occs #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago +#' @author Bethany A. Johnson # @note #' @seealso \code{\link{penvs_userBgExtent}}, \code{\link{penvs_drawBgExtent}}, @@ -51,6 +75,10 @@ penvs_bgExtent <- function(occs, bgSel, bgBuf, logger = NULL, spN = NULL) { # make spatial pts object of original occs and preserve origID occs.sp <- sp::SpatialPointsDataFrame(occs.xy, data = occs['occID']) + # make an sf obj + occs.sf <- sf::st_as_sf(occs.xy, coords = c("longitude", "latitude")) + occs.sf <- sf::st_union(occs.sf, by_feature = FALSE) + # generate background extent - one grid cell is added to perimeter of each shape # to ensure cells of points on border are included if (bgSel == 'bounding box') { @@ -70,22 +98,29 @@ penvs_bgExtent <- function(occs, bgSel, bgBuf, logger = NULL, spN = NULL) { bgExt <- sp::SpatialPolygons(list(sp::Polygons(list(sp::Polygon(as.matrix(xy.bord))), 1))) msg <- "Study extent: minimum convex polygon." } else if (bgSel == 'point buffers') { - if (bgBuf == 0) { + if (bgBuf <= 0) { logger %>% writeLog(type = 'error', - 'Change buffer distance to positive or negative value.') + 'Change buffer distance to a positive value.') return() } - bgExt <- rgeos::gBuffer(occs.sp, width = bgBuf) + bgExt <- sf::st_buffer(occs.sf, dist = bgBuf) msg <- paste0("Study extent: buffered points. Buffered by ", bgBuf, " degrees.") } - if (bgBuf > 0 & bgSel != 'point buffers') { - bgExt <- rgeos::gBuffer(bgExt, width = bgBuf) + if (bgBuf >= 0 & bgSel != 'point buffers') { + bgExt <- sf::st_as_sf(bgExt) + bgExt <- sf::st_buffer(bgExt, dist = bgBuf) logger %>% writeLog(hlSpp(spN), msg, ' Buffered by ', bgBuf, ' degrees.') + } else if (bgBuf < 0 & bgSel != 'point buffers') { + logger %>% + writeLog(type = 'error', + 'All localities must be included within extent. + Change buffer distance to a positive value.') + return() } else { logger %>% writeLog(hlSpp(spN), msg) } - bgExt <- methods::as(bgExt, "SpatialPolygonsDataFrame") + bgExt <- sf::as_Spatial(bgExt) return(bgExt) } diff --git a/R/penvs_bgMask.R b/R/penvs_bgMask.R index df7b704b2..7aca1b865 100644 --- a/R/penvs_bgMask.R +++ b/R/penvs_bgMask.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_bgMask.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title penvs_bgMask Mask environmental data #' @description This functions crops and masks the environmental data to the @@ -39,7 +62,7 @@ #' @return A RasterStack or a RasterBrick of environmental layers cropped and #' masked to match the provided background extent. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @seealso \code{\link{penvs_userBgExtent}}, #' \code{\link{penvs_drawBgExtent}}, \code{\link{penvs_bgExtent}}, #' \code{\link{penvs_bgSample}} diff --git a/R/penvs_bgSample.R b/R/penvs_bgSample.R index 093466709..e23a426bb 100644 --- a/R/penvs_bgSample.R +++ b/R/penvs_bgSample.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_bgSample.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title penvs_bgSample Sample background points #' @description This function samples background points from an area determined @@ -43,7 +66,7 @@ #' Maximum number of points is equal to non NA cells in each layer of the #' reference brick or stack. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @seealso \code{\link{penvs_bgMask}}, \code{\link{penvs_bgExtent}} #' \code{\link{penvs_userBgExtent}}, \code{\link{penvs_drawBgExtent}}, #' \code{\link[dismo]{randomPoints}} diff --git a/R/penvs_drawBgExtent.R b/R/penvs_drawBgExtent.R index 4870b3642..769b05ae6 100644 --- a/R/penvs_drawBgExtent.R +++ b/R/penvs_drawBgExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_drawBgExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title penvs_drawBgExtent: Draw background extent #' @description This function generates a background area according to a user #' drawn polygon and provided buffer. @@ -35,13 +58,14 @@ #' ncol = 2) #' drawBgBf <- penvs_drawBgExtent(polyExtXY = expertDrawPoly, polyExtID = 1, #' drawBgBuf = 0.5, occs) -#' @return This functions returns a SpatialPolygonsDataFrame based on the user -#' specified coordinates (drawn on map). This SpatialPolygonsDataFrame may be -#' larger than specified if drawBgBuf > 0. The SpatialPolygonsDataFrame will +#' @return This functions returns a SpatialPolygons object based on the user +#' specified coordinates (drawn on map). This SpatialPolygons object may be +#' larger than specified if drawBgBuf > 0. The SpatialPolygons object will #' include all occurrences. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago +#' @author Bethany A. Johnson # @note #' @seealso \code{\link{penvs_userBgExtent}}, \code{\link{penvs_bgExtent}}, #' \code{\link{penvs_bgMask}} , \code{\link{penvs_bgSample}} @@ -56,10 +80,12 @@ penvs_drawBgExtent <- function(polyExtXY, polyExtID, drawBgBuf, occs, newPoly <- sp::SpatialPolygons(list(sp::Polygons(list(sp::Polygon(polyExtXY)), ID = polyExtID))) intersect <- sp::over(pts, newPoly) + newPoly.sf <- sf::st_as_sf(newPoly) + ptRem <- ifelse(all(!is.na(intersect)), 0, as.numeric(which(is.na(intersect)))) if (ptRem == 0) { - bgExt <- rgeos::gBuffer(newPoly, width = drawBgBuf) - bgExt <- methods::as(bgExt, "SpatialPolygonsDataFrame") + bgExt <- sf::st_buffer(newPoly.sf, dist = drawBgBuf) + bgExt <- sf::as_Spatial(bgExt) if (drawBgBuf == 0) { logger %>% writeLog(hlSpp(spN), 'Draw polygon without buffer.') } else { diff --git a/R/penvs_userBgExtent.R b/R/penvs_userBgExtent.R index 26ea7d570..384e7e813 100644 --- a/R/penvs_userBgExtent.R +++ b/R/penvs_userBgExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_userBgExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title penvs_userBgExtent: user provided background extent #' @description This function generates a background area according to a user #' provided polygon and buffer. @@ -34,11 +57,12 @@ #' userBgBuf = 0.2, occs = occs) #' #' @return This function returns a SpatialPolygons object with the user -#' provided shape (+ a buffer is userBgBuf >0). The polygon will be at least +#' provided shape (+ a buffer if userBgBuf >0). The polygon will be at least #' large enough to contain all occurrences. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @author Andrea Paz +#' @author Bethany A. Johnson # @note #' @seealso \code{\link{penvs_drawBgExtent}}, \code{\link{penvs_bgExtent}}, @@ -68,7 +92,8 @@ penvs_userBgExtent <- function(bgShp_path, bgShp_name, userBgBuf, occs, file.rename(bgShp_path, file.path(pathdir, bgShp_name)) } # read in shapefile and extract coords - bgExt <- rgdal::readOGR(file.path(pathdir, bgShp_name)[i]) + bgExt <- sf::st_read(file.path(pathdir, bgShp_name)[i]) + bgExt <- sf::as_Spatial(bgExt) } else { logger %>% writeLog(type = 'error', @@ -78,8 +103,13 @@ penvs_userBgExtent <- function(bgShp_path, bgShp_name, userBgBuf, occs, } if (userBgBuf >= 0) { - bgExt <- rgeos::gBuffer(bgExt, width = userBgBuf) - bgExt <- methods::as(bgExt, "SpatialPolygonsDataFrame") + bgExt <- sf::st_as_sf(bgExt) + bgExt <- sf::st_buffer(bgExt, dist = userBgBuf) + bgExt <- sf::as_Spatial(bgExt) + } else { + bgExt <- sf::st_as_sf(bgExt) + bgExt <- sf::st_buffer(bgExt, dist = userBgBuf) + bgExt <- sf::as_Spatial(bgExt) } ### Points outside polygon diff --git a/R/poccs_removeByID.R b/R/poccs_removeByID.R index 49379fcd7..c29af4ddf 100644 --- a/R/poccs_removeByID.R +++ b/R/poccs_removeByID.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# poccs_removeByID.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title poccs_removeByID Remove occurrence by ID #' @description This function removes user selected occurrences by ID. @@ -27,7 +50,7 @@ #' mantaining all columns from original dataframe for further analyses. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note # @seealso diff --git a/R/poccs_selectOccs.R b/R/poccs_selectOccs.R index bc9f04165..1d15ea255 100644 --- a/R/poccs_selectOccs.R +++ b/R/poccs_selectOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# poccs_selectOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title poccs_selectOccs Remove occurrences outside of polygon #' @description This function removes occurrences outside of a user created #' polygon. @@ -37,7 +60,7 @@ #' provided polygon and mantaining all columns from original dataframe for #' further analyses. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @export poccs_selectOccs <- function(occs, polySelXY, polySelID = 1, logger = NULL, diff --git a/R/poccs_thinOccs.R b/R/poccs_thinOccs.R index 58751b16d..dfebbf9f4 100644 --- a/R/poccs_thinOccs.R +++ b/R/poccs_thinOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# poccs_thinOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title poocs_thinOccs Thin occurrences #' @description The function thins the observed occurrences by a user provided @@ -11,7 +34,7 @@ #' #' @param occs data frame of cleaned occurrences obtained from component occs: #' Obtain occurrence data -#' @param thinDist distance in meters to be used for thinning. Number must be +#' @param thinDist distance in kilometers to be used for thinning. Number must be #' positive. #' @param logger Stores all notification messages to be displayed in the Log #' Window of Wallace GUI. Insert the logger reactive list here for running @@ -29,7 +52,7 @@ #' @return Output is a data frame of thinned occurences (all occurences at a #' distance >thinDist) with the same columns as occs #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @seealso \code{\link[spThin]{thin}} #' @export diff --git a/R/run_wallace.R b/R/run_wallace.R index 8c5b5c897..d74c16258 100644 --- a/R/run_wallace.R +++ b/R/run_wallace.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# run_wallace.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title Run \emph{Wallace} Application #' @description This function runs the \emph{Wallace} application in the user's #' default web browser. @@ -14,7 +37,7 @@ #' run_wallace() #' } #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @export run_wallace <- function(launch.browser = TRUE, port = getOption("shiny.port"), biomodelos = FALSE) { diff --git a/R/vis_bioclimPlot.R b/R/vis_bioclimPlot.R index fcf4cdd26..2b3c4b383 100644 --- a/R/vis_bioclimPlot.R +++ b/R/vis_bioclimPlot.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# vis_bioclimPlot.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title vis_bioclimPlot Visualize bivariate plot of BIOCLIM model #' @description @@ -44,7 +67,7 @@ #' are shown as green circles and those outside of the envelope for one ore #' more variables are plotted as orange triangles. #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note #' @seealso #'\code{\link{model_bioclim}} \code{\link[ENMeval]{ENMevaluate}} diff --git a/R/wallace-package.R b/R/wallace-package.R index 16ce28758..234b483b1 100644 --- a/R/wallace-package.R +++ b/R/wallace-package.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# wallace-package.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @name wallace-package #' @aliases wallace #' @aliases wallace-package diff --git a/R/xfer_area.R b/R/xfer_area.R index 16bf50c28..f89aedde8 100644 --- a/R/xfer_area.R +++ b/R/xfer_area.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_area.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title xfer_area Transfer model to a new area #' @description Function transfers the model generated in previous components to @@ -60,7 +83,7 @@ #' the specified output type. #' @author Jamie Kass #' @author Andrea Paz -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note #' @seealso \code{\link[dismo]{predict}}, \code{\link{xfer_time}} #' \code{\link{xfer_userEnvs}} diff --git a/R/xfer_draw.R b/R/xfer_draw.R index 453185f6b..4eac042c5 100644 --- a/R/xfer_draw.R +++ b/R/xfer_draw.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_draw.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title xfer_draw Draw extent of transfer #' @description This function creates a polygon object from coordinates of user @@ -29,11 +52,12 @@ #' polygonTest <- xfer_draw(polyXfXY = userDrawPoly, polyXfID, #' drawXfBuf) #' -#' @return This functions returns a SpatialPolygonsDataFrame based on the user +#' @return This functions returns a SpatialPolygons object based on the user #' specified coordinates (drawn on map). This SpatialPolygonsDataFrame may be #' larger than specified if drawBgBuf > 0. -#' @author Gonzalo Pinilla +#' @author Gonzalo Pinilla +#' @author Bethany A. Johnson # @note #' @seealso \code{\link{xfer_userEnvs}} #' @export @@ -41,8 +65,9 @@ xfer_draw <- function(polyXfXY, polyXfID, drawXfBuf, logger = NULL, spN = NULL) { newPoly <- sp::SpatialPolygons(list(sp::Polygons(list(sp::Polygon(polyXfXY)), ID = polyXfID))) - bgExt <- rgeos::gBuffer(newPoly, width = drawXfBuf) - bgExt <- methods::as(bgExt, "SpatialPolygonsDataFrame") + newPoly.sf <- sf::st_as_sf(newPoly) + bgExt <- sf::st_buffer(newPoly.sf, dist = drawXfBuf) + bgExt <- sf::as_Spatial(bgExt) if (drawXfBuf == 0) { logger %>% writeLog(hlSpp(spN), 'Draw polygon without buffer.') } else { diff --git a/R/xfer_mess.R b/R/xfer_mess.R index 157fc2661..ed61838ec 100644 --- a/R/xfer_mess.R +++ b/R/xfer_mess.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_mess.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title xfer_mess generate MESS map for transferred raster #' @description This function generates a MESS map for the new variables for @@ -47,7 +70,7 @@ #' } # @return #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note #' @seealso \code{\link[dismo]{mess}}, \code{\link{xfer_time}} diff --git a/R/xfer_time.R b/R/xfer_time.R index bbf93874b..4e28f11d3 100644 --- a/R/xfer_time.R +++ b/R/xfer_time.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_time.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title xfer_time Transfer model to a new time #' @description Function transfers the model generated in previous components to @@ -71,7 +94,7 @@ #' with the specified output type. #' @author Jamie Kass #' @author Andrea Paz -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @seealso \code{\link[dismo]{predict}}, \code{\link{xfer_time}} #' \code{\link{xfer_userEnvs}} #' @export diff --git a/R/xfer_userEnvs.R b/R/xfer_userEnvs.R index 8639e3a92..6a2c0fce8 100644 --- a/R/xfer_userEnvs.R +++ b/R/xfer_userEnvs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_userEnvs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title xfer_userEnvs Transfer model to user specified area and time #' @description The function transfers the model generated in previous components #' to user uploaded environmental variables. @@ -55,7 +78,7 @@ #' #' @author Jamie Kass #' @author Andrea Paz -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago # @note #' @seealso \code{\link[dismo]{predict}}, \code{\link{xfer_time}} #' \code{\link{xfer_userExtent}} diff --git a/R/xfer_userExtent.R b/R/xfer_userExtent.R index 22e271cbe..237e4cceb 100644 --- a/R/xfer_userExtent.R +++ b/R/xfer_userExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_userExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# #' @title xfer_userExtent: user provided extent of transfer #' @description This function generates an area of transfer according to a user #' provided polygon and buffer. @@ -31,8 +54,9 @@ #' @return This function returns a SpatialPolygons object with the user #' provided shape (+ a buffer is userBgBuf >0). #' @author Jamie Kass -#' @author Gonzalo E. Pinilla-Buitrago +#' @author Gonzalo E. Pinilla-Buitrago #' @author Andrea Paz +#' @author Bethany A. Johnson #' @seealso \code{\link{penvs_drawBgExtent}}, \code{\link{penvs_bgExtent}}, #' \code{\link{penvs_bgMask}} , \code{\link{penvs_bgSample}} #' @export @@ -60,7 +84,9 @@ xfer_userExtent <- function(bgShp_path, bgShp_name, userBgBuf, file.rename(bgShp_path, file.path(pathdir, bgShp_name)) } # read in shapefile and extract coords - bgExt <- rgdal::readOGR(file.path(pathdir, bgShp_name)[i]) + bgExt <- sf::st_read(file.path(pathdir, bgShp_name)[i]) + bgExt <- sf::as_Spatial(bgExt) + } else { logger %>% writeLog(type = 'error', @@ -69,15 +95,19 @@ xfer_userExtent <- function(bgShp_path, bgShp_name, userBgBuf, return() } - if (userBgBuf >= 0) { - bgExt <- rgeos::gBuffer(bgExt, width = userBgBuf) - bgExt <- methods::as(bgExt, "SpatialPolygonsDataFrame") - } if (userBgBuf > 0) { + bgExt <- sf::st_as_sf(bgExt) + bgExt <- sf::st_buffer(bgExt, dist = userBgBuf) + bgExt <- sf::as_Spatial(bgExt) logger %>% writeLog( hlSpp(spN), 'Transferring extent user-defined polygon buffered by ', userBgBuf, ' degrees.') + } else if (userBgBuf < 0) { + logger %>% + writeLog(type = 'error', + 'Change buffer distance to a positive value.') + return() } else { logger %>% writeLog( hlSpp(spN), diff --git a/README.md b/README.md index 2b7878ae6..41a7d230a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![R-CMD-check](https://github.com/wallaceEcoMod/wallace/workflows/R-CMD-check/badge.svg)](https://github.com/wallaceEcoMod/wallace/actions) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![CRAN version](http://www.r-pkg.org/badges/version/wallace)](https://CRAN.R-project.org/package=wallace) [![downloads](https://cranlogs.r-pkg.org:443/badges/grand-total/wallace?color=orange)](https://cranlogs.r-pkg.org:443/badges/grand-total/wallace?color=orange) -# Wallace (v.WxC) +# Wallace (v2024.02.23) *Wallace* is a modular platform for reproducible modeling of species niches and distributions, written in R. The application guides users through a complete analysis, from the acquisition of data to visualizing model predictions on an interactive map, thus bundling complex workflows into a single, streamlined interface. Install *Wallace* via CRAN and run the application with the following R code. @@ -26,7 +26,7 @@ run_wallace() Please make sure you have installed the latest versions of both R (Mac OS, Windows) and RStudio (Mac OS / Windows: choose the free version). #### How to run Maxent with maxent.jar -*Wallace* v.WxC includes two options to run Maxent models: maxnet and maxent.jar. The former, which is an R implementation and fits the model with the package `glmnet`, is now the default and does not require the package `rJava` (see Phillips et al. 2017). The latter, which is the Java implementation, runs the `maxent()` function in the package `dismo`. This function requires the user to place the `maxent.jar` file in the `/java` directory of the `dismo` package root folder. You can download Maxent here, and locate `maxent.jar`, which is the Maxent program itself, in the downloaded folder. You can find the directory path to `dismo/java` by running `system.file('java', package="dismo")` at the R console. Simply copy `maxent.jar` and paste it into this folder. If you try to run Maxent in *Wallace* without the file in place, you will get a warning message in the log window and Maxent will not run. +*Wallace* v.2024.02.23 includes two options to run Maxent models: maxnet and maxent.jar. The former, which is an R implementation and fits the model with the package `glmnet`, is now the default and does not require the package `rJava` (see Phillips et al. 2017). The latter, which is the Java implementation, runs the `maxent()` function in the package `dismo`. This function requires the user to place the `maxent.jar` file in the `/java` directory of the `dismo` package root folder. You can download Maxent here, and locate `maxent.jar`, which is the Maxent program itself, in the downloaded folder. You can find the directory path to `dismo/java` by running `system.file('java', package="dismo")` at the R console. Simply copy `maxent.jar` and paste it into this folder. If you try to run Maxent in *Wallace* without the file in place, you will get a warning message in the log window and Maxent will not run. ### Potential Issues diff --git a/inst/CITATION b/inst/CITATION index ecc7f3156..28ae1be63 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -26,7 +26,7 @@ bibentry( volume = "2023(3)", number = "e06547", pages = "1-9", - url = "https://onlinelibrary.wiley.com/doi/full/10.1111/ecog.06547", + url = "https://onlinelibrary.wiley.com/doi/10.1111/ecog.06547", textVersion = paste("Kass, J.M., Pinilla-Buitrago, G.E., Paz, A., Johnson, B.A., Grisales-Betancur, V., Meenan, S.I., Attali, D., Broennimann, O., Galante, P.J., Maitner, B.S., Owens, H., Varela, S., Aiello-Lammens, Merow, C., M.E., Blair, M.E. & Anderson, R.P. (2023). wallace 2: a shiny app for modeling species niches and distributions redesigned to facilitate expansion via module contributions. Ecography, e06547. ") ) diff --git a/inst/shiny/Rmd/gtext_envs.Rmd b/inst/shiny/Rmd/gtext_envs.Rmd index e871d8327..95721ee56 100644 --- a/inst/shiny/Rmd/gtext_envs.Rmd +++ b/inst/shiny/Rmd/gtext_envs.Rmd @@ -15,14 +15,14 @@ We envision that future releases will offer other terrestrial climate datasets ( **REFERENCES** -Franklin, J. (2010). Mapping Species Distributions: Spatial Inference and Prediction. Data for species distribution models: the environmental data. In: *Mapping species distributions: spatial inference and prediction*. Cambridge: Cambridge University Press. https://doi.org/10.1017/CBO9780511810602 +Franklin, J. (2010). Mapping Species Distributions: Spatial Inference and Prediction. Data for species distribution models: the environmental data. In: *Mapping species distributions: spatial inference and prediction*. Cambridge: Cambridge University Press. DOI: 10.1017/CBO9780511810602 -Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G., & Jarvis, A. (2005). Very high resolution interpolated climate surfaces for global land areas. *International Journal of Climatology*, 25(15), 1965-1978. https://doi.org/10.1002/joc.1276 +Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G., & Jarvis, A. (2005). Very high resolution interpolated climate surfaces for global land areas. *International Journal of Climatology*, 25(15), 1965-1978. DOI: 10.1002/joc.1276 -Karger, D.N., Conrad, O., Böhner, J., Kawohl, T., Kreft, H., Soria-Auza, R.W., Zimmermann, N.E, Linder, H.P., & Kessler, M. (2016). Climatologies at high resolution for the earth's land surface areas (Version 1.1). World Data Center for Climate. http://dx.doi.org/doi:10.1594/WDCC/CHELSA_v1_1 +Karger, D.N., Conrad, O., Böhner, J., Kawohl, T., Kreft, H., Soria-Auza, R.W., Zimmermann, N.E, Linder, H.P., & Kessler, M. (2016). Climatologies at high resolution for the earth's land surface areas (Version 1.1). World Data Center for Climate. DOI: 10.1594/WDCC/CHELSA_v1_1 -Kriticos, D.J., Webber, B.L., Leriche, A., Ota, N., Macadam, I., Bathols, J., & Scott, J.K. (2012). CliMond: global high-resolution historical and future scenario climate surfaces for bioclimatic modelling. *Methods in Ecology and Evolution*, 3(1), 53-64. https://doi.org/10.1111/j.2041-210X.2011.00134.x +Kriticos, D.J., Webber, B.L., Leriche, A., Ota, N., Macadam, I., Bathols, J., & Scott, J.K. (2012). CliMond: global high-resolution historical and future scenario climate surfaces for bioclimatic modelling. *Methods in Ecology and Evolution*, 3(1), 53-64. DOI: 10.1111/j.2041-210X.2011.00134.x -Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). Environmental Data. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. https://doi.org/10.23943/princeton/9780691136868.003.0006 +Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). Environmental Data. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. DOI: 10.23943/princeton/9780691136868.003.0006 -Sbrocco, E.J., Barber, P.H. (2013). MARSPEC: ocean climate layers for marine spatial ecology. *Ecology*, 94(4), 979-979. https://doi.org/10.1890/12-1358.1 +Sbrocco, E.J., Barber, P.H. (2013). MARSPEC: ocean climate layers for marine spatial ecology. *Ecology*, 94(4), 979-979. DOI: 10.1890/12-1358.1 diff --git a/inst/shiny/Rmd/gtext_espace.Rmd b/inst/shiny/Rmd/gtext_espace.Rmd index 6b63bc189..3d7f774ee 100644 --- a/inst/shiny/Rmd/gtext_espace.Rmd +++ b/inst/shiny/Rmd/gtext_espace.Rmd @@ -14,7 +14,7 @@ The **Characterize Environmental Space** component performs analyses and visuali **REFERENCES** -Grinnell, J. (1917). "The niche-relationships of the California Thrasher". *The Auk*, 34(4), 427–433. DOI:10.2307/4072271 +Grinnell, J. (1917). "The niche-relationships of the California Thrasher". *The Auk*, 34(4), 427–433. DOI:10.2307/4072271 Chase, J.M., & Leibold, M.A. (2003). *Ecological Niches: Linking Classical and Contemporary Approaches*. University of Chicago Press. diff --git a/inst/shiny/Rmd/gtext_model.Rmd b/inst/shiny/Rmd/gtext_model.Rmd index e7262ce80..d2f78f3c2 100644 --- a/inst/shiny/Rmd/gtext_model.Rmd +++ b/inst/shiny/Rmd/gtext_model.Rmd @@ -44,28 +44,28 @@ Evaluation statistics are shown in the ‘Results’ tab, for the full model, th **REFERENCES** -Boyce, M.S., Vernier, P.R., Nielsen, S.E., & Schmiegelow, F.K.A. (2002). Evaluating resource selection functions. *Ecological Modelling*, 157(2-3), 281–300. https://doi.org/10.1016/S0304-3800(02)00200-4 +Boyce, M.S., Vernier, P.R., Nielsen, S.E., & Schmiegelow, F.K.A. (2002). Evaluating resource selection functions. *Ecological Modelling*, 157(2-3), 281–300. DOI: 10.1016/S0304-3800(02)00200-4 -Burnham, K.P., & Anderson, D.R. (2002). Model selection and multimodel inference : a practical information-theoretic approach. Springer, New York. https://doi.org/10.1007/b97636 +Burnham, K.P., & Anderson, D.R. (2002). Model selection and multimodel inference : a practical information-theoretic approach. Springer, New York. DOI: 10.1007/b97636 -Elith, J., Graham, C.H., Anderson, R.P., Dudík, M., Ferrier, S., Guisan, A., Hijmans, R.J., Huettmann, F., Leathwick, J.R., Leahmann, A., Li, J., Lohmann, L.G., Loiselle, B.A., Manion, G., Moritz, C., Nakamura, M., Nakazawa, Y., Overton, J.M., Peterson, A.T., Phillips, S.J., Richardson, K.S., Scachetti-Pereira, R., Schapire, R.E., Soberón, J., Williams, S., Wisz, M.S., & Zimmermann, N.E. (2006). Novel methods improve prediction of species' distributions from occurrence data. *Ecography*, 29(2), 129-151. https://doi.org/10.1111/j.2006.0906-7590.04596.x +Elith, J., Graham, C.H., Anderson, R.P., Dudík, M., Ferrier, S., Guisan, A., Hijmans, R.J., Huettmann, F., Leathwick, J.R., Leahmann, A., Li, J., Lohmann, L.G., Loiselle, B.A., Manion, G., Moritz, C., Nakamura, M., Nakazawa, Y., Overton, J.M., Peterson, A.T., Phillips, S.J., Richardson, K.S., Scachetti-Pereira, R., Schapire, R.E., Soberón, J., Williams, S., Wisz, M.S., & Zimmermann, N.E. (2006). Novel methods improve prediction of species' distributions from occurrence data. *Ecography*, 29(2), 129-151. DOI: 10.1111/j.2006.0906-7590.04596.x -Franklin, J. (2010). *Mapping Species Distributions: Spatial Inference and Prediction*. Statistical models - modern regression; Machine learning methods; Classification, similarity and other methods for presence-only data. Cambridge: Cambridge University Press. https://doi.org/10.1017/CBO9780511810602 +Franklin, J. (2010). *Mapping Species Distributions: Spatial Inference and Prediction*. Statistical models - modern regression; Machine learning methods; Classification, similarity and other methods for presence-only data. Cambridge: Cambridge University Press. DOI: 10.1017/CBO9780511810602 -Guisan, A., & Thuiller, W. (2005). Predicting species distribution: offering more than simple habitat models. *Ecology Letters*, 8, 993-1009. https://doi.org/10.1111/j.1461-0248.2005.00792.x +Guisan, A., & Thuiller, W. (2005). Predicting species distribution: offering more than simple habitat models. *Ecology Letters*, 8, 993-1009. DOI: 10.1111/j.1461-0248.2005.00792.x Hastie, T., Tibshirani, R., & Friedman, J.H. (2009). *The elements of Statistical Learning: Data Mining, Inference, and prediction*. Springer. The Elements of Statistical Learning -Hirzel, A.H., Lay, G.L., Helfer, H., Randin, C., & Guisan, A. (2006) Evaluating the ability of habitat suitability models to predict species presences. *Ecological Modelling*, 199(2), 142–152. https://doi.org/10.1016/j.ecolmodel.2006.05.017 +Hirzel, A.H., Lay, G.L., Helfer, H., Randin, C., & Guisan, A. (2006) Evaluating the ability of habitat suitability models to predict species presences. *Ecological Modelling*, 199(2), 142–152. DOI: 10.1016/j.ecolmodel.2006.05.017 -Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602-1608. https://doi.org/10.1111/2041-210X.13628 +Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602-1608. DOI: 10.1111/2041-210X.13628 -Lobo, J.M., Jiménez-Valverde, A., & Real, R. (2008). AUC: a misleading measure of the performance of predictive distribution models. *Global Ecology and Biogeography*, 17(2), 145-151. https://doi.org/10.1111/j.1466-8238.2007.00358.x +Lobo, J.M., Jiménez-Valverde, A., & Real, R. (2008). AUC: a misleading measure of the performance of predictive distribution models. *Global Ecology and Biogeography*, 17(2), 145-151. DOI: 10.1111/j.1466-8238.2007.00358.x -Peterson, A.T., Papeş, M., & Soberón, J. (2008). Rethinking receiver operating characteristic analysis applications in ecological niche modeling. *Ecological Modelling*, 213(1), 63-72. https://doi.org/10.1016/j.ecolmodel.2007.11.008 +Peterson, A.T., Papeş, M., & Soberón, J. (2008). Rethinking receiver operating characteristic analysis applications in ecological niche modeling. *Ecological Modelling*, 213(1), 63-72. DOI: 10.1016/j.ecolmodel.2007.11.008 -Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). Evaluating Model Performance and Significance. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. https://doi.org/10.23943/princeton/9780691136868.003.0005 +Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). Evaluating Model Performance and Significance. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. DOI: 10.23943/princeton/9780691136868.003.0005 -Roberts, D.R., Bahn, V., Ciuti, S., Boyce, M.S., Elith, J., Guillera-Arroita, G., Hauenstein, S., Lahoz-Monfort, J.J., Schröder, B., Thuiller, W., Warton, D.I., Wintle, B.A., Hartig, F., & Dormann, C.F. (2017). Cross-validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure. *Ecography*, 40(8), 913-929. https://doi.org/10.1111/ecog.02881 +Roberts, D.R., Bahn, V., Ciuti, S., Boyce, M.S., Elith, J., Guillera-Arroita, G., Hauenstein, S., Lahoz-Monfort, J.J., Schröder, B., Thuiller, W., Warton, D.I., Wintle, B.A., Hartig, F., & Dormann, C.F. (2017). Cross-validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure. *Ecography*, 40(8), 913-929. DOI: 10.1111/ecog.02881 -Warren, D.L., & Seifert, S.N. (2011). Ecological niche modeling in Maxent: the importance of model complexity and the performance of model selection criteria. *Ecological Applications*, 21(2), 335-342. https://doi.org/10.1890/10-1171.1 +Warren, D.L., & Seifert, S.N. (2011). Ecological niche modeling in Maxent: the importance of model complexity and the performance of model selection criteria. *Ecological Applications*, 21(2), 335-342. DOI: 10.1890/10-1171.1 diff --git a/inst/shiny/Rmd/gtext_occs.Rmd b/inst/shiny/Rmd/gtext_occs.Rmd index c247d1ba3..4d2eff15e 100644 --- a/inst/shiny/Rmd/gtext_occs.Rmd +++ b/inst/shiny/Rmd/gtext_occs.Rmd @@ -11,11 +11,12 @@ Niche/distributional modeling analyses require georeferenced occurrence records or 3) upload their own dataset (Module: *User-specified Occurrences*). Unlike previous versions of *Wallace*, multiple species now can be uploaded in the same session. +*Note: As of 01 September 2023, Module: Query Database [Paleo] will be temporarily unavailable.* **REFERENCES** -Anderson, R.P. (2012). Harnessing the world's biodiversity data: promise and peril in ecological niche modeling of species distributions. *Annals of the New York Academy of Sciences*, 1260(1), 66-80. https://doi.org/10.1111/j.1749-6632.2011.06440.x +Anderson, R.P. (2012). Harnessing the world's biodiversity data: promise and peril in ecological niche modeling of species distributions. *Annals of the New York Academy of Sciences*, 1260(1), 66-80. DOI: 10.1111/j.1749-6632.2011.06440.x -Franklin, J. (2010). Data for species distribution models: the biological data. In: *Mapping Species Distributions: Spatial Inference and Prediction*. Cambridge: Cambridge University Press. https://doi.org/10.1017/CBO9780511810602.007 +Franklin, J. (2010). Data for species distribution models: The biological data. In: *Mapping Species Distributions: Spatial Inference and Prediction* (Ecology, Biodiversity and Conservation, pp. 55-75). Cambridge: Cambridge University Press. DOI: 10.1017/CBO9780511810602.007 -Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). Species' Occurrence Data. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: Monographs in Population Biology, 49. Princeton University Press. https://doi.org/10.23943/princeton/9780691136868.003.0005 +Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). Species' Occurrence Data. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: Monographs in Population Biology, 49. Princeton University Press. DOI: 10.23943/princeton/9780691136868.003.0005 diff --git a/inst/shiny/Rmd/gtext_part.Rmd b/inst/shiny/Rmd/gtext_part.Rmd index a6b9e2af1..3e9376dbc 100644 --- a/inst/shiny/Rmd/gtext_part.Rmd +++ b/inst/shiny/Rmd/gtext_part.Rmd @@ -13,6 +13,6 @@ There are myriad particular ways to partition data for niche/distributional mode **REFERENCES** -Guisan A., & Zimmermann N.E. (2000). Predictive habitat distribution models in ecology. *Ecological Modelling*, 135(2-3), 147-186. https://doi.org/10.1016/S0304-3800(00)00354-9 +Guisan A., & Zimmermann N.E. (2000). Predictive habitat distribution models in ecology. *Ecological Modelling*, 135(2-3), 147-186. DOI: 10.1016/S0304-3800(00)00354-9 -Peterson, A.T., Soberón J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura M., & Araújo, M.B. (2011). Evaluating Model Performance and Significance. In: *Ecological Niches and Geographic Distributions*, Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. https://doi.org/10.23943/princeton/9780691136868.003.0009 +Peterson, A.T., Soberón J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura M., & Araújo, M.B. (2011). Evaluating Model Performance and Significance. In: *Ecological Niches and Geographic Distributions*, Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. DOI: 10.23943/princeton/9780691136868.003.0009 diff --git a/inst/shiny/Rmd/gtext_penvs.Rmd b/inst/shiny/Rmd/gtext_penvs.Rmd index 7a6fad8dd..c3494cc1e 100644 --- a/inst/shiny/Rmd/gtext_penvs.Rmd +++ b/inst/shiny/Rmd/gtext_penvs.Rmd @@ -19,28 +19,28 @@ After choosing a way to delimit the study region (**Step 1**), Wallace samples b **REFERENCES** -Acevedo, P., Jiménez‐Valverde, A., Lobo, J.M., & Real, R. (2012). Delimiting the geographical background in species distribution modelling. *Journal of Biogeography*, 39(8), 1383-1390. https://doi.org/10.1111/j.1365-2699.2012.02713.x +Acevedo, P., Jiménez‐Valverde, A., Lobo, J.M., & Real, R. (2012). Delimiting the geographical background in species distribution modelling. *Journal of Biogeography*, 39(8), 1383-1390. DOI: 10.1111/j.1365-2699.2012.02713.x Anderson, R.P. (2015). El modelado de nichos y distribuciones: no es simplemente "clic, clic, clic." [With English and French translations: Modeling niches and distributions: it's not just "click, click, click" and La modélisation de niche et de distributions: ce n'est pas juste "clic, clic, clic"]. *Biogeografía*, 8, 4-27. pdf -Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. *Annals of the New York Academy of Sciences*, 1297(1), 8-28. https://doi.org/10.1111/nyas.12264 +Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. *Annals of the New York Academy of Sciences*, 1297(1), 8-28. DOI: 10.1111/nyas.12264 -Anderson, R.P., & Raza A. (2010). The effect of the extent of the study region on GIS models of species geographic distributions and estimates of niche evolution: preliminary tests with montane rodents (genus *Nephelomys*) in Venezuela. *Journal of Biogeography*, 37(7), 1378-1393. https://doi.org/10.1111/j.1365-2699.2010.02290.x +Anderson, R.P., & Raza A. (2010). The effect of the extent of the study region on GIS models of species geographic distributions and estimates of niche evolution: preliminary tests with montane rodents (genus *Nephelomys*) in Venezuela. *Journal of Biogeography*, 37(7), 1378-1393. DOI: 10.1111/j.1365-2699.2010.02290.x -Barve, N., Barve, V., Jiménez-Valverde, A., Lira-Noriega, A., Maher, S.P., Peterson A.T., Soberón J., & Villalobos F. (2011). The crucial role of the accessible area in ecological niche modeling and species distribution modeling. *Ecological Modelling*, 222(11), 1810-1819. https://doi.org/10.1016/j.ecolmodel.2011.02.011 +Barve, N., Barve, V., Jiménez-Valverde, A., Lira-Noriega, A., Maher, S.P., Peterson A.T., Soberón J., & Villalobos F. (2011). The crucial role of the accessible area in ecological niche modeling and species distribution modeling. *Ecological Modelling*, 222(11), 1810-1819. DOI: 10.1016/j.ecolmodel.2011.02.011 -Franklin, J. (2010). Mapping Species Distributions: Spatial Inference and Prediction. Data for species distribution models: the biological data. In: *Mapping species distributions: spatial inference and prediction*. Cambridge: Cambridge University Press. +Franklin, J. (2010). Mapping Species Distributions: Spatial Inference and Prediction. Data for species distribution models: the biological data. In: *Mapping species distributions: spatial inference and prediction*. Cambridge: Cambridge University Press. DOI: 10.1017/CBO9780511810602 -Gerstner, B.E., Kass, J.M., Kays, R., Helgen, K.M., & Anderson, R.P. (2018). Revised distributional estimates for the recently discovered olinguito (*Bassaricyon neblina*), with comments on natural and taxonomic history. *Journal of Mammalogy*, 99(2), 321-332. https://doi.org/10.1093/jmammal/gyy012 +Gerstner, B.E., Kass, J.M., Kays, R., Helgen, K.M., & Anderson, R.P. (2018). Revised distributional estimates for the recently discovered olinguito (*Bassaricyon neblina*), with comments on natural and taxonomic history. *Journal of Mammalogy*, 99(2), 321-332. DOI: 10.1093/jmammal/gyy012 -Guevara, L., Gerstner, B.E., Kass, J.M., & Anderson, R.P. (2018). Toward ecologically realistic predictions of species distributions: A cross-time example from tropical montane cloud forests. *Global Change Biology*, 24(4), 1511-1522. https://doi.org/10.1111/gcb.13992 +Guevara, L., Gerstner, B.E., Kass, J.M., & Anderson, R.P. (2018). Toward ecologically realistic predictions of species distributions: A cross-time example from tropical montane cloud forests. *Global Change Biology*, 24(4), 1511-1522. DOI: 10.1111/gcb.13992 -Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: what it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. https://doi.org/10.1111/j.1600-0587.2013.07872.x +Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: what it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. DOI: 10.1111/j.1600-0587.2013.07872.x -Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura M., & Araújo M.B. (2011). Modeling Ecological Niches. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. https://doi.org/10.23943/princeton/9780691136868.003.0005 +Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura M., & Araújo M.B. (2011). Modeling Ecological Niches. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. DOI: 10.23943/princeton/9780691136868.003.0005 -Saupe, E.E., Barve, V., Myers, C.E., Soberón, J., Barve, N., Hensz, C.M., Peterson, A.T., Owens, H.L., & Lira-Noriega, A. (2012). Variation in niche and distribution model performance: the need for a priori assessment of key causal factors. *Ecological Modelling*, 237-238, 11-22. https://doi.org/10.1016/j.ecolmodel.2012.04.001 +Saupe, E.E., Barve, V., Myers, C.E., Soberón, J., Barve, N., Hensz, C.M., Peterson, A.T., Owens, H.L., & Lira-Noriega, A. (2012). Variation in niche and distribution model performance: the need for a priori assessment of key causal factors. *Ecological Modelling*, 237-238, 11-22. DOI: 10.1016/j.ecolmodel.2012.04.001 -Williams, J.W., & Jackson, S.T. (2007). Novel climates, no-analog communities, and ecological surprises. *Frontiers in Ecology and the Environment*, 5(9), 475-482. https://doi.org/10.1890/070037 +Williams, J.W., & Jackson, S.T. (2007). Novel climates, no-analog communities, and ecological surprises. *Frontiers in Ecology and the Environment*, 5(9), 475-482. DOI: 10.1890/070037 -VanDerWal, J., Shoo, L.P., Graham, C., & Williams, S.E. (2009). Selecting pseudo-absence data for presence-only distribution modeling: How far should you stray from what you know?. *Ecological Modelling*, 220(4), 589-594. https://doi.org/10.1016/j.ecolmodel.2008.11.010 +VanDerWal, J., Shoo, L.P., Graham, C., & Williams, S.E. (2009). Selecting pseudo-absence data for presence-only distribution modeling: How far should you stray from what you know?. *Ecological Modelling*, 220(4), 589-594. DOI: 10.1016/j.ecolmodel.2008.11.010 diff --git a/inst/shiny/Rmd/gtext_poccs.Rmd b/inst/shiny/Rmd/gtext_poccs.Rmd index a7ea2ef01..cb02683b6 100644 --- a/inst/shiny/Rmd/gtext_poccs.Rmd +++ b/inst/shiny/Rmd/gtext_poccs.Rmd @@ -11,4 +11,4 @@ Biodiversity data (especially from aggregated online databases) typically suffer **REFERENCES** -Costello, M. J., Michener, W. K., Gahegan, M., Zhang, Z. Q., & Bourne, P. E. (2013). Biodiversity data should be published, cited, and peer reviewed. *Trends in Ecology & Evolution*, 28(8), 454-461. https://doi.org/10.1016/j.tree.2013.05.002 +Costello, M. J., Michener, W. K., Gahegan, M., Zhang, Z. Q., & Bourne, P. E. (2013). Biodiversity data should be published, cited, and peer reviewed. *Trends in Ecology & Evolution*, 28(8), 454-461. DOI: 10.1016/j.tree.2013.05.002 diff --git a/inst/shiny/Rmd/gtext_rep.Rmd b/inst/shiny/Rmd/gtext_rep.Rmd index aeb5815e7..235cc69f4 100644 --- a/inst/shiny/Rmd/gtext_rep.Rmd +++ b/inst/shiny/Rmd/gtext_rep.Rmd @@ -11,19 +11,19 @@ Over the decade of the 2010s, scientific practice increasingly emphasized docume **REFERENCES** -Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. https://doi.org/10.1126/sciadv.aat4858 +Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. DOI: 10.1126/sciadv.aat4858 -Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. https://doi.org/10.1038/s41559-019-0972-5 +Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. DOI: 10.1038/s41559-019-0972-5 -Fitzpatrick, F.C., Lachmuth, S., & Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070. https://doi.org/10.1111/ecog.05700 +Fitzpatrick, F.C., Lachmuth, S., & Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070. DOI: 10.1111/ecog.05700 -Kass, J. M, Muscarella, R., Galante, P. J, Bohl, C. L., Pinilla-Buitrago, G. E., Boria, R. A., Soley-Guardia, M., Anderson, R. P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. https://doi.org/10.1111/2041-210X.13628 +Kass, J. M, Muscarella, R., Galante, P. J, Bohl, C. L., Pinilla-Buitrago, G. E., Boria, R. A., Soley-Guardia, M., Anderson, R. P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. DOI: 10.1111/2041-210X.13628 -Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., & Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. https://doi.org/10.1111/geb.12993 +Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., & Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. DOI: 10.1111/geb.12993 -Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. https://doi.org/10.1111/ecog.05618 +Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. DOI: 10.1111/ecog.05618 Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. -https://doi.org/10.1093/biosci/biz045 +DOI: 10.1093/biosci/biz045 -Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. https://doi.org/10.1111/ecog.04960 +Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. DOI: 10.1111/ecog.04960 diff --git a/inst/shiny/Rmd/gtext_vis.Rmd b/inst/shiny/Rmd/gtext_vis.Rmd index c913e7615..99ce71840 100644 --- a/inst/shiny/Rmd/gtext_vis.Rmd +++ b/inst/shiny/Rmd/gtext_vis.Rmd @@ -12,6 +12,6 @@ Niche/distributional models can be used to make transfers across geographic spac **REFERENCES** -Elith, J., & Graham, C.H. (2009). Do they? How do they? WHY do they differ? On finding reasons for differing performances of species distribution models. *Ecography*, 32, 66-77. https://doi.org/10.1111/j.1600-0587.2008.05505.x +Elith, J., & Graham, C.H. (2009). Do they? How do they? WHY do they differ? On finding reasons for differing performances of species distribution models. *Ecography*, 32, 66-77. DOI: 10.1111/j.1600-0587.2008.05505.x -Guisan, A., & Zimmermann, N.E. (2000). Predictive habitat distribution models in ecology. *Ecological Modelling*, 135(2-3), 147-186. https://doi.org/10.1016/S0304-3800(00)00354-9 +Guisan, A., & Zimmermann, N.E. (2000). Predictive habitat distribution models in ecology. *Ecological Modelling*, 135(2-3), 147-186. DOI: 10.1016/S0304-3800(00)00354-9 diff --git a/inst/shiny/Rmd/gtext_xfer.Rmd b/inst/shiny/Rmd/gtext_xfer.Rmd index 5dcd839f0..f85d0a656 100644 --- a/inst/shiny/Rmd/gtext_xfer.Rmd +++ b/inst/shiny/Rmd/gtext_xfer.Rmd @@ -13,6 +13,6 @@ Furthermore, at present *Wallace* provides some information characterizing the d **REFERENCES** -Fitzpatrick, M.C., & Hargrove, W.W. (2009). The projection of species distribution models and the problem of non-analog climate. *Biodiversity and Conservation*, 18, 2255. https://doi.org/10.1007/s10531-009-9584-8 +Fitzpatrick, M.C., & Hargrove, W.W. (2009). The projection of species distribution models and the problem of non-analog climate. *Biodiversity and Conservation*, 18, 2255. DOI: 10.1007/s10531-009-9584-8 -Williams, J.W., & Jackson, S.T. (2007). Novel climates, no-analog communities, and ecological surprises. *Frontiers in Ecology and the Environment*, 5(9), 475-482. https://doi.org/10.1890/070037 +Williams, J.W., & Jackson, S.T. (2007). Novel climates, no-analog communities, and ecological surprises. *Frontiers in Ecology and the Environment*, 5(9), 475-482. DOI: 10.1890/070037 diff --git a/inst/shiny/Rmd/text_about.Rmd b/inst/shiny/Rmd/text_about.Rmd index ee0da13d9..686618f05 100644 --- a/inst/shiny/Rmd/text_about.Rmd +++ b/inst/shiny/Rmd/text_about.Rmd @@ -6,7 +6,7 @@ output: html_document ### **What is *Wallace*?** logo -Welcome to *Wallace*, a flexible application for reproducible ecological modeling, built for community expansion. The current version of *Wallace* (v.WxC) steps the user through a full niche/distribution modeling analysis, from data acquisition to visualizing results. +Welcome to *Wallace*, a flexible application for reproducible ecological modeling, built for community expansion. The current version of *Wallace* (v2024.02.23) steps the user through a full niche/distribution modeling analysis, from data acquisition to visualizing results. The application is written in `R` with the web app development package `shiny`. Please find the stable version of *Wallace* on CRAN, and the development version on Github. We also maintain a *Wallace* website that has some basic info, links, and will be updated with tutorial materials in the near future. @@ -14,9 +14,9 @@ The application is written in `R` with the web app development package `shiny`. Also, for more detail, please see our initial publication in *Methods in Ecology and Evolution* and our follow-up in *Ecography*. -Kass J. M., Vilela B., Aiello-Lammens M. E., Muscarella R., Merow C., Anderson R. P. (2018). *Wallace*: A flexible platform for reproducible modeling of species niches and distributions built for community expansion. *Methods Ecol Evol*. 9: 1151-1156. DOI: 10.1111/2041-210X.12945 +Kass J. M., Vilela B., Aiello-Lammens M. E., Muscarella R., Merow C., Anderson R. P. (2018). *Wallace*: A flexible platform for reproducible modeling of species niches and distributions built for community expansion. *Methods in Ecology and Evolultion*, 9(4): 1151-1156. DOI: 10.1111/2041-210X.12945 -Kass, J.M., Pinilla-Buitrago, G.E, Paz, A., Johnson, B.A., Grisales-Betancur, V., Meenan, S.I., Attali, D., Broennimann, O., Galante, P.J., Maitner, B.S., Owens, H.L., Varela, S., Aiello-Lammens, M.E., Merow, C., Blair, M.E., Anderson R.P. (2022). *wallace* 2: a shiny app for modeling species niches and distributions redesigned to facilitate expansion via module contributions. *Ecography*, in prep. DOI: 10.1111/ecog.06547. +Kass, J.M., Pinilla-Buitrago, G.E, Paz, A., Johnson, B.A., Grisales-Betancur, V., Meenan, S.I., Attali, D., Broennimann, O., Galante, P.J., Maitner, B.S., Owens, H.L., Varela, S., Aiello-Lammens, M.E., Merow, C., Blair, M.E., Anderson R.P. (2022). *wallace* 2: a shiny app for modeling species niches and distributions redesigned to facilitate expansion via module contributions. *Ecography*, 2023(3): e06547. DOI: 10.1111/ecog.06547. ### **Who is *Wallace* for?** @@ -46,15 +46,17 @@ For more information and relevant links see our ENM 2020.* -Kass, J.M. and G.E. Pinilla-Buitrago. 18 May 2020. “Wallace Ecological Modeling Application: flexible and reproducible modeling of species’ niches and distributions built for community expansion.” ENM 2020: Online course in ecological niche modeling (Peterson, A. T. editor), Week 19, Talk 2. Watch on YouTube. +Kass, J.M. and G.E. Pinilla-Buitrago. 18 May 2020. “Wallace Ecological Modeling Application: flexible and reproducible modeling of species’ niches and distributions built for community expansion.” ENM 2020: Online course in ecological niche modeling (Peterson, A. T. editor), Week 19, Talk 2. *The following webinar was the "37th Global Online Biodiversity Informatics Seminar" in the Biodiversity Informatics Training Curriculum organized by Town Peterson.* -Kass, J. M. 9 May 2018. "WALLACE: A flexible platform for reproducible modeling of species niches and distributions built for community expansion." Broadcast from the City College of New York, City University of New York. Watch on YouTube. +Kass, J. M. 9 May 2018. "WALLACE: A flexible platform for reproducible modeling of species niches and distributions built for community expansion." Broadcast from the City College of New York, City University of New York. Global Online Seminar #37 - Wallace. -*The following webinar was part of the "Modelado de Distribuciones Potenciales" series, organized by Angela Cuervo.* +*Para seminarios en español, los siguientes seminarios fueron organizados por Angela Cuervo como parte de la serie Modelado de Distribuciones Potenciales y Analisis Espaciales.* -Anderson, R. P. 21 May 2018. "El software Wallace para modelar nichos y distribuciones: Un coche con motor R, volante de ratón y cerebro de humano." Broadcast from the City College of New York, City University of New York. Watch on YouTube. +Paz, A. 3 October 2023. "Wallace EcoMod: Nuevas funcionalidades para aplicaciones en conservación". Seminarios 2023 - Wallace EcoMod + +Anderson, R. P. 21 May 2018. "El software Wallace para modelar nichos y distribuciones: Un coche con motor R, volante de ratón y cerebro de humano." Broadcast from the City College of New York, City University of New York. Analisis espaciales: 2017 - El software Wallace. *For more videos, check out the Wallace EcoMod YouTube channel.* @@ -72,7 +74,7 @@ Please email us wit If you use Wallace in your research, please cite: -Kass, J.M., Pinilla-Buitrago, G.E, Paz, A., Johnson, B.A., Grisales-Betancur, V., Meenan, S.I., Attali, D., Broennimann, O., Galante, P.J., Maitner, B.S., Owens, H.L., Varela, S., Aiello-Lammens, M.E., Merow, C., Blair, M.E., Anderson R.P. (2022). *wallace* 2: a shiny app for modeling species niches and distributions redesigned to facilitate expansion via module contributions. *Ecography*, e06547. DOI: 10.1111/ecog.06547. +Kass, J.M., Pinilla-Buitrago, G.E, Paz, A., Johnson, B.A., Grisales-Betancur, V., Meenan, S.I., Attali, D., Broennimann, O., Galante, P.J., Maitner, B.S., Owens, H.L., Varela, S., Aiello-Lammens, M.E., Merow, C., Blair, M.E., Anderson R.P. (2022). *wallace* 2: a shiny app for modeling species niches and distributions redesigned to facilitate expansion via module contributions. *Ecography*, 2023(3): e06547. DOI: 10.1111/ecog.06547 *** @@ -92,22 +94,22 @@ Mahmoud Shahin designed the WallaceEcoMod logo with inspiration from “Wallace #### **References** -1. Anderson, R. P. (2012). Harnessing the world's biodiversity data: promise and peril in ecological niche modeling of species distributions. *Annals of the New York Academy of Sciences*. 1260: 66-80. +1. Anderson, R. P. (2012). Harnessing the world's biodiversity data: promise and peril in ecological niche modeling of species distributions. *Annals of the New York Academy of Sciences*, 1260: 66-80. -2. Anderson, R. P. (2015). El modelado de nichos y distribuciones: no es simplemente "clic, clic, clic." [With English and French translations: Modeling niches and distributions: it's not just "click, click, click" and La modélisation de niche et de distributions: ce n'est pas juste "clic, clic, clic"]. *Biogeografía*. 8: 4-27. +2. Anderson, R. P. (2015). El modelado de nichos y distribuciones: no es simplemente "clic, clic, clic." [With English and French translations: Modeling niches and distributions: it's not just "click, click, click" and La modélisation de niche et de distributions: ce n'est pas juste "clic, clic, clic"]. *Biogeografía*, 8: 4-27. -3. Elith J. & Leathwick J.R. (2009). Species distribution models: ecological explanation and prediction across space and time. *Annual Review of Ecology, Evolution, and Systematics*. 40: 677-697. +3. Elith J. & Leathwick J.R. (2009). Species distribution models: ecological explanation and prediction across space and time. *Annual Review of Ecology, Evolution, and Systematics*, 40: 677-697. -4. Ficetola G.F., Thuiller W. & Miaud C. (2007) Prediction and validation of the potential global distribution of a problematic alien invasive species ― the American bullfrog. *Diversity and Distributions*. 13: 476-485. +4. Ficetola G.F., Thuiller W. & Miaud C. (2007) Prediction and validation of the potential global distribution of a problematic alien invasive species ― the American bullfrog. *Diversity and Distributions*, 13: 476-485. 5. Franklin J. (2010a). Mapping species distributions: spatial inference and prediction. Cambridge: Cambridge University Press. -6. Franklin J. (2010b) Moving beyond static species distribution models in support of conservation biogeography. *Diversity and Distributions*. 16: 321-330. +6. Franklin J. (2010b) Moving beyond static species distribution models in support of conservation biogeography. *Diversity and Distributions*, 16: 321-330. -7. González, C., Wang, O., Strutz, S. E., González-Salazar, C., Sánchez-Cordero, V., & Sarkar, S. 2010. Climate change and risk of leishmaniasis in North America: predictions from ecological niche models of vector and reservoir species. *PLoS Neglected Tropical Diseases*. 4: e585. +7. González, C., Wang, O., Strutz, S. E., González-Salazar, C., Sánchez-Cordero, V., & Sarkar, S. 2010. Climate change and risk of leishmaniasis in North America: predictions from ecological niche models of vector and reservoir species. *PLoS Neglected Tropical Diseases*, 4: e585. -8. Guisan A. & Thuiller W. (2005). Predicting species distribution: offering more than simple habitat models. *Ecology Letters*. 8: 993-1009. +8. Guisan A. & Thuiller W. (2005). Predicting species distribution: offering more than simple habitat models. *Ecology Letters*, 8: 993-1009. -9. Kearney M.R., Wintle B.A. & Porter W.P. (2010) Correlative and mechanistic models of species distribution provide congruent forecasts under climate change. *Conservation Letters*. 3: 203-213. +9. Kearney M.R., Wintle B.A. & Porter W.P. (2010) Correlative and mechanistic models of species distribution provide congruent forecasts under climate change. *Conservation Letters*, 3: 203-213. 10. Peterson A.T., Soberón J., Pearson R.G., Anderson R.P., Martinez-Meyer E., Nakamura M., Araújo M.B. (2011). Ecological niches and geographic distributions. Princeton, New Jersey: Monographs in Population Biology, 49. Princeton University Press. diff --git a/inst/shiny/Rmd/text_intro_tab.Rmd b/inst/shiny/Rmd/text_intro_tab.Rmd index 474a70ba9..3e89dc2eb 100644 --- a/inst/shiny/Rmd/text_intro_tab.Rmd +++ b/inst/shiny/Rmd/text_intro_tab.Rmd @@ -5,13 +5,12 @@ output: html_document #### WORKFLOW -*Wallace* (v.WxC) currently includes ten components, or steps of a possible workflow. Each component includes two or more modules, which are possible analyses for that step. +*Wallace* (v2024.02.23) currently includes ten components, or steps of a possible workflow. Each component includes two or more modules, which are possible analyses for that step. **Components:** **1.** *Obtain Occurrence Data* - Query Present Database -- Query Paleo Database - User-specified Occurrences **2.** *Obtain Environmental Data* diff --git a/inst/shiny/Rmd/text_team.Rmd b/inst/shiny/Rmd/text_team.Rmd index edc598315..dfdd4b16b 100644 --- a/inst/shiny/Rmd/text_team.Rmd +++ b/inst/shiny/Rmd/text_team.Rmd @@ -15,17 +15,25 @@ output: html_document gonzalo -Gonzalo E. Pinilla-Buitrago (co-lead developer) is a PhD candidate at the CUNY Graduate Center and City College of New York. +Gonzalo E. Pinilla-Buitrago (co-lead developer) received his PhD from the CUNY Graduate Center and City College of New York. He is currently a Postdoctoral Researcher at University of Connecticut.
andrea -Andrea Paz (developer) received her PhD at CUNY Graduate Center and City College of New York and is now a Postdoctoral Researcher at the Crowther Lab in ETH Zürich. +Andrea Paz (developer) received her PhD at CUNY Graduate Center and City College of New York, after which she was a Postdoctoral Researcher at the Crowther Lab in ETH Zürich. She is now an Assistant Professor at the Biological Sciences Department, University of Montréal.
bethany -Bethany A. Johnson (developer) is a Master's student at the City College of New York. +Bethany A. Johnson (developer) received her MS in Biology from the City College of New York and is currently a Visiting Scientist at the Center for Biodiversity & Conservation at the American Museum of Natural History. +
+ +beth + +Beth E. Gerstner (developer, Wallace Fellow) received her PhD from Michigan State University, is a NASA FINESST Award winner, and a Wallace fellow. She currently works for Map of Life at the Center for Biodiversity and Global Change at Yale University. +
+ +Daniel López Lozano (developer) is a Biodiversity Informatics Specialist at the American Museum of Natural History's Center for Biodiversity & Conservation.
valentina @@ -57,7 +65,7 @@ output: html_document mary -Mary E. Blair (co-manager) is the Director of Biodiversity Informatics Research at the Center for Biodiversity and Conservation at the American Museum of Natural History. +Mary E. Blair (co-manager) is the Director of Biodiversity Informatics Research at the Center for Biodiversity & Conservation at the American Museum of Natural History.
## Contributors @@ -74,7 +82,7 @@ Sarah Meenan (contributor) completed her undergraduate degree from the City Coll peteG -Peter J. Galante (contributor) was a Biodiversity Informatics Scientist at the Center for Biodiversity and Conservation at the American Museum of Natural History and now works as a Project Manager for Storke, LLC, a renewable energy company. +Peter J. Galante (contributor) was formerly a Biodiversity Informatics Scientist at the Center for Biodiversity & Conservation at the American Museum of Natural History and now works as a Project Manager for Storke, LLC, a renewable energy company.
brianM diff --git a/inst/shiny/Rmd/userReport_intro.Rmd b/inst/shiny/Rmd/userReport_intro.Rmd index 1126ce94d..fb476f2a2 100644 --- a/inst/shiny/Rmd/userReport_intro.Rmd +++ b/inst/shiny/Rmd/userReport_intro.Rmd @@ -10,7 +10,7 @@ knit_engines$set(asis = function(options) { knitr::opts_chunk$set(message = FALSE, warning = FALSE, eval = FALSE) ``` -Please find below the R code history from your *Wallace* v.WxC session. +Please find below the R code history from your *Wallace* v2024.02.23 session. You can reproduce your session results by running this R Markdown file in RStudio. @@ -25,7 +25,7 @@ Wallace uses the following R packages that must be installed and loaded before s library(spocc) library(spThin) library(dismo) -library(rgeos) +library(sf) library(ENMeval) library(wallace) ``` diff --git a/inst/shiny/custom_modules/rep_biomodelos.R b/inst/shiny/custom_modules/rep_biomodelos.R index 519ef9d27..85092681f 100644 --- a/inst/shiny/custom_modules/rep_biomodelos.R +++ b/inst/shiny/custom_modules/rep_biomodelos.R @@ -21,6 +21,7 @@ rep_biomodelos_module_server <- function(input, output, session, common) { spp <- common$spp bioSp <- common$bioSp + curSp <- common$curSp output$bioSpUI <- renderUI({ # check that a species is in the list already -- if not, don't proceed @@ -36,15 +37,23 @@ rep_biomodelos_module_server <- function(input, output, session, common) { }) observeEvent(input$pushBiomod, { + if (is.null(spp[[curSp()]]$visualization$mapPred)) { + #add warning + shinyalert::shinyalert( + "You need a map prediction built on Wallace in order to push payload to BioModelos. ", + type = "error") + return() + } else { + if (spp[[bioSp()]]$rmm$data$occurrence$sources != "Biomodelos") { shinyalert::shinyalert( - "You must submit a model built with occurrences from BioModelos (**)", + "You must submit a model built with occurrences from BioModelos. ", type = "error") return() } if (is.null(spp[[bioSp()]]$biomodelos$prediction)) { shinyalert::shinyalert( - "You need a map prediction build on Wallace before pushing to BioModelos (**).", + "You need a map prediction built on Wallace before pushing to BioModelos. ", type = "error") return() } @@ -109,11 +118,11 @@ rep_biomodelos_module_server <- function(input, output, session, common) { c(args = lapply(seq_along(spp[[bioSp()]]$mask$expertPoly), function(i){spp[[bioSp()]]$mask$expertPoly[i][[1]]}), makeUniqueIDs = TRUE)) - rgdal::writeOGR(obj = expertPolys, + sf::st_write(obj = sf::st_as_sf(expertPolys), dsn = tmpdir, layer = paste0(bioSp(), '_expertPolygonsShp'), driver = "ESRI Shapefile", - overwrite_layer = TRUE) + append = FALSE) extsExpPoly <- c('dbf', 'shp', 'shx') fsExpPoly <- file.path(tmpdir, paste0(bioSp(), '_expertPolygonsShp.', extsExpPoly)) zip::zipr(zipfile = tmpExpPoly , files = fsExpPoly) @@ -122,11 +131,11 @@ rep_biomodelos_module_server <- function(input, output, session, common) { # Create extent shapefile # add req ext tmpExt <- file.path(tmpdir, paste0(bioSp(), '_projectionExtentShp.zip')) - rgdal::writeOGR(obj = spp[[bioSp()]]$procEnvs$bgExt, + sf::st_write(obj = sf::st_as_sf(spp[[bioSp()]]$procEnvs$bgExt), dsn = tmpdir, layer = paste0(bioSp(), '_bgShp'), driver = "ESRI Shapefile", - overwrite_layer = TRUE) + append = FALSE) exts <- c('dbf', 'shp', 'shx') fsExt <- file.path(tmpdir, paste0(bioSp(), '_bgShp.', exts)) zip::zipr(zipfile = tmpExt, files = fsExt) @@ -303,6 +312,7 @@ rep_biomodelos_module_server <- function(input, output, session, common) { type = "error") return() } + } }) } diff --git a/inst/shiny/custom_modules/rep_biomodelos.yml b/inst/shiny/custom_modules/rep_biomodelos.yml index f25949ed5..66c49314f 100644 --- a/inst/shiny/custom_modules/rep_biomodelos.yml +++ b/inst/shiny/custom_modules/rep_biomodelos.yml @@ -1,5 +1,5 @@ component: "rep" short_name: "BioModelos payload" long_name: "BioModelos payload" -authors: "GEPB (**)" +authors: "Gonzalo E. Pinilla-Buitrago, Bethany A. Johnson" package: [] diff --git a/inst/shiny/global.R b/inst/shiny/global.R index 5cb52e804..7023cd104 100644 --- a/inst/shiny/global.R +++ b/inst/shiny/global.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# global.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# library(wallace) library(glue) @@ -28,7 +51,7 @@ COMPONENT_MODULES <- list() # Load all Wallace base modules base_module_configs <- c( "modules/occs_queryDb.yml", - "modules/occs_paleoDb.yml", + # "modules/occs_paleoDb.yml", "modules/occs_userOccs.yml", "modules/envs_worldclim.yml", "modules/envs_ecoclimate.yml", diff --git a/inst/shiny/helpers.R b/inst/shiny/helpers.R index 480f93c30..37b542a62 100644 --- a/inst/shiny/helpers.R +++ b/inst/shiny/helpers.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# helpers.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# uiTop <- function(mod_INFO) { modID <- mod_INFO$modID modName <- mod_INFO$modName diff --git a/inst/shiny/modules/envs_ecoclimate.R b/inst/shiny/modules/envs_ecoclimate.R index 89952f2fa..074829ef6 100644 --- a/inst/shiny/modules/envs_ecoclimate.R +++ b/inst/shiny/modules/envs_ecoclimate.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# envs_ecoclimate.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# envs_ecoclimate_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/envs_ecoclimate.md b/inst/shiny/modules/envs_ecoclimate.md index 3d363efea..fb7692926 100644 --- a/inst/shiny/modules/envs_ecoclimate.md +++ b/inst/shiny/modules/envs_ecoclimate.md @@ -2,7 +2,7 @@ **BACKGROUND** -The ecoClimate project (www.ecoclimate.org) provides an open database of processed climatic simulations in a user-friendly format and at a resolution suitable for macroecological and biogeographic studies (Lima-Ribeiro et al. 2015; Varela et al. 2015). Monthly simulations of precipitation as well as mean, maximum, and minimum temperature for various time periods and coupled atmosphere-ocean global climate/circulation models (AOGCMs) were downloaded from the CMIP5 and PMIP3 projects. For ecoClimate, all data were downscaled to 0.5° resolution, according to the standard change-factor approach (Wilby et al. 2004). The 19 bioclimatic variables described in WorldClim (Hijmans et al. 2005) were generated from the downscaled data. This procedure was done using a script developed by Matheus Lima-Ribeiro in https://github.com/ecoClimate. +The ecoClimate project ( ecoclimate.org) provides an open database of processed climatic simulations in a user-friendly format and at a resolution suitable for macroecological and biogeographic studies (Lima-Ribeiro et al. 2015; Varela et al. 2015). Monthly simulations of precipitation as well as mean, maximum, and minimum temperature for various time periods and coupled atmosphere-ocean global climate/circulation models (AOGCMs) were downloaded from the CMIP5 and PMIP3 projects. For ecoClimate, all data were downscaled to 0.5° resolution, according to the standard change-factor approach (Wilby et al. 2004). The 19 bioclimatic variables described in WorldClim (Hijmans et al. 2005) were generated from the downscaled data. This procedure was done using a script developed by Matheus Lima-Ribeiro in github.com/ecoClimate. **IMPLEMENTATION** @@ -10,10 +10,10 @@ The dataset available in Wallace includes simulations for modern times (1950-199 **REFERENCES** -Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G., & Jarvis, A. (2005). Very high resolution interpolated climate surfaces for global land areas. *International Journal of Climatology*, 25(15), 1965-1978. https://doi.org/10.1002/joc.1276 +Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G., & Jarvis, A. (2005). Very high resolution interpolated climate surfaces for global land areas. *International Journal of Climatology*, 25(15), 1965-1978. DOI: 10.1002/joc.1276 -Lima-Ribeiro, M.S., Varela, S., González-Hernández, J., de Oliveira, G., Diniz-Filho, J.A.F., & Terribile, L.C. (2015). EcoClimate: a database of climate data from multiple models for past, present, and future for macroecologists and biogeographers. *Biodiversity Informatics*, 10, 1-21. https://doi.org/10.17161/bi.v10i0.4955 +Lima-Ribeiro, M.S., Varela, S., González-Hernández, J., de Oliveira, G., Diniz-Filho, J.A.F., & Terribile, L.C. (2015). EcoClimate: a database of climate data from multiple models for past, present, and future for macroecologists and biogeographers. *Biodiversity Informatics*, 10, 1-21. DOI: 10.17161/bi.v10i0.4955 -Varela, S., Lima-Ribeiro, M. S., & Terribile, L. C. (2015). A Short Guide to the Climatic Variables of the Last Glacial Maximum for Biogeographers. *PloS One*, 10(6), e0129037. https://doi.org/10.1371/journal.pone.0129037 +Varela, S., Lima-Ribeiro, M. S., & Terribile, L. C. (2015). A Short Guide to the Climatic Variables of the Last Glacial Maximum for Biogeographers. *PloS One*, 10(6), e0129037. DOI: 10.1371/journal.pone.0129037 -Wilby, R.L., Charles, S.P., Zorita, E., Timbal, B., Whetton, P., Mearns, L.O. (2004). Guidelines for use of climate scenarios developed from statistical downscaling methods. *Intergovernmental Panel on Climate Change Report supporting material*, Available from the DDC of IPCC TGCIA. https://www.ipcc-data.org/guidelines/dgm_no2_v1_09_2004.pdf +Wilby, R.L., Charles, S.P., Zorita, E., Timbal, B., Whetton, P., Mearns, L.O. (2004). Guidelines for use of climate scenarios developed from statistical downscaling methods. *Intergovernmental Panel on Climate Change Report supporting material*, Available from the DDC of IPCC TGCIA. pdf diff --git a/inst/shiny/modules/envs_userEnvs.R b/inst/shiny/modules/envs_userEnvs.R index b5d3c37f5..c521b4364 100644 --- a/inst/shiny/modules/envs_userEnvs.R +++ b/inst/shiny/modules/envs_userEnvs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# envs_userEnvs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# envs_userEnvs_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/envs_worldclim.R b/inst/shiny/modules/envs_worldclim.R index cfa5ebcc6..2d736744c 100644 --- a/inst/shiny/modules/envs_worldclim.R +++ b/inst/shiny/modules/envs_worldclim.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# envs_worldclim.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# envs_worldclim_module_ui <- function(id) { ns <- NS(id) tagList( diff --git a/inst/shiny/modules/envs_worldclim.md b/inst/shiny/modules/envs_worldclim.md index c6760301d..4bb901d8e 100644 --- a/inst/shiny/modules/envs_worldclim.md +++ b/inst/shiny/modules/envs_worldclim.md @@ -35,8 +35,8 @@ The “Batch” option will load the environmental variables selected at the cho **REFERENCES** -Fick, S.E., & Hijmans, R.J. (2017). WorldClim 2: new 1-km spatial resolution climate surfaces for global land areas. *International Journal of Climatology*, 37(12), 4302-4315. https://doi.org/10.1002/joc.5086 +Fick, S.E., & Hijmans, R.J. (2017). WorldClim 2: new 1-km spatial resolution climate surfaces for global land areas. *International Journal of Climatology*, 37(12), 4302-4315. DOI: 10.1002/joc.5086 -Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G., & Jarvis, A. (2005). Very high resolution interpolated climate surfaces for global land areas. *International Journal of Climatology*, 25(15), 1965-1978. https://doi.org/10.1002/joc.1276 +Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G., & Jarvis, A. (2005). Very high resolution interpolated climate surfaces for global land areas. *International Journal of Climatology*, 25(15), 1965-1978. DOI: 10.1002/joc.1276 -Hijmans, R.J., et al. (2021). raster: Geographic Data Analysis and Modeling. R package version 3.4-13. https://CRAN.R-project.org/package=raster +Hijmans, R.J., et al. (2021). raster: Geographic Data Analysis and Modeling. R package version 3.4-13. CRAN diff --git a/inst/shiny/modules/espace_nicheOv.R b/inst/shiny/modules/espace_nicheOv.R index 527a0d897..bcf266399 100644 --- a/inst/shiny/modules/espace_nicheOv.R +++ b/inst/shiny/modules/espace_nicheOv.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# espace_nicheOv.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# espace_nicheOv_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/espace_nicheOv.md b/inst/shiny/modules/espace_nicheOv.md index be6c7902d..37d0fba5b 100644 --- a/inst/shiny/modules/espace_nicheOv.md +++ b/inst/shiny/modules/espace_nicheOv.md @@ -14,18 +14,18 @@ Users can download a .png of the plots corresponding to the niche overlap and si **REFERENCES** -Barve, N., Barve, V., Jiménez-Valverde, A., Lira-Noriega, A., Maher, S.P., Peterson, A.T., Soberón, J., & Villalobos, F. (2011). The crucial role of the accessible area in ecological niche modeling and species distribution modeling. *Ecological Modelling*, 222(11), 1810–1819. DOI:10.1016/j.ecolmodel.2011.02.011 +Barve, N., Barve, V., Jiménez-Valverde, A., Lira-Noriega, A., Maher, S.P., Peterson, A.T., Soberón, J., & Villalobos, F. (2011). The crucial role of the accessible area in ecological niche modeling and species distribution modeling. *Ecological Modelling*, 222(11), 1810–1819. DOI: 10.1016/j.ecolmodel.2011.02.011 -Broennimann, O., Fitzpatrick, M.C., Pearman, P.B., Petitpierre, B., Pellissier, L., Yoccoz, N.G., Thuiller, W., Fortin, M.J., Randin, C., Zimmermann, N.E., Graham, C.H., & Guisan, A. (2012). Measuring ecological niche overlap from occurrence and spatial environmental data. *Global Ecology and Biogeography*, 21(4), 481-497. DOI:10.1111/j.1466-8238.2011.00698.x +Broennimann, O., Fitzpatrick, M.C., Pearman, P.B., Petitpierre, B., Pellissier, L., Yoccoz, N.G., Thuiller, W., Fortin, M.J., Randin, C., Zimmermann, N.E., Graham, C.H., & Guisan, A. (2012). Measuring ecological niche overlap from occurrence and spatial environmental data. *Global Ecology and Biogeography*, 21(4), 481-497. DOI: 10.1111/j.1466-8238.2011.00698.x Broennimann, O., Di Cola V., & Guisan, A. (2016). ecospat: Spatial Ecology Miscellaneous Methods. R package version 2.1.1. CRAN -Colwell, R.K., & Futuyma, D.J. (1971). On the Measurement of Niche Breadth and Overlap. *Ecology*, 52(4), 567-576. DOI:10.2307/1934144 +Colwell, R.K., & Futuyma, D.J. (1971). On the Measurement of Niche Breadth and Overlap. *Ecology*, 52(4), 567-576. DOI: 10.2307/1934144 -Guisan, A., Petitpierre, B., Broennimann, O., Daehler, C., & Kueffer, C. (2014). Unifying niche shift studies: Insights from biological invasions. *Trends in Ecology & Evolution*, 29(5), 260–269. DOI:10.1016/j.tree.2014.02.009 +Guisan, A., Petitpierre, B., Broennimann, O., Daehler, C., & Kueffer, C. (2014). Unifying niche shift studies: Insights from biological invasions. *Trends in Ecology & Evolution*, 29(5), 260–269. DOI: 10.1016/j.tree.2014.02.009 -Guisan, A., & Zimmermann, N.E. (2000) Predictive habitat distribution models in ecology. *Ecological Modelling*, 135(2-3), 147-186. DOI:10.1016/S0304-3800(00)00354-9 +Guisan, A., & Zimmermann, N.E. (2000) Predictive habitat distribution models in ecology. *Ecological Modelling*, 135(2-3), 147-186. DOI: 10.1016/S0304-3800(00)00354-9 Schoener, T.W. (1968). Anolis lizards of Bimini: resource partitioning in a complex fauna. *Ecology*, 49(4), 704-726. DOI:10.2307/1935534 -Warren, D.L., Glor, R.E., & Turelli, M. (2008). Environmental niche equivalency versus conservatism: quantitative approaches to niche evolution. *Evolution*, 62(11), 2868–2883. DOI:10.1111/j.1558-5646.2008.00482.x +Warren, D.L., Glor, R.E., & Turelli, M. (2008). Environmental niche equivalency versus conservatism: quantitative approaches to niche evolution. *Evolution*, 62(11), 2868–2883. DOI: 10.1111/j.1558-5646.2008.00482.x diff --git a/inst/shiny/modules/espace_occDens.R b/inst/shiny/modules/espace_occDens.R index 94d47d506..8c774ba1d 100644 --- a/inst/shiny/modules/espace_occDens.R +++ b/inst/shiny/modules/espace_occDens.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# espace_occDens.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# espace_occDens_module_ui <- function(id) { ns <- shiny::NS(id) tagList( @@ -66,8 +89,8 @@ espace_occDens_module_server <- function(input, output, session, common) { mSp <- curSp() } req(spp[[mSp]]$occDens) - ecospat::ecospat.plot.niche(spp[[mSp]]$occDens[[sp1]], title = spName(sp1)) - ecospat::ecospat.plot.niche(spp[[mSp]]$occDens[[sp2]], title = spName(sp2)) + ecospat.plot.nicheDEV(spp[[mSp]]$occDens[[sp1]], title = spName(sp1)) + ecospat.plot.nicheDEV(spp[[mSp]]$occDens[[sp2]], title = spName(sp2)) }) } diff --git a/inst/shiny/modules/espace_occDens.Rmd b/inst/shiny/modules/espace_occDens.Rmd index b6c83e40b..948e3f7e0 100644 --- a/inst/shiny/modules/espace_occDens.Rmd +++ b/inst/shiny/modules/espace_occDens.Rmd @@ -11,8 +11,8 @@ espace_occDens_{{multAbr}} <- espace_occDens( pca = espace_pca_{{multAbr}}) # Plots graphics::par(mfrow = c(1,2)) -ecospat::ecospat.plot.niche(espace_occDens_{{multAbr}}[["{{spName1}}"]], +ecospat.plot.nicheDEV(espace_occDens_{{multAbr}}[["{{spName1}}"]], title = "{{spName1}}") -ecospat::ecospat.plot.niche(espace_occDens_{{multAbr}}[["{{spName2}}"]], +ecospat.plot.nicheDEV(espace_occDens_{{multAbr}}[["{{spName2}}"]], title = "{{spName2}}") ``` diff --git a/inst/shiny/modules/espace_occDens.md b/inst/shiny/modules/espace_occDens.md index 0fdbdf709..71746aae0 100644 --- a/inst/shiny/modules/espace_occDens.md +++ b/inst/shiny/modules/espace_occDens.md @@ -12,12 +12,12 @@ Users can download a .png image of the density grid. **REFERENCES** -Broennimann, O., Fitzpatrick, M.C., Pearman, P.B., Petitpierre, B., Pellissier, L., Yoccoz, N.G., Thuiller, W., Fortin, M.J., Randin, C., Zimmermann, N.E., Graham, C.H., & Guisan, A. (2012). Measuring ecological niche overlap from occurrence and spatial environmental data. *Global Ecology and Biogeography*, 21(4), 481-497. DOI:10.1111/j.1466-8238.2011.00698.x +Broennimann, O., Fitzpatrick, M.C., Pearman, P.B., Petitpierre, B., Pellissier, L., Yoccoz, N.G., Thuiller, W., Fortin, M.J., Randin, C., Zimmermann, N.E., Graham, C.H., & Guisan, A. (2012). Measuring ecological niche overlap from occurrence and spatial environmental data. *Global Ecology and Biogeography*, 21(4), 481-497. DOI: 10.1111/j.1466-8238.2011.00698.x -Calenge, C. (2006). The package adehabitat for the R software: tool for the analysis of space and habitat use by animals. *Ecological Modelling*, 197, 1035. DOI:10.1016/j.ecolmodel.2006.03.017 +Calenge, C. (2006). The package adehabitat for the R software: tool for the analysis of space and habitat use by animals. *Ecological Modelling*, 197, 1035. DOI: 10.1016/j.ecolmodel.2006.03.017 -Di Cola, V., Broennimann, O., Petitpierre, B., Breiner, F.T., d’Amen, M., Randin, C., Engler, R., Pottier, J., Pio, D., Dubuis, A., Pellissier, L., Mateo, R.G., Hordijk, W., Salamin, N., & Guisan, A. (2017). ecospat: an R package to support spatial analyses and modeling of species niches and distributions. *Ecography*, 40(6), 774-787. DOI:10.1111/ecog.02671 +Di Cola, V., Broennimann, O., Petitpierre, B., Breiner, F.T., d’Amen, M., Randin, C., Engler, R., Pottier, J., Pio, D., Dubuis, A., Pellissier, L., Mateo, R.G., Hordijk, W., Salamin, N., & Guisan, A. (2017). ecospat: an R package to support spatial analyses and modeling of species niches and distributions. *Ecography*, 40(6), 774-787. DOI: 10.1111/ecog.02671 Duong, T. (2022). ks: Kernel Smoothing. R package version 1.13.5, CRAN -Gerstner, B.E., Kass, J.M., Kays, R., Helgen, K.M., & Anderson, R.P. (2018). Revised distributional estimates for the recently discovered olinguito (Bassaricyon neblina), with comments on natural and taxonomic history. *Journal of Mammalogy*, 99(2), 321-332. DOI:0.1093/jmammal/gyy012 +Gerstner, B.E., Kass, J.M., Kays, R., Helgen, K.M., & Anderson, R.P. (2018). Revised distributional estimates for the recently discovered olinguito (Bassaricyon neblina), with comments on natural and taxonomic history. *Journal of Mammalogy*, 99(2), 321-332. DOI: 0.1093/jmammal/gyy012 diff --git a/inst/shiny/modules/espace_pca.R b/inst/shiny/modules/espace_pca.R index d0fad57f0..8feba17d8 100644 --- a/inst/shiny/modules/espace_pca.R +++ b/inst/shiny/modules/espace_pca.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# espace_pca.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# espace_pca_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/espace_pca.md b/inst/shiny/modules/espace_pca.md index 9a9e96004..a59ba8724 100644 --- a/inst/shiny/modules/espace_pca.md +++ b/inst/shiny/modules/espace_pca.md @@ -20,14 +20,14 @@ Users have the option to download a zip file containing .png files of the scatte **REFERENCES** -Blonder, B., Morrow, C.B., Maitner, B., Harris, D.J., Lamanna, C., Violle, C., Enquist, B.J., & Kerkhoff, A.J. (2018). New approaches for delineating n‐dimensional hypervolumes. *Methods in Ecology and Evolution*, 9(2), 305-319. DOI:10.1111/2041-210X.12865 +Blonder, B., Morrow, C.B., Maitner, B., Harris, D.J., Lamanna, C., Violle, C., Enquist, B.J., & Kerkhoff, A.J. (2018). New approaches for delineating n‐dimensional hypervolumes. *Methods in Ecology and Evolution*, 9(2), 305-319. DOI: 10.1111/2041-210X.12865 -Broennimann, O., Fitzpatrick, M.C., Pearman, P.B., Petitpierre, B., Pellissier, L., Yoccoz, N.G., Thuiller, W., Fortin, M.J., Randin, C., Zimmermann, N.E., Graham, C.H., & Guisan, A. (2012) Measuring ecological niche overlap from occurrence and spatial environmental data. *Global Ecology and Biogeography*, 21, 481-497. DOI:10.1111/j.1466-8238.2011.00698.x +Broennimann, O., Fitzpatrick, M.C., Pearman, P.B., Petitpierre, B., Pellissier, L., Yoccoz, N.G., Thuiller, W., Fortin, M.J., Randin, C., Zimmermann, N.E., Graham, C.H., & Guisan, A. (2012) Measuring ecological niche overlap from occurrence and spatial environmental data. *Global Ecology and Biogeography*, 21, 481-497. DOI: 10.1111/j.1466-8238.2011.00698.x -Dray, S., & Dufour, A-B. (2007). The ade4 Package: Implementing the Duality Diagram for Ecologists. *Journal of Statistical Software*, 22(4), 1–20. DOI:10.18637/jss.v022.i04 +Dray, S., & Dufour, A-B. (2007). The ade4 Package: Implementing the Duality Diagram for Ecologists. *Journal of Statistical Software*, 22(4), 1–20. DOI: 10.18637/jss.v022.i04 -Legendre, P., & Legendre, L. (2012). Ordination in reduced space. *Numerical Ecology*, 2, 425-520. DOI:10.1016/B978-0-444-53868-0.50009-5 +Legendre, P., & Legendre, L. (2012). Ordination in reduced space. *Numerical Ecology*, 2, 425-520. DOI: 10.1016/B978-0-444-53868-0.50009-5 -Navarro, J., Cardador, L., & Brown, R. (2015). Spatial distribution and ecological niches of non-breeding planktivorous petrels. *Scientific Reports*, 5, 12164. DOI:10.1038/srep12164 +Navarro, J., Cardador, L., & Brown, R. (2015). Spatial distribution and ecological niches of non-breeding planktivorous petrels. *Scientific Reports*, 5, 12164. DOI: 10.1038/srep12164 -Thioulouse, J., Dray, S., Dufour, A., Siberchicot, A., Jombart, T., Pavoine, S. (2018). Multivariate Analysis of Ecological Data with ade4. *Springer*. DOI:10.1007/978-1-4939-8850-1 +Thioulouse, J., Dray, S., Dufour, A., Siberchicot, A., Jombart, T., Pavoine, S. (2018). Multivariate Analysis of Ecological Data with ade4. *Springer*. DOI: 10.1007/978-1-4939-8850-1 diff --git a/inst/shiny/modules/mask_expPoly.R b/inst/shiny/modules/mask_expPoly.R index e2c5e848c..8e6b2144e 100644 --- a/inst/shiny/modules/mask_expPoly.R +++ b/inst/shiny/modules/mask_expPoly.R @@ -143,10 +143,13 @@ mask_expPoly_module_server <- function(input, output, session, common) { polyX <- printVecAsis(round(spp[[curSp()]]$polyMaskXY[, 1], digits = 4)) polyY <- printVecAsis(round(spp[[curSp()]]$polyMaskXY[, 2], digits = 4)) - if (!rgeos::gIntersects(polyExt, polyMask)) { + polyExt_sf<- sf::st_as_sfc(polyExt) #convert poly to sf + polyMask_sf<- sf::st_as_sfc(polyMask) #convert polyMask to sf + # set crs? + if (!sf::st_intersects(polyExt_sf, polyMask_sf, sparse = FALSE)[1,1]) { logger %>% writeLog( type = 'error', hlSpp(curSp()), - "The polygon is outside the background extent. Please specify a new polygon. (**)" + "The polygon falls outside the background extent. Please specify a new polygon. " ) return() } @@ -199,10 +202,13 @@ mask_expPoly_module_server <- function(input, output, session, common) { list(dsn = input$polyExpShp$datapath[i], layer = shpName) } - if (!rgeos::gIntersects(polyExt, polyMask)) { + polyExt_sf<- sf::st_as_sfc(polyExt) #convert poly to sf + polyMask_sf<- sf::st_as_sfc(polyMask) #convert polyMask to sf + # set crs? + if (!sf::st_intersects(polyExt_sf, polyMask_sf, sparse = FALSE)[1,1]) { logger %>% writeLog( type = 'error', hlSpp(curSp()), - "The polygon is outside the background extent. Please specify a new polygon. (**)" + "The polygon falls outside the background extent. Please specify a new polygon. " ) return() } diff --git a/inst/shiny/modules/mask_spatial.R b/inst/shiny/modules/mask_spatial.R index 1d7c42f95..f1cc14db4 100644 --- a/inst/shiny/modules/mask_spatial.R +++ b/inst/shiny/modules/mask_spatial.R @@ -163,7 +163,9 @@ mask_spatial_module_server <- function(input, output, session, common) { # FUNCTION CALL #### selectedPoly <- subset(spatialMask, spatialMask[[maskFields()]] %in% maskAttribute()) - dissPoly <- rgeos::gUnaryUnion(selectedPoly) + selectedPoly_sf <- sf::st_as_sf(selectedPoly) + dissPoly <- sf::st_union(selectedPoly_sf) + dissPoly <- sf::as_Spatial(dissPoly) if (is.null(spp[[curSp()]]$mask$prediction)) { maskPred <- spp[[curSp()]]$mask$origPred diff --git a/inst/shiny/modules/model_bioclim.R b/inst/shiny/modules/model_bioclim.R index 7f01fcce4..da22d3025 100644 --- a/inst/shiny/modules/model_bioclim.R +++ b/inst/shiny/modules/model_bioclim.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# model_bioclim.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# model_bioclim_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/model_bioclim.md b/inst/shiny/modules/model_bioclim.md index 031d15536..55fd1a564 100644 --- a/inst/shiny/modules/model_bioclim.md +++ b/inst/shiny/modules/model_bioclim.md @@ -12,8 +12,8 @@ This model uses the R package `dismo` to build BIOCLIM models, and evaluates the **REFERENCES** -Booth, T.H., Nix, H.A., Busby J.R., & Hutchinson, M.F. (2014). BIOCLIM: The first species distribution modelling package, its early applications and relevance to most current MaxEnt studies. *Diversity and Distributions*, 20(1), 1-9. https://doi.org/10.1111/ddi.12144 +Booth, T.H., Nix, H.A., Busby J.R., & Hutchinson, M.F. (2014). BIOCLIM: The first species distribution modelling package, its early applications and relevance to most current MaxEnt studies. *Diversity and Distributions*, 20(1), 1-9. DOI: 10.1111/ddi.12144 -Hijmans, R. J., & Graham, C.H. (2006). The ability of climate envelope models to predict the effect of climate change on species distributions. *Global Change Biology*, 12(12), 2272-2281. https://doi.org/10.1111/j.1365-2486.2006.01256.x +Hijmans, R. J., & Graham, C.H. (2006). The ability of climate envelope models to predict the effect of climate change on species distributions. *Global Change Biology*, 12(12), 2272-2281. DOI: 10.1111/j.1365-2486.2006.01256.x -Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. https://doi.org/10.1111/2041-210X.12261 +Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. DOI: 10.1111/2041-210X.12261 diff --git a/inst/shiny/modules/model_maxent.R b/inst/shiny/modules/model_maxent.R index 34b9391cd..14a82bdf0 100644 --- a/inst/shiny/modules/model_maxent.R +++ b/inst/shiny/modules/model_maxent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# model_maxent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# model_maxent_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/model_maxent.md b/inst/shiny/modules/model_maxent.md index 25f6bd5f6..5e43114fe 100644 --- a/inst/shiny/modules/model_maxent.md +++ b/inst/shiny/modules/model_maxent.md @@ -42,28 +42,28 @@ The best fix for this is to restart R. **REFERENCES** -Elith, J., Graham, C.H., Anderson, R.P., Dudík, M., Ferrier, S., Guisan, A., Hijmans, R.J., Huettmann, F., Leathwick, J.R., Leahmann, A., Li, J., Lohmann, L.G., Loiselle, B.A., Manion, G., Moritz, C., Nakamura, M., Nakazawa, Y., Overton, J.M., Peterson, A.T., Phillips, S.J., Richardson, K.S., Scachetti-Pereira, R., Schapire, R.E., Soberón, J., Williams, S., Wisz, M.S., & Zimmermann, N.E. (2006). Novel methods improve prediction of species' distributions from occurrence data. *Ecography*, 29(2), 129-151. https://doi.org/10.1111/j.2006.0906-7590.04596.x +Elith, J., Graham, C.H., Anderson, R.P., Dudík, M., Ferrier, S., Guisan, A., Hijmans, R.J., Huettmann, F., Leathwick, J.R., Leahmann, A., Li, J., Lohmann, L.G., Loiselle, B.A., Manion, G., Moritz, C., Nakamura, M., Nakazawa, Y., Overton, J.M., Peterson, A.T., Phillips, S.J., Richardson, K.S., Scachetti-Pereira, R., Schapire, R.E., Soberón, J., Williams, S., Wisz, M.S., & Zimmermann, N.E. (2006). Novel methods improve prediction of species' distributions from occurrence data. *Ecography*, 29(2), 129-151. DOI: 10.1111/j.2006.0906-7590.04596.x -Elith, J., Phillips, S.J., Hastie, T., Dudík, M., Chee, Y.E., & Yates, C.J. (2011). A statistical explanation of MaxEnt for ecologists. *Diversity and Distributions*, 17(1), 43-57. https://doi.org/10.1111/j.1472-4642.2010.00725.x +Elith, J., Phillips, S.J., Hastie, T., Dudík, M., Chee, Y.E., & Yates, C.J. (2011). A statistical explanation of MaxEnt for ecologists. *Diversity and Distributions*, 17(1), 43-57. DOI: 10.1111/j.1472-4642.2010.00725.x -Hernandez, P.A., Graham, C.H., Master, L.L., & Albert, D.L. (2006). The effect of sample size and species characteristics on performance of different species distribution modeling methods. *Ecography*, 29(5), 773-785. https://doi.org/10.1111/j.0906-7590.2006.04700.x +Hernandez, P.A., Graham, C.H., Master, L.L., & Albert, D.L. (2006). The effect of sample size and species characteristics on performance of different species distribution modeling methods. *Ecography*, 29(5), 773-785. DOI: 10.1111/j.0906-7590.2006.04700.x -Hijmans, R.J., Phillips, S., Leathwick, J., & Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. https://CRAN.R-project.org/package=dismo +Hijmans, R.J., Phillips, S., Leathwick, J., & Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. CRAN -James, G., Witten, D., Hastie, T., & Tibshirani, R. (2013). *An Introduction to Statistical Learning with applications in R*. Springer. https://doi.org/10.1007/978-1-4614-7138-7 +James, G., Witten, D., Hastie, T., & Tibshirani, R. (2013). *An Introduction to Statistical Learning with applications in R*. Springer. DOI: 10.1007/978-1-4614-7138-7 -Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 https://CRAN.R-project.org/package=ENMeval +Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 CRAN -Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: What it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. https://doi.org/10.1111/j.1600-0587.2013.07872.x +Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: What it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. DOI: 10.1111/j.1600-0587.2013.07872.x -Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. https://doi.org/10.1111/2041-210X.12261 +Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. DOI: 10.1111/2041-210X.12261 -Phillips, S.J., Anderson, R.P., Schapire, R.E. (2006) Maximum entropy modeling of species geographic distributions. *Ecological Modelling*, 190(3-4), 231-259. https://doi.org/10.1016/j.ecolmodel.2005.03.026 +Phillips, S.J., Anderson, R.P., Schapire, R.E. (2006) Maximum entropy modeling of species geographic distributions. *Ecological Modelling*, 190(3-4), 231-259. DOI: 10.1016/j.ecolmodel.2005.03.026 -Phillips, S.J., & Dudík, M. (2008). Modeling of species distributions with Maxent: new extensions and a comprehensive evaluation. *Ecography*, 31(2), 161-175. https://doi.org/10.1111/j.0906-7590.2008.5203.x +Phillips, S.J., & Dudík, M. (2008). Modeling of species distributions with Maxent: new extensions and a comprehensive evaluation. *Ecography*, 31(2), 161-175. DOI: 10.1111/j.0906-7590.2008.5203.x -Phillips, S. (2021). maxnet: Fitting 'Maxent' Species Distribution Models with 'glmnet'. CRAN. R package version 0.4.1. https://cran.r-project.org/web/packages/maxnet/index.html +Phillips, S. (2021). maxnet: Fitting 'Maxent' Species Distribution Models with 'glmnet'. CRAN. R package version 0.4.1. CRAN -Radosavljevic, A., & Anderson, R.P. (2014). Making better Maxent models of species distributions: complexity, overfitting and evaluation. *Journal of Biogeography*, 41(4), 629-643. https://doi.org/10.1111/jbi.12227 +Radosavljevic, A., & Anderson, R.P. (2014). Making better Maxent models of species distributions: complexity, overfitting and evaluation. *Journal of Biogeography*, 41(4), 629-643. DOI: 10.1111/jbi.12227 -Warren, D.L., & Seifert, S.N. (2011). Ecological niche modeling in Maxent : the importance of model complexity and the performance of model selection criteria. *Ecological Applications*, 21(2), 335-342. https://doi.org/10.1890/10-1171.1 +Warren, D.L., & Seifert, S.N. (2011). Ecological niche modeling in Maxent : the importance of model complexity and the performance of model selection criteria. *Ecological Applications*, 21(2), 335-342. DOI: 10.1890/10-1171.1 diff --git a/inst/shiny/modules/occs_paleoDb.R b/inst/shiny/modules/occs_paleoDb.R index 400e2d885..c6b7ab71d 100644 --- a/inst/shiny/modules/occs_paleoDb.R +++ b/inst/shiny/modules/occs_paleoDb.R @@ -1,119 +1,141 @@ -occs_paleoDb_module_ui <- function(id) { - ns <- shiny::NS(id) - tagList( - shinyWidgets::pickerInput( - ns("timeInterval"), - label = "Select interval", - choices = setNames(as.list(c('Quaternary', 'Holocene', 'Pleistocene', - 'Late Pleistocene', 'Middle Pleistocene', - 'Calabrian', 'Gelasian')), - c('Quaternary [0 - 2.588]', - '-- Holocene [0 - 0.0117]', - '-- Pleistocene [0.0117 - 2.588]', - '---- Late Pleistocene [0.0117 - 0.126]', - '---- Middle Pleistocene [0.126 - 0.781]', - '---- Calabrian [0.781 - 1.806]', - '---- Gelasian [1.806 - 2.588]')), - multiple = FALSE), - tags$div(title = 'Examples: Canis lupus, Crocuta crocuta', - textInput(ns("spNamePB"), label = "Enter species scientific name", - placeholder = 'format: Genus species')), - tags$div(title = paste0('Maximum number of occurrences recovered from', - ' databases. Downloaded records are not sorted', - ' randomly: rows are always consistent between', - ' downloads.'), - numericInput(ns("occsNumPB"), "Set maximum number of occurrences", - value = 0, min = 0, max = 500)), - actionButton(ns("goPaleoDbOccs"), "Query Database") - ) -} - -occs_paleoDb_module_server <- function(input, output, session, common) { - logger <- common$logger - spp <- common$spp - - observeEvent(input$goPaleoDbOccs, { - # WARNING #### - if (input$occsNumPB < 1) { - logger %>% writeLog(type = 'warning', "Enter a non-zero number of ocurrences.") - return() - } - - # FUNCTION CALL #### - occsTbls <- occs_paleoDb(input$spNamePB, input$occsNumPB, input$timeInterval, - logger) - - req(occsTbls) - - # LOAD INTO SPP #### - occsOrig <- occsTbls$orig - occs <- occsTbls$cleaned - sp <- fmtSpN(input$spNamePB) - sp <- paste0(toupper(substring(sp, 1, 1)), substring(sp, 2, nchar(sp))) - # if species name is already in list, overwrite it - if (!is.null(spp[[sp]])) spp[[sp]] <- NULL - # add two copies of occs dataset -- "occs" will be altered during session, - # while "occsOrig" will be preserved in this state - # rmm is the range model metadata object - spp[[sp]] <- list(occs = occs, - occData = list(occsOrig = occsOrig, - occsCleaned = occs), - rmm = rangeModelMetadata::rmmTemplate(), - rmd = list()) - - # REFERENCES #### - knitcitations::citep(citation("paleobioDB")) - - # METADATA #### - spp[[sp]]$rmm$data$occurrence$taxon <- sp - spp[[sp]]$rmm$data$occurrence$dataType <- "presence only" - spp[[sp]]$rmm$data$occurrence$presenceSampleSize <- nrow(occs) - spp[[sp]]$rmm$data$occurrence$yearMin <- paste(min(occs$late_age), "mya") - spp[[sp]]$rmm$data$occurrence$yearMax <- paste(max(occs$early_age), "mya") - spp[[sp]]$rmm$code$wallace$occsNum <- input$occsNumPB - spp[[sp]]$rmm$code$wallace$occsRemoved <- nrow(occsOrig) - nrow(occs) - spp[[sp]]$rmm$data$occurrence$sources <- "paleobioDb" - spp[[sp]]$rmm$code$wallace$timeInterval <- input$timeInterval - - common$update_component(tab = "Map") - }) - - return(list( - save = function() { - list( - spNamePB = input$spNamePB, - occsNumPB = input$occsNumPB, - timeInterval = input$timeInterval - ) - }, - load = function(state) { - updateTextInput(session, "spNamePB", value = state$spNamePB) - updateNumericInput(session, "occsNumPB", value = state$occsNumPB) - shinyWidgets::updatePickerInput(session, "timeInterval", - selected = input$timeInterval) - } - )) - -} - -occs_paleoDb_module_map <- function(map, common) { - curSp <- common$curSp - spp <- common$spp - req(spp[[curSp()]]$occs) - occs <- spp[[curSp()]]$occData$occsCleaned - map %>% clearAll() %>% - addCircleMarkers(data = occs, lat = ~latitude, lng = ~longitude, - radius = 5, color = 'red', fill = TRUE, fillColor = "red", - fillOpacity = 0.2, weight = 2, popup = ~pop) %>% - zoom2Occs(occs) -} - -occs_paleoDb_module_rmd <- function(species) { - # Variables used in the module's Rmd code - list( - occs_paleoDb_knit = species$rmm$data$occurrence$sources == "paleobioDb", - occsNumPB_rmd = species$rmm$code$wallace$occsNum, - timeInterval_rmd = species$rmm$code$wallace$timeInterval - ) -} - +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# occs_paleoDb.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# +# occs_paleoDb_module_ui <- function(id) { +# ns <- shiny::NS(id) +# tagList( +# shinyWidgets::pickerInput( +# ns("timeInterval"), +# label = "Select interval", +# choices = setNames(as.list(c('Quaternary', 'Holocene', 'Pleistocene', +# 'Late Pleistocene', 'Middle Pleistocene', +# 'Calabrian', 'Gelasian')), +# c('Quaternary [0 - 2.588]', +# '-- Holocene [0 - 0.0117]', +# '-- Pleistocene [0.0117 - 2.588]', +# '---- Late Pleistocene [0.0117 - 0.126]', +# '---- Middle Pleistocene [0.126 - 0.781]', +# '---- Calabrian [0.781 - 1.806]', +# '---- Gelasian [1.806 - 2.588]')), +# multiple = FALSE), +# tags$div(title = 'Examples: Canis lupus, Crocuta crocuta', +# textInput(ns("spNamePB"), label = "Enter species scientific name", +# placeholder = 'format: Genus species')), +# tags$div(title = paste0('Maximum number of occurrences recovered from', +# ' databases. Downloaded records are not sorted', +# ' randomly: rows are always consistent between', +# ' downloads.'), +# numericInput(ns("occsNumPB"), "Set maximum number of occurrences", +# value = 0, min = 0, max = 500)), +# actionButton(ns("goPaleoDbOccs"), "Query Database") +# ) +# } +# +# occs_paleoDb_module_server <- function(input, output, session, common) { +# logger <- common$logger +# spp <- common$spp +# +# observeEvent(input$goPaleoDbOccs, { +# # WARNING #### +# if (input$occsNumPB < 1) { +# logger %>% writeLog(type = 'warning', "Enter a non-zero number of ocurrences.") +# return() +# } +# +# # FUNCTION CALL #### +# occsTbls <- occs_paleoDb(input$spNamePB, input$occsNumPB, input$timeInterval, +# logger) +# +# req(occsTbls) +# +# # LOAD INTO SPP #### +# occsOrig <- occsTbls$orig +# occs <- occsTbls$cleaned +# sp <- fmtSpN(input$spNamePB) +# sp <- paste0(toupper(substring(sp, 1, 1)), substring(sp, 2, nchar(sp))) +# # if species name is already in list, overwrite it +# if (!is.null(spp[[sp]])) spp[[sp]] <- NULL +# # add two copies of occs dataset -- "occs" will be altered during session, +# # while "occsOrig" will be preserved in this state +# # rmm is the range model metadata object +# spp[[sp]] <- list(occs = occs, +# occData = list(occsOrig = occsOrig, +# occsCleaned = occs), +# rmm = rangeModelMetadata::rmmTemplate(), +# rmd = list()) +# +# # REFERENCES #### +# knitcitations::citep(citation("paleobioDB")) +# +# # METADATA #### +# spp[[sp]]$rmm$data$occurrence$taxon <- sp +# spp[[sp]]$rmm$data$occurrence$dataType <- "presence only" +# spp[[sp]]$rmm$data$occurrence$presenceSampleSize <- nrow(occs) +# spp[[sp]]$rmm$data$occurrence$yearMin <- paste(min(occs$late_age), "mya") +# spp[[sp]]$rmm$data$occurrence$yearMax <- paste(max(occs$early_age), "mya") +# spp[[sp]]$rmm$code$wallace$occsNum <- input$occsNumPB +# spp[[sp]]$rmm$code$wallace$occsRemoved <- nrow(occsOrig) - nrow(occs) +# spp[[sp]]$rmm$data$occurrence$sources <- "paleobioDb" +# spp[[sp]]$rmm$code$wallace$timeInterval <- input$timeInterval +# +# common$update_component(tab = "Map") +# }) +# +# return(list( +# save = function() { +# list( +# spNamePB = input$spNamePB, +# occsNumPB = input$occsNumPB, +# timeInterval = input$timeInterval +# ) +# }, +# load = function(state) { +# updateTextInput(session, "spNamePB", value = state$spNamePB) +# updateNumericInput(session, "occsNumPB", value = state$occsNumPB) +# shinyWidgets::updatePickerInput(session, "timeInterval", +# selected = input$timeInterval) +# } +# )) +# +# } +# +# occs_paleoDb_module_map <- function(map, common) { +# spp <- common$spp +# curSp <- common$curSp +# occs <- spp[[curSp()]]$occData$occsCleaned +# map %>% clearAll() %>% +# addCircleMarkers(data = occs, lat = ~latitude, lng = ~longitude, +# radius = 5, color = 'red', fill = TRUE, fillColor = "red", +# fillOpacity = 0.2, weight = 2, popup = ~pop) %>% +# zoom2Occs(occs) +# } +# +# occs_paleoDb_module_rmd <- function(species) { +# # Variables used in the module's Rmd code +# list( +# occs_paleoDb_knit = species$rmm$data$occurrence$sources == "paleobioDb", +# occsNumPB_rmd = species$rmm$code$wallace$occsNum, +# timeInterval_rmd = species$rmm$code$wallace$timeInterval +# ) +# } +# diff --git a/inst/shiny/modules/occs_paleoDb.md b/inst/shiny/modules/occs_paleoDb.md index f4d105d46..1ba7b7c1d 100644 --- a/inst/shiny/modules/occs_paleoDb.md +++ b/inst/shiny/modules/occs_paleoDb.md @@ -12,6 +12,6 @@ The records used in downstream analyses in Wallace are filtered to remove those **REFERENCES** -Varela, S., González-Hernández, J., Sgarbi, L. F., Marshall, C., Uhen, M. D., Peters, S., & McClennen, M. (2015). paleobioDB: an R package for downloading, visualizing and processing data from the Paleobiology Database. *Ecography*, 38(4), 419–425. https://doi.org/10.1111/ecog.01154 +Varela, S., González-Hernández, J., Sgarbi, L. F., Marshall, C., Uhen, M. D., Peters, S., & McClennen, M. (2015). paleobioDB: an R package for downloading, visualizing and processing data from the Paleobiology Database. *Ecography*, 38(4), 419–425. DOI: 10.1111/ecog.01154 -Varela, S., Lobo, J. M., & Hortal, J. (2011). Using species distribution models in paleobiogeography: A matter of data, predictors and concepts. Palaeogeography, Palaeoclimatology, *Palaeoecology*, 310(3), 451–463. https://doi.org/10.1016/j.palaeo.2011.07.021 +Varela, S., Lobo, J. M., & Hortal, J. (2011). Using species distribution models in paleobiogeography: A matter of data, predictors and concepts. *Palaeogeography, Palaeoclimatology, Palaeoecology*, 310(3), 451–463. DOI: 10.1016/j.palaeo.2011.07.021 diff --git a/inst/shiny/modules/occs_queryDb.R b/inst/shiny/modules/occs_queryDb.R index 732ae651f..dd35add19 100644 --- a/inst/shiny/modules/occs_queryDb.R +++ b/inst/shiny/modules/occs_queryDb.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# occs_queryDb.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# occs_queryDb_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/occs_queryDb.md b/inst/shiny/modules/occs_queryDb.md index aad7967f1..ff1c50fb1 100644 --- a/inst/shiny/modules/occs_queryDb.md +++ b/inst/shiny/modules/occs_queryDb.md @@ -6,25 +6,25 @@ Over the past two decades, the worldwide biodiversity informatics community has **IMPLEMENTATION** -By default, this module relies on the R package `spocc`, which provides streamlined access to many species occurrence databases, some of which aggregate data from myriad providers (e.g., individual museums or citizen-science initiatives) (Chamberlain et al. 2021). Currently, users can choose among two of the largest databases: GBIF and VertNet. Note that as implemented at present, users must choose only one of these databases, and any later download overwrites previous ones. +By default, this module relies on the R package `spocc`, which provides streamlined access to many species occurrence databases, some of which aggregate data from myriad providers (e.g., individual museums or citizen-science initiatives) (Chamberlain et al. 2021). Currently, users can choose among three of the largest databases: GBIF, VertNet, and BIEN. Note that as implemented at present, users must choose only one of these databases, and any later download overwrites previous ones. When GBIF has been selected, an alternative option exists to receive data source citations in addition to the records themselves. In this case, the module will use the R package `occCite` instead of `spocc`. Whereas `spocc` uses the `occ_search()` function from the `rgbif` package to perform a streamlined search of the GBIF database (Chamberlain et al. 2021), the `occCite` package instead uses `occ_download()` from the `rgbif` package (Owens et al. 2021). While this requires the user to enter their GBIF login information (which must be set up beforehand), the search has two advantages. First, it returns a DOI that can be used to cite the downloaded dataset when publishing manuscripts and other descriptions of research results. Second, it has no hard limit on the number of occurrences that can be obtained (which is set at 100,000 in searches conducted with `occ_search()`. -For all options in this module, records used in downstream analyses in *Wallace* are filtered to remove those without georeferences (latitude/longitude coordinates) and that have exact duplicate coordinates of other records (including the same number of decimal places). The "Occurrences" tab displays all the filtered records with several key fields: scientific_name, longitude, latitude, country, state_province, locality, year, record_type, catalog_number, institution_code, elevation, (standard field names from GBIF), and uncertainty. The records are available for download as a .csv file with all original fields and include records without georeferences, or as the cleaned table shown in the “Occurrences” tab. Additionally, the user can choose to retain only records that have an estimate of the uncertainty of the georeference, which can be critical for assessing whether or not the record is of sufficient quality for a given analysis (Anderson et al. 2020). +For all options in this module, records are filtered to include presences only (excuding absence data). Also, records used in downstream analyses in *Wallace* are filtered to remove those without georeferences (latitude/longitude coordinates) and that have exact duplicate coordinates of other records (including the same number of decimal places). The "Occurrences" tab displays all the filtered records with several key fields: scientific_name, longitude, latitude, country, state_province, locality, year, record_type, catalog_number, institution_code, elevation, (standard field names from GBIF), and uncertainty. The records are available for download as a .csv file with all original fields and include records without georeferences, or as the cleaned table shown in the “Occurrences” tab. Additionally, the user can choose to retain only records that have an estimate of the uncertainty of the georeference, which can be critical for assessing whether or not the record is of sufficient quality for a given analysis (Anderson et al. 2020). **REFERENCES** -Anderson, R.P., Araújo, M.B., Guisan, A., Lobo, J.M., Martínez-Meyer, E., Peterson, A.T., & Soberón, J.M.. (2020). Optimizing biodiversity informatics to improve information flow, data quality, and utility for science and society. *Frontiers of Biogeography*, 12(3), e47839. https://doi.org/10.21425/F5FBG47839 +Anderson, R.P., Araújo, M.B., Guisan, A., Lobo, J.M., Martínez-Meyer, E., Peterson, A.T., & Soberón, J.M.. (2020). Optimizing biodiversity informatics to improve information flow, data quality, and utility for science and society. *Frontiers of Biogeography*, 12(3), e47839. DOI: 10.21425/F5FBG47839 -Chamberlain, S., Ram, K., & Hart, T. (2021). spocc: Interface to Species Occurrence Data Sources. R package version 1.2.0. https://github.com/ropensci/spocc +Chamberlain, S., Ram, K., & Hart, T. (2021). spocc: Interface to Species Occurrence Data Sources. R package version 1.2.0. GitHub -Gaiji, S., Chavan, V., Ariño, A.H., Otegui, J., Hobern, D., Sood, R., & Robles, E. (2013). Content assessment of the primary biodiversity data published through GBIF network: status, challenges and potentials. *Biodiversity Informatics*, 8(2), 94-172. https://doi.org/10.17161/bi.v8i2.4124 +Gaiji, S., Chavan, V., Ariño, A.H., Otegui, J., Hobern, D., Sood, R., & Robles, E. (2013). Content assessment of the primary biodiversity data published through GBIF network: status, challenges and potentials. *Biodiversity Informatics*, 8(2), 94-172. DOI: 10.17161/bi.v8i2.4124 -Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., & Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. https://doi.org/10.1111/ecog.05618 +Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., & Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. DOI: 10.1111/ecog.05618 -Sullivan, B.L., Wood, C.L., Iliff, M.J., Bonney, R.E., Fink, D., & Kelling, S. (2009). eBird: A citizen-based bird observation network in the biological sciences. *Biological Conservation*, 142(10), 2282-2292. https://doi.org/10.1016/j.biocon.2009.05.006 +Sullivan, B.L., Wood, C.L., Iliff, M.J., Bonney, R.E., Fink, D., & Kelling, S. (2009). eBird: A citizen-based bird observation network in the biological sciences. *Biological Conservation*, 142(10), 2282-2292. DOI: 10.1016/j.biocon.2009.05.006 -Walters, M., & Scholes, R. J. (2017). The GEO Handbook on Biodiversity Observation Networks. Springer International Publishing. https://doi.org/10.1007/978-3-319-27288-7 +Walters, M., & Scholes, R. J. (2017). The GEO Handbook on Biodiversity Observation Networks. Springer International Publishing. DOI: 10.1007/978-3-319-27288-7 diff --git a/inst/shiny/modules/occs_userOccs.R b/inst/shiny/modules/occs_userOccs.R index 7b55f331b..d11ff67a8 100644 --- a/inst/shiny/modules/occs_userOccs.R +++ b/inst/shiny/modules/occs_userOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# occs_userOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# occs_userOccs_module_ui <- function(id) { ns <- NS(id) tagList( diff --git a/inst/shiny/modules/part_nonSpat.R b/inst/shiny/modules/part_nonSpat.R index a35d0652c..931b4dfa8 100644 --- a/inst/shiny/modules/part_nonSpat.R +++ b/inst/shiny/modules/part_nonSpat.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# part_nonSpat.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# part_nonSpat_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/part_nonSpat.md b/inst/shiny/modules/part_nonSpat.md index afcae7721..7751a51c1 100644 --- a/inst/shiny/modules/part_nonSpat.md +++ b/inst/shiny/modules/part_nonSpat.md @@ -12,8 +12,8 @@ These non-spatial partitions are either via a: 1) jackknife procedure where each **REFERENCES** -Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. https://doi.org/10.1111/2041-210X.12261 +Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. DOI: 10.1111/2041-210X.12261 -Pearson, R.G., Raxworthy, C.J., Nakamura, M., & Peterson, T.A. (2007). Predicting species distributions from small numbers of occurrence records: a test case using cryptic geckos in Madagascar. *Journal of Biogeography*, 34(1), 102-117. https://doi.org/10.1111/j.1365-2699.2006.01594.x +Pearson, R.G., Raxworthy, C.J., Nakamura, M., & Peterson, T.A. (2007). Predicting species distributions from small numbers of occurrence records: a test case using cryptic geckos in Madagascar. *Journal of Biogeography*, 34(1), 102-117. DOI: 10.1111/j.1365-2699.2006.01594.x -Shcheglovitova, M. & R. P. Anderson. (2013). Estimating optimal complexity for ecological niche models: a jackknife approach for species with small sample sizes. *Ecological Modelling*, 269, 9-17. https://doi.org/10.1016/j.ecolmodel.2013.08.011 +Shcheglovitova, M. & R. P. Anderson. (2013). Estimating optimal complexity for ecological niche models: a jackknife approach for species with small sample sizes. *Ecological Modelling*, 269, 9-17. DOI: 10.1016/j.ecolmodel.2013.08.011 diff --git a/inst/shiny/modules/part_spat.R b/inst/shiny/modules/part_spat.R index aaa3c6efb..472af7494 100644 --- a/inst/shiny/modules/part_spat.R +++ b/inst/shiny/modules/part_spat.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# part_spat.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# part_spat_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/part_spat.md b/inst/shiny/modules/part_spat.md index 77c780d64..5101e9514 100644 --- a/inst/shiny/modules/part_spat.md +++ b/inst/shiny/modules/part_spat.md @@ -12,4 +12,4 @@ The user can choose one of three means of spatial partitioning: the 1) "block", **REFERENCES** -Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. https://doi.org/10.1111/2041-210X.12261 +Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. DOI: 10.1111/2041-210X.12261 diff --git a/inst/shiny/modules/penvs_bgExtent.R b/inst/shiny/modules/penvs_bgExtent.R index 42ac3c483..ed82b6c67 100644 --- a/inst/shiny/modules/penvs_bgExtent.R +++ b/inst/shiny/modules/penvs_bgExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_bgExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# penvs_bgExtent_module_ui <- function(id) { ns <- shiny::NS(id) tagList( @@ -72,7 +95,7 @@ penvs_bgExtent_module_server <- function(input, output, session, common) { spp[[sp]]$procEnvs$bgExt <- bgExt # REFERENCES #### - knitcitations::citep(citation("rgeos")) + knitcitations::citep(citation("sf")) knitcitations::citep(citation("sp")) # METADATA #### diff --git a/inst/shiny/modules/penvs_bgExtent.md b/inst/shiny/modules/penvs_bgExtent.md index 3a3056f0f..41f6bcc8c 100644 --- a/inst/shiny/modules/penvs_bgExtent.md +++ b/inst/shiny/modules/penvs_bgExtent.md @@ -6,30 +6,30 @@ For niche/distribution modeling approaches that compare the environments associa **IMPLEMENTATION** -This module relies on important functions from the R packages `sp` (for defining spatial objects) and `rgeos` (for buffering spatial objects). +This module relies on important functions from the R packages `sp` (for defining spatial objects) and `sf` (for buffering spatial objects). In this module, *Wallace* provides three simple ways to delimit a study region, by: 1) bounding box (rectangle with most the extreme coordinates in the four cardinal directions as vertices), 2) minimum convex polygon (a convex shape drawn around localities with minimized area), or 3) buffers around occurrence points. For each of these options, users can specify a buffer distance (in degrees; i.e. not meters). *Wallace* then masks the environmental grids by the resulting polygon. Users can download the masked grids as three raster grid formats (.asc, .grd, and .tif). **REFERENCES** -Acevedo, P., Jiménez‐Valverde, A., Lobo, J.M., & Real, R. (2012). Delimiting the geographical background in species distribution modelling. *Journal of Biogeography*, 39(8), 1383-1390. https://doi.org/10.1111/j.1365-2699.2012.02713.x +Acevedo, P., Jiménez‐Valverde, A., Lobo, J.M., & Real, R. (2012). Delimiting the geographical background in species distribution modelling. *Journal of Biogeography*, 39(8), 1383-1390. DOI: 10.1111/j.1365-2699.2012.02713.x -Anderson, R.P., & Raza A. (2010). The effect of the extent of the study region on GIS models of species geographic distributions and estimates of niche evolution: preliminary tests with montane rodents (genus *Nephelomys*) in Venezuela. *Journal of Biogeography*, 37(7), 1378-1393. https://doi.org/10.1111/j.1365-2699.2010.02290.x +Anderson, R.P., & Raza A. (2010). The effect of the extent of the study region on GIS models of species geographic distributions and estimates of niche evolution: preliminary tests with montane rodents (genus *Nephelomys*) in Venezuela. *Journal of Biogeography*, 37(7), 1378-1393. DOI: 10.1111/j.1365-2699.2010.02290.x -Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. *Annals of the New York Academy of Sciences*, 1297(1), 8-28. https://doi.org/10.1111/nyas.12264 +Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. *Annals of the New York Academy of Sciences*, 1297(1), 8-28. DOI: 10.1111/nyas.12264 Anderson, R. P. (2015). El modelado de nichos y distribuciones: no es simplemente "clic, clic, clic." [With English and French translations: Modeling niches and distributions: it's not just "click, click, click" and La modélisation de niche et de distributions: ce n'est pas juste "clic, clic, clic"]. *Biogeografía*, 8, 4-27. pdf -Barve, N., Barve, V., Jiménez-Valverde, A., Lira-Noriega, A., Maher, S.P., Peterson, A.T., Soberón, J., & Villalobos, F. (2011). The crucial role of the accessible area in ecological niche modeling and species distribution modeling. *Ecological Modelling*, 222(11), 1810–1819. https://doi.org/10.1016/j.ecolmodel.2011.02.011 +Barve, N., Barve, V., Jiménez-Valverde, A., Lira-Noriega, A., Maher, S.P., Peterson, A.T., Soberón, J., & Villalobos, F. (2011). The crucial role of the accessible area in ecological niche modeling and species distribution modeling. *Ecological Modelling*, 222(11), 1810–1819. DOI: 10.1016/j.ecolmodel.2011.02.011 -Franklin, J. (2010). *Mapping Species Distributions: Spatial Inference and Prediction*. Data for species distribution models: the biological data. Cambridge: Cambridge University Press. https://doi.org/10.1017/CBO9780511810602 +Franklin, J. (2010). *Mapping Species Distributions: Spatial Inference and Prediction*. Data for species distribution models: the biological data. Cambridge: Cambridge University Press. DOI: 10.1017/CBO9780511810602 -Gerstner, B.E., Kass, J.M., Kays, R., Helgen, K.M., & Anderson, R.P. (2018). Revised distributional estimates for the recently discovered olinguito (*Bassaricyon neblina*), with comments on natural and taxonomic history. *Journal of Mammalogy*, 99(2), 321-332. https://doi.org/10.1093/jmammal/gyy012 +Gerstner, B.E., Kass, J.M., Kays, R., Helgen, K.M., & Anderson, R.P. (2018). Revised distributional estimates for the recently discovered olinguito (*Bassaricyon neblina*), with comments on natural and taxonomic history. *Journal of Mammalogy*, 99(2), 321-332. DOI: 10.1093/jmammal/gyy012 -Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: What it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. https://doi.org/10.1111/j.1600-0587.2013.07872.x +Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: What it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. DOI: 10.1111/j.1600-0587.2013.07872.x -Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura M., & Araújo M.B. (2011). Modeling Ecological Niches. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. https://doi.org/10.23943/princeton/9780691136868.003.0005 +Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura M., & Araújo M.B. (2011). Modeling Ecological Niches. In: *Ecological Niches and Geographic Distributions*. Princeton, New Jersey: *Monographs in Population Biology*, 49. Princeton University Press. DOI: 10.23943/princeton/9780691136868.003.0005 -Saupe, E.E., Barve, V., Myers, C.E., Soberón, J., Barve, N., Hensz, C.M., Peterson, A.T., Owens, H.L., & Lira-Noriega, A. (2012). Variation in niche and distribution model performance: the need for a priori assessment of key causal factors. *Ecological Modelling*, 237-238, 11-22. https://doi.org/10.1016/j.ecolmodel.2012.04.001 +Saupe, E.E., Barve, V., Myers, C.E., Soberón, J., Barve, N., Hensz, C.M., Peterson, A.T., Owens, H.L., & Lira-Noriega, A. (2012). Variation in niche and distribution model performance: the need for a priori assessment of key causal factors. *Ecological Modelling*, 237-238, 11-22. DOI: 10.1016/j.ecolmodel.2012.04.001 -VanDerWal, J., Shoo, L.P., Graham, C., & Williams, S.E. (2009). Selecting pseudo-absence data for presence-only distribution modeling: How far should you stray from what you know?. *Ecological Modelling*, 220(4), 589-594. https://doi.org/10.1016/j.ecolmodel.2008.11.010 +VanDerWal, J., Shoo, L.P., Graham, C., & Williams, S.E. (2009). Selecting pseudo-absence data for presence-only distribution modeling: How far should you stray from what you know?. *Ecological Modelling*, 220(4), 589-594. DOI: 10.1016/j.ecolmodel.2008.11.010 diff --git a/inst/shiny/modules/penvs_bgExtent.yml b/inst/shiny/modules/penvs_bgExtent.yml index a7c7602d8..44b1aa9ed 100644 --- a/inst/shiny/modules/penvs_bgExtent.yml +++ b/inst/shiny/modules/penvs_bgExtent.yml @@ -1,5 +1,5 @@ component: "penvs" short_name: "Select Study Region" long_name: "Select Study Region by Extent" -authors: "Jamie M. Kass, Bruno Vilela, Robert P. Anderson" -package: [sp, rgeos] +authors: "Jamie M. Kass, Bruno Vilela, Bethany A. Johnson, Robert P. Anderson" +package: [sp, sf] diff --git a/inst/shiny/modules/penvs_drawBgExtent.R b/inst/shiny/modules/penvs_drawBgExtent.R index 5edcf83b4..51ded5372 100644 --- a/inst/shiny/modules/penvs_drawBgExtent.R +++ b/inst/shiny/modules/penvs_drawBgExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_drawBgExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# penvs_drawBgExtent_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/penvs_drawBgExtent.md b/inst/shiny/modules/penvs_drawBgExtent.md index 28aa2a952..aadd4b0b3 100644 --- a/inst/shiny/modules/penvs_drawBgExtent.md +++ b/inst/shiny/modules/penvs_drawBgExtent.md @@ -8,17 +8,15 @@ This module allows users to use the polygon-drawing tool to delineate the study The R package `leaflet.extras` (Karambelkar et al. 2018) provides a drawing tool plugin to the `leaflet` map (Cheng et al. 2022) for this module, which allows users to draw a polygon to specify the study region. The polygon-drawing tool icon is located underneath the zoom in/out buttons on the map. If a mistake is made while drawing, the last point can be deleted, or the whole drawing can be cleared. To finish, click the first point to close the shape. -Also, this module relies on `rgeos` (Bivand et al. 2021) for buffering spatial objects. A buffer can be applied (in degrees) to the drawn polygon before moving on to Step 2) Sample Background Points. +Also, this module relies on `sf` (Pebesma 2018) for buffering spatial objects. A buffer can be applied (in degrees) to the drawn polygon before moving on to Step 2) Sample Background Points. Wallace then masks the environmental grids by the resulting polygon. Users can download the masked grids in three raster grid formats (.asc, .grd, and .tif). **REFERENCES** -Bivand, R., Rundel, C., Pebesma, E., Stuetz, R., Hufthammer, K.O., Giraudoux, P., Davis, M, & Santilli, S. (2021). rgeos: Interface to Geometry Engine - Open Source ('GEOS'). CRAN. R package Version 0.5-0.9. -https://cran.r-project.org/web/packages/rgeos/index.html - Cheng, et al. (2022). leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet' Library. R package Version 2.1. -https://rstudio.github.io/leaflet/ +GitHub Karambelkar, et al. (2018). leaflet.extras: Extra Functionality for 'leaflet' Package. R package Version 1.0. -https://bhaskarvk.github.io/leaflet.extras/ +GitHub +Pebesma, E., 2018. Simple Features for R: Standardized Support for Spatial Vector Data. The R Journal 10 (1), 439-446, DOI:10.32614/RJ-2018-009. diff --git a/inst/shiny/modules/penvs_drawBgExtent.yml b/inst/shiny/modules/penvs_drawBgExtent.yml index 582f1c05b..802718ba4 100644 --- a/inst/shiny/modules/penvs_drawBgExtent.yml +++ b/inst/shiny/modules/penvs_drawBgExtent.yml @@ -1,5 +1,5 @@ component: "penvs" short_name: "Draw Study Region" long_name: "Draw Study Region" -authors: "Gonzalo E. Pinilla-Buitrago, Jamie M. Kass, Bruno Vilela, Robert P. Anderson" +authors: "Gonzalo E. Pinilla-Buitrago, Jamie M. Kass, Bruno Vilela, Bethany A. Johnson, Robert P. Anderson" package: [] diff --git a/inst/shiny/modules/penvs_userBgExtent.R b/inst/shiny/modules/penvs_userBgExtent.R index 0ff6e63b1..2a9fba684 100644 --- a/inst/shiny/modules/penvs_userBgExtent.R +++ b/inst/shiny/modules/penvs_userBgExtent.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# penvs_userBgExtent.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# penvs_userBgExtent_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/penvs_userBgExtent.yml b/inst/shiny/modules/penvs_userBgExtent.yml index 721f16649..bf604d1a1 100644 --- a/inst/shiny/modules/penvs_userBgExtent.yml +++ b/inst/shiny/modules/penvs_userBgExtent.yml @@ -1,5 +1,5 @@ component: "penvs" short_name: "User-specified Study Region" long_name: "User-specified Study Region" -authors: "Jamie M. Kass, Bruno Vilela, Robert P. Anderson" +authors: "Jamie M. Kass, Bruno Vilela, Bethany A. Johnson, Robert P. Anderson" package: [] diff --git a/inst/shiny/modules/poccs_removeByID.R b/inst/shiny/modules/poccs_removeByID.R index dcbd4db05..4d0870cf8 100644 --- a/inst/shiny/modules/poccs_removeByID.R +++ b/inst/shiny/modules/poccs_removeByID.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# poccs_removeByID.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# poccs_removeByID_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/poccs_removeByID.md b/inst/shiny/modules/poccs_removeByID.md index 156c9cf14..aa7b2bbf3 100644 --- a/inst/shiny/modules/poccs_removeByID.md +++ b/inst/shiny/modules/poccs_removeByID.md @@ -10,4 +10,4 @@ Users can select individual localities for removal from the analysis by specifyi **REFERENCES** -Gaiji, S., Chavan, V., Ariño, A.H., Otegui, J., Hobern, D., Sood, R., & Robles, E. (2013). Content assessment of the primary biodiversity data published through GBIF network: status, challenges and potentials. *Biodiversity Informatics*, 8(2), 94-172. https://doi.org/10.17161/bi.v8i2.4124 +Gaiji, S., Chavan, V., Ariño, A.H., Otegui, J., Hobern, D., Sood, R., & Robles, E. (2013). Content assessment of the primary biodiversity data published through GBIF network: status, challenges and potentials. *Biodiversity Informatics*, 8(2), 94-172. DOI: 10.17161/bi.v8i2.4124 diff --git a/inst/shiny/modules/poccs_selectOccs.R b/inst/shiny/modules/poccs_selectOccs.R index 1214af40b..38c6a19ab 100644 --- a/inst/shiny/modules/poccs_selectOccs.R +++ b/inst/shiny/modules/poccs_selectOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# poccs_selectOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# poccs_selectOccs_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/poccs_selectOccs.md b/inst/shiny/modules/poccs_selectOccs.md index 89c977d97..0c31570c0 100644 --- a/inst/shiny/modules/poccs_selectOccs.md +++ b/inst/shiny/modules/poccs_selectOccs.md @@ -12,4 +12,4 @@ Occurrences that fall within (i.e. overlap with) the polygon are retained, and a **REFERENCES** -Gaiji, S., Chavan, V., Ariño, A.H., Otegui, J., Hobern, D., Sood, R., & Robles, E. (2013). Content assessment of the primary biodiversity data published through GBIF network: status, challenges and potentials. *Biodiversity Informatics*, 8(2), 94-172. https://doi.org/10.17161/bi.v8i2.4124 +Gaiji, S., Chavan, V., Ariño, A.H., Otegui, J., Hobern, D., Sood, R., & Robles, E. (2013). Content assessment of the primary biodiversity data published through GBIF network: status, challenges and potentials. *Biodiversity Informatics*, 8(2), 94-172. DOI: 10.17161/bi.v8i2.4124 diff --git a/inst/shiny/modules/poccs_thinOccs.R b/inst/shiny/modules/poccs_thinOccs.R index 489075f6f..dbc9b2c78 100644 --- a/inst/shiny/modules/poccs_thinOccs.R +++ b/inst/shiny/modules/poccs_thinOccs.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# poccs_thinOccs.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# poccs_thinOccs_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/poccs_thinOccs.md b/inst/shiny/modules/poccs_thinOccs.md index 4022fd07a..06fcc6322 100644 --- a/inst/shiny/modules/poccs_thinOccs.md +++ b/inst/shiny/modules/poccs_thinOccs.md @@ -12,16 +12,16 @@ If run with sufficient (independent) repetitions, `spThin` will produce at least **REFERENCES** -Aiello-Lammens, M.E., Boria, R.A., Radosavljevic, A., Vilela, B., & Anderson, R.P. (2015). spThin: an R package for spatial thinning of species occurrence records for use in ecological niche models. *Ecography*, 38(5), 541-545. https://doi.org/10.1111/ecog.01132 +Aiello-Lammens, M.E., Boria, R.A., Radosavljevic, A., Vilela, B., & Anderson, R.P. (2015). spThin: an R package for spatial thinning of species occurrence records for use in ecological niche models. *Ecography*, 38(5), 541-545. DOI: 10.1111/ecog.01132 -Anderson, R.P. (2003). Real vs. artefactual absences in species distributions: tests for *Oryzomys albigularis* (Rodentia: *Muridae*) in Venezuela. *Journal of Biogeography*, 30(4), 591-605. https://doi.org/10.1046/j.1365-2699.2003.00867.x +Anderson, R.P. (2003). Real vs. artefactual absences in species distributions: tests for *Oryzomys albigularis* (Rodentia: *Muridae*) in Venezuela. *Journal of Biogeography*, 30(4), 591-605. DOI: 10.1046/j.1365-2699.2003.00867.x -Boria, R.A., Olson, L.E., Goodman, S.M., & Anderson, R.P. (2014). Spatial filtering to reduce sampling bias can improve the performance of ecological niche models. *Ecological Modelling*, 275, 73-77. https://doi.org/10.1016/j.ecolmodel.2013.12.012 +Boria, R.A., Olson, L.E., Goodman, S.M., & Anderson, R.P. (2014). Spatial filtering to reduce sampling bias can improve the performance of ecological niche models. *Ecological Modelling*, 275, 73-77. DOI: 10.1016/j.ecolmodel.2013.12.012 -Kadmon, R., Farber O., & Danin A. (2004). Effect of roadside bias on the accuracy of predictive maps produced by bioclimatic models. *Ecological Applications*, 14(2), 401-413. https://doi.org/10.1890/02-5364 +Kadmon, R., Farber O., & Danin A. (2004). Effect of roadside bias on the accuracy of predictive maps produced by bioclimatic models. *Ecological Applications*, 14(2), 401-413. DOI: 10.1890/02-5364 -Phillips, S.J., Dudík, M., Elith, J., Graham, C.H., Lehmann, A., Leathwick, J., & Ferrier, S. (2009). Sample selection bias and presence-only distribution models: implications for background and pseudo-absence data. *Ecological Applications*, 19(1), 181-197. https://doi.org/10.1890/07-2153.1 +Phillips, S.J., Dudík, M., Elith, J., Graham, C.H., Lehmann, A., Leathwick, J., & Ferrier, S. (2009). Sample selection bias and presence-only distribution models: implications for background and pseudo-absence data. *Ecological Applications*, 19(1), 181-197. DOI: 10.1890/07-2153.1 -Varela, S., Anderson, R.P., García-Valdés, R., & Fernández-González, F. (2014). Environmental filters reduce the effects of sampling bias and improve predictions of ecological niche models. *Ecography*, 37(11), 1084-1091. https://doi.org/10.1111/j.1600-0587.2013.00441.x +Varela, S., Anderson, R.P., García-Valdés, R., & Fernández-González, F. (2014). Environmental filters reduce the effects of sampling bias and improve predictions of ecological niche models. *Ecography*, 37(11), 1084-1091. DOI: 10.1111/j.1600-0587.2013.00441.x -Veloz, S.D. (2009). Spatially autocorrelated sampling falsely inflates measures of accuracy for presence-only niche models. *Journal of Biogeography*, 36(12), 2290-2299. https://doi.org/10.1111/j.1365-2699.2009.02174.x +Veloz, S.D. (2009). Spatially autocorrelated sampling falsely inflates measures of accuracy for presence-only niche models. *Journal of Biogeography*, 36(12), 2290-2299. DOI: 10.1111/j.1365-2699.2009.02174.x diff --git a/inst/shiny/modules/rep_markdown.R b/inst/shiny/modules/rep_markdown.R index 898435a3a..f19c72f14 100644 --- a/inst/shiny/modules/rep_markdown.R +++ b/inst/shiny/modules/rep_markdown.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# rep_markdown.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# rep_markdown_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/rep_markdown.md b/inst/shiny/modules/rep_markdown.md index cfedcdc2b..32c934406 100644 --- a/inst/shiny/modules/rep_markdown.md +++ b/inst/shiny/modules/rep_markdown.md @@ -26,18 +26,18 @@ To generate a PDF of your session code, it is essential you have a working versi **REFERENCES** -Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. https://doi.org/10.1126/sciadv.aat4858 +Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. DOI: 10.1126/sciadv.aat4858 -Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. https://doi.org/10.1038/s41559-019-0972-5 +Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. DOI: 10.1038/s41559-019-0972-5 -Fitzpatrick, F.C., Lachmuth, S., & Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070.https://doi.org/10.1111/ecog.05700 +Fitzpatrick, F.C., Lachmuth, S., & Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070.DOI: 10.1111/ecog.05700 -Kass, J.M, Muscarella, R., Galante, P.J, Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. https://doi.org/10.1111/2041-210X.13628 +Kass, J.M, Muscarella, R., Galante, P.J, Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. DOI: 10.1111/2041-210X.13628 -Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., & Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. https://doi.org/10.1111/geb.12993 +Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., & Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. DOI: 10.1111/geb.12993 -Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., & Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. https://doi.org/10.1111/ecog.05618 +Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., & Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. DOI: 10.1111/ecog.05618 -Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. https://doi.org/10.1093/biosci/biz045 +Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. DOI: 10.1093/biosci/biz045 -Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. https://doi.org/10.1111/ecog.04960 +Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. DOI: 10.1111/ecog.04960 diff --git a/inst/shiny/modules/rep_refPackages.R b/inst/shiny/modules/rep_refPackages.R index 43cb1693a..fff9c4c55 100644 --- a/inst/shiny/modules/rep_refPackages.R +++ b/inst/shiny/modules/rep_refPackages.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# rep_refPackages.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# rep_refPackages_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/rep_refPackages.md b/inst/shiny/modules/rep_refPackages.md index 3fa1ca685..0f93e4a5d 100644 --- a/inst/shiny/modules/rep_refPackages.md +++ b/inst/shiny/modules/rep_refPackages.md @@ -12,22 +12,22 @@ Users can download a list of references for the R packages used in the analyses. **REFERENCES** -Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. https://doi.org/10.1126/sciadv.aat4858 +Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. DOI: 10.1126/sciadv.aat4858 -Boettiger, C. (2021). knitcitations: Citations for 'Knitr' Markdown Files. R package version 1.0.12. https://CRAN.R-project.org/package=knitcitations +Boettiger, C. (2021). knitcitations: Citations for 'Knitr' Markdown Files. R package version 1.0.12. CRAN -Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. https://doi.org/10.1038/s41559-019-0972-5 +Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. DOI: 10.1038/s41559-019-0972-5 -Fitzpatrick, F.C., Lachmuth, S., & Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070.https://doi.org/10.1111/ecog.05700 +Fitzpatrick, F.C., Lachmuth, S., & Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070.DOI: 10.1111/ecog.05700 -Kass, J.M, Muscarella, R., Galante, P.J, Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. https://doi.org/10.1111/2041-210X.13628 +Kass, J.M, Muscarella, R., Galante, P.J, Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. DOI: 10.1111/2041-210X.13628 -McLean, M.W. (2020). RefManageR: Straightforward 'BibTeX' and 'BibLaTeX' Bibliography Management. R package version 1.3.0. https://CRAN.R-project.org/package=RefManageR +McLean, M.W. (2020). RefManageR: Straightforward 'BibTeX' and 'BibLaTeX' Bibliography Management. R package version 1.3.0. CRAN -Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., & Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. https://doi.org/10.1111/geb.12993 +Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., & Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. DOI: 10.1111/geb.12993 -Owens, H. L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., & Guralnick, R.P. (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. https://doi.org/10.1111/ecog.05618 +Owens, H. L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., & Guralnick, R.P. (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. DOI: 10.1111/ecog.05618 -Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. https://doi.org/10.1093/biosci/biz045 +Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. DOI: 10.1093/biosci/biz045 -Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. https://doi.org/10.1111/ecog.04960 +Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. DOI: 10.1111/ecog.04960 diff --git a/inst/shiny/modules/rep_refPackages.yml b/inst/shiny/modules/rep_refPackages.yml index f2b07ccc8..c686e5e8d 100644 --- a/inst/shiny/modules/rep_refPackages.yml +++ b/inst/shiny/modules/rep_refPackages.yml @@ -1,5 +1,5 @@ component: "rep" short_name: "Reference Packages" long_name: "List Reference Packages" -authors: "Gonzalo E. Pinilla-Buitrago, Bethany Johnson, Robert P. Anderson" +authors: "Gonzalo E. Pinilla-Buitrago, Bethany A. Johnson, Robert P. Anderson" package: [RefManageR, knitcitations] diff --git a/inst/shiny/modules/rep_rmms.R b/inst/shiny/modules/rep_rmms.R index 8a4bd7050..4f4c354b3 100644 --- a/inst/shiny/modules/rep_rmms.R +++ b/inst/shiny/modules/rep_rmms.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# rep_rmms.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# rep_rmms_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/rep_rmms.md b/inst/shiny/modules/rep_rmms.md index 405afb17b..a04ec56ce 100644 --- a/inst/shiny/modules/rep_rmms.md +++ b/inst/shiny/modules/rep_rmms.md @@ -12,20 +12,20 @@ Metadata from the Wallace analyses can be downloaded as a zip file via the `rang **REFERENCES** -Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. https://doi.org/10.1126/sciadv.aat4858 +Araújo, M.B., Anderson, R.P., Barbosa, A.M., Beale, C.M., Dormann, C.F., Early, R., Garcia, R.A., Guisan, A., Maiorano, L., Naimi, B., O’Hara, R.B., Zimmermann, N.E., & Rahbek, C. (2019). Standards for distribution models in biodiversity assessments. *Science Advances*, 5, 1. DOI: 10.1126/sciadv.aat4858 -Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. https://doi.org/10.1038/s41559-019-0972-5 +Feng, X., Park, D.S., Walker, C., Peterson, A.T., Merow, C., & Papeş, M. (2019). A checklist for maximizing reproducibility of ecological niche models. *Nature Ecology & Evolution*, 3, 1382–1395. DOI: 10.1038/s41559-019-0972-5 -Fitzpatrick, F.C., Lachmuth, S., Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070.https://doi.org/10.1111/ecog.05700 +Fitzpatrick, F.C., Lachmuth, S., Haydt, N.T. (2021). The ODMAP protocol: a new tool for standardized reporting that could revolutionize species distribution modeling. *Ecography*, 44(7), 1067-1070.DOI: 10.1111/ecog.05700 -Kass, J.M, Muscarella, R., Galante, P.J, Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. https://doi.org/10.1111/2041-210X.13628 +Kass, J.M, Muscarella, R., Galante, P.J, Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval 2.0: Redesigned for customizable and reproducible modeling of species’ niches and distributions. *Methods in Ecology and Evolution*, 12(9), 1602– 1608. DOI: 10.1111/2041-210X.13628 -Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. https://doi.org/10.1111/geb.12993 +Merow, C., Maitner, B.S., Owens, H.L., Kass, J.M., Enquist, B.J., Jetz, W., Guralnick, R.P. (2019). Species’ range model metadata standards: RMMS. *Global Ecology and Biogeography*, 28(12), 1912–1924. DOI: 10.1111/geb.12993 -Merow, C., Maitner, B., Owens, H., Kass, J., Enquist, B., Guralnik, R., Zurrell, D., & Koenig, C. (2021).rangeModelMetadata: Provides Templates for Metadata Files Associated with Species Range Models. R package v1.0.4. https://CRAN.R-project.org/package=rangeModelMetadata +Merow, C., Maitner, B., Owens, H., Kass, J., Enquist, B., Guralnik, R., Zurrell, D., & Koenig, C. (2021).rangeModelMetadata: Provides Templates for Metadata Files Associated with Species Range Models. R package v1.0.4. CRAN -Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. https://doi.org/10.1111/ecog.05618 +Owens, H.L., Merow, C., Maitner, B.S., Kass, J.M., Barve, V., Guralnick, R.P., (2021). occCite: Tools for querying and managing large biodiversity occurrence datasets. *Ecography*, 44(8), 1228-1235. DOI: 10.1111/ecog.05618 -Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. https://doi.org/10.1093/biosci/biz045 +Sofaer, H.R., Jarnevich, C.S., Pearse, I.S., Smyth, R.L, Auer, S., Cook, G.L., Edwards, T.C., Guala, G.F., Howard, T.G., Morisette, J.T., & Hamiliton, H. (2019). Development and delivery of species distribution models to inform decision-making. *BioScience*, 69(7), 544–557. DOI: 10.1093/biosci/biz045 -Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. https://doi.org/10.1111/ecog.04960 +Zurell, D., et al. (2020). A standard protocol for reporting species distribution models. *Ecography*, 43(9), 1261–1277. DOI: 10.1111/ecog.04960 diff --git a/inst/shiny/modules/vis_bioclimPlot.R b/inst/shiny/modules/vis_bioclimPlot.R index 86efa5a6a..8bf68cf79 100644 --- a/inst/shiny/modules/vis_bioclimPlot.R +++ b/inst/shiny/modules/vis_bioclimPlot.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# vis_bioclimPlot.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# vis_bioclimPlot_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/vis_bioclimPlot.md b/inst/shiny/modules/vis_bioclimPlot.md index b0c6c0471..3dd7f7aeb 100644 --- a/inst/shiny/modules/vis_bioclimPlot.md +++ b/inst/shiny/modules/vis_bioclimPlot.md @@ -12,6 +12,6 @@ The envelope plot can be viewed in the "Results" tab. The axes of the plot repre **REFERENCES** -Booth, T.H., Nix, H.A., Busby J.R., & Hutchinson, M.F. (2014). BIOCLIM: The first species distribution modelling package, its early applications and relevance to most current MaxEnt studies. *Diversity and Distributions*, 20(1), 1-9. https://doi.org/10.1111/ddi.12144 +Booth, T.H., Nix, H.A., Busby J.R., & Hutchinson, M.F. (2014). BIOCLIM: The first species distribution modelling package, its early applications and relevance to most current MaxEnt studies. *Diversity and Distributions*, 20(1), 1-9. DOI: 10.1111/ddi.12144 -Hutchinson, G.E. (1957). "Concluding remarks". *Cold Spring Harbor Symposia on Quantitative Biology*, 22, 415–427. http://dx.doi.org/10.1101/SQB.1957.022.01.039 +Hutchinson, G.E. (1957). "Concluding remarks". *Cold Spring Harbor Symposia on Quantitative Biology*, 22, 415–427. DOI: 10.1101/SQB.1957.022.01.039 diff --git a/inst/shiny/modules/vis_mapPreds.R b/inst/shiny/modules/vis_mapPreds.R index bc6a0a586..79e880cd7 100644 --- a/inst/shiny/modules/vis_mapPreds.R +++ b/inst/shiny/modules/vis_mapPreds.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# vis_mapPreds.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# vis_mapPreds_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/vis_mapPreds.md b/inst/shiny/modules/vis_mapPreds.md index 1f710e84f..b9a5c3b45 100644 --- a/inst/shiny/modules/vis_mapPreds.md +++ b/inst/shiny/modules/vis_mapPreds.md @@ -14,14 +14,14 @@ Users may then choose a thresholding rule (minimum training presence or 10 perce **REFERENCES** -Hijmans, R. J., Phillips, S., Leathwick, J., & Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. https://CRAN.R-project.org/package=dismo +Hijmans, R. J., Phillips, S., Leathwick, J., & Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. CRAN -Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 https://CRAN.R-project.org/package=ENMeval +Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 CRAN -Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: What it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. https://doi.org/10.1111/j.1600-0587.2013.07872.x +Merow, C., Smith, M.J., & Silander, J.A. (2013). A practical guide to MaxEnt for modeling species' distributions: What it does, and why inputs and settings matter. *Ecography*, 36(10), 1058-1069. DOI: 10.1111/j.1600-0587.2013.07872.x -Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). *Ecological Niches and Geographic Distributions*. Princeton, New Jersey. Princeton University Press. https://press.princeton.edu/books/paperback/9780691136882/ecological-niches-and-geographic-distributions-mpb-49 +Peterson, A.T., Soberón, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M., & Araújo, M.B. (2011). *Ecological Niches and Geographic Distributions*. Princeton, New Jersey. Princeton University Press. Ecological Niches and Geographic Distributions -Phillips, S.J., Anderson, R.P., Dudík, M., Schapire, R.E., & Blair, M.E. (2017). Opening the black box: an open-source release of Maxent. *Ecography*, 40(7), 887-893. https://doi.org/10.1111/ecog.03049 +Phillips, S.J., Anderson, R.P., Dudík, M., Schapire, R.E., & Blair, M.E. (2017). Opening the black box: an open-source release of Maxent. *Ecography*, 40(7), 887-893. DOI: 10.1111/ecog.03049 -Yackulic, C.B., Chandler, R., Zipkin, E.F., Royle, J.A., Nichols, J.D., Campbell Grant, E.H., & Veran, S. (2013). Presence-only modelling using MAXENT: when can we trust the inferences?. *Methods in Ecology and Evolution*, 4(3), 236-243. https://doi.org/10.1111/2041-210x.12004 +Yackulic, C.B., Chandler, R., Zipkin, E.F., Royle, J.A., Nichols, J.D., Campbell Grant, E.H., & Veran, S. (2013). Presence-only modelling using MAXENT: when can we trust the inferences?. *Methods in Ecology and Evolution*, 4(3), 236-243. DOI: 10.1111/2041-210x.12004 diff --git a/inst/shiny/modules/vis_maxentEvalPlot.R b/inst/shiny/modules/vis_maxentEvalPlot.R index befee1a80..4be1dcc73 100644 --- a/inst/shiny/modules/vis_maxentEvalPlot.R +++ b/inst/shiny/modules/vis_maxentEvalPlot.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# vis_maxentEvalPlot.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# vis_maxentEvalPlot_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/vis_maxentEvalPlot.md b/inst/shiny/modules/vis_maxentEvalPlot.md index 80e75975a..8a71b16b2 100644 --- a/inst/shiny/modules/vis_maxentEvalPlot.md +++ b/inst/shiny/modules/vis_maxentEvalPlot.md @@ -12,9 +12,9 @@ Users can select which evaluation metric plot to view in the "Results" tab. Diff **REFERENCES** -Merow, C., Smith, M.J., Edwards, T.C., Guisan, A., McMahon, S.M., Normand, S., Thuiller, W., Wüest, R.O., Zimmermann, N.E., & Elith, J. (2014). What do we gain from simplicity versus complexity in species distribution models? *Ecography*, 37(12), 1267-1281. https://doi.org/10.1111/ecog.00845 +Merow, C., Smith, M.J., Edwards, T.C., Guisan, A., McMahon, S.M., Normand, S., Thuiller, W., Wüest, R.O., Zimmermann, N.E., & Elith, J. (2014). What do we gain from simplicity versus complexity in species distribution models? *Ecography*, 37(12), 1267-1281. DOI: 10.1111/ecog.00845 -Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. https://doi.org/10.1111/2041-210X.12261 +Muscarella, R., Galante, P.J., Soley-Guardia, M., Boria, R.A., Kass, J.M., Uriarte, M., & Anderson, R.P. (2014). ENMeval: An R package for conducting spatially independent evaluations and estimating optimal model complexity for Maxent ecological niche models. *Methods in Ecology and Evolution*, 5(11), 1198-1205. DOI: 10.1111/2041-210X.12261 -Radosavljevic, A., & Anderson, R.P. (2014). Making better Maxent models of species distributions: complexity, overfitting and evaluation. *Journal of Biogeography*, 41(4), 629-643. https://doi.org/10.1111/jbi.12227 +Radosavljevic, A., & Anderson, R.P. (2014). Making better Maxent models of species distributions: complexity, overfitting and evaluation. *Journal of Biogeography*, 41(4), 629-643. DOI: 10.1111/jbi.12227 diff --git a/inst/shiny/modules/vis_responsePlot.R b/inst/shiny/modules/vis_responsePlot.R index d829793ed..02a4c0b6f 100644 --- a/inst/shiny/modules/vis_responsePlot.R +++ b/inst/shiny/modules/vis_responsePlot.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# vis_responsePlot.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# vis_responsePlot_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/vis_responsePlot.md b/inst/shiny/modules/vis_responsePlot.md index 1c065f65e..c1e08d035 100644 --- a/inst/shiny/modules/vis_responsePlot.md +++ b/inst/shiny/modules/vis_responsePlot.md @@ -14,5 +14,5 @@ Users must first select a model. Depending on the `ENMeval` settings selected in **REFERENCES** -Elith, J., & Graham, C.H. (2009). Do they? How do they? WHY do they differ? On finding reasons for differing performances of species distribution models. *Ecography*, 32, 66-77. https://doi.org/10.1111/j.1600-0587.2008.05505.x +Elith, J., & Graham, C.H. (2009). Do they? How do they? WHY do they differ? On finding reasons for differing performances of species distribution models. *Ecography*, 32, 66-77. DOI: 10.1111/j.1600-0587.2008.05505.x diff --git a/inst/shiny/modules/xfer_area.R b/inst/shiny/modules/xfer_area.R index 2289d9141..66b581a37 100644 --- a/inst/shiny/modules/xfer_area.R +++ b/inst/shiny/modules/xfer_area.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_area.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# xfer_area_module_ui <- function(id) { ns <- shiny::NS(id) tagList( @@ -45,7 +68,7 @@ xfer_area_module_ui <- function(id) { actionButton(ns('goTransferArea'), "Transfer"), tags$hr(class = "hrDashed"), actionButton(ns("goResetXfer"), "Reset", class = 'butReset'), - strong(" transferion extent ") + strong(" transfer extent ") ) } @@ -117,13 +140,22 @@ xfer_area_module_server <- function(input, output, session, common) { input$userXfBuf, logger, spN = curSp()) # ERRORS #### # Check that the extents of raster and transfer extent intersects - if (!rgeos::gIntersects(polyXf, - methods::as(raster::extent(envs()), - 'SpatialPolygons'))) { + polyXf_sfc <- sf::st_as_sfc(polyXf) #convert poly to sfc + envs_ext <- methods::as(raster::extent(envs()),'SpatialPolygons') + envs_sfc <- sf::st_as_sfc(envs_ext) #convert envs to sfc + #set crs to match + if (sf::st_crs(polyXf_sfc) != sf::st_crs(envs_sfc)) { + sf::st_crs(polyXf_sfc) <- sf::st_crs(envs_sfc) logger %>% - writeLog(type = 'error', 'Extents do not overlap') + writeLog(type = 'error', 'CRS was automatically set to match environmental variables.') return() } + if (!sf::st_intersects(polyXf_sfc, envs_sfc, sparse = FALSE)[1,1]) { + logger %>% + writeLog(type = 'error', 'Extents do not overlap.') + return() + } + # METADATA #### spp[[curSp()]]$rmm$code$wallace$XfBuff <- input$userXfBuf # get extensions of all input files @@ -158,15 +190,16 @@ xfer_area_module_server <- function(input, output, session, common) { return() } if (is.null(spp[[curSp()]]$transfer$xfExt)) { - logger %>% writeLog(type = 'error', 'Select transferion extent first.') + logger %>% writeLog(type = 'error', 'Select transfer extent first.') return() } # Check that the extents of raster and transfer extent intersects - if (!rgeos::gIntersects(spp[[curSp()]]$transfer$xfExt, - methods::as(raster::extent(envs()), - 'SpatialPolygons'))) { + Xfer_sfc <- sf::st_as_sfc(spp[[curSp()]]$transfer$xfExt) #convert xfrExt to sfc + envs_ext <- methods::as(raster::extent(envs()),'SpatialPolygons') + envs_sfc <- sf::st_as_sfc(envs_ext) #convert envs to sfc + if (!sf::st_intersects(Xfer_sfc, envs_sfc, sparse = FALSE)[1,1]) { logger %>% - writeLog(type = 'error', 'Extents do not overlap') + writeLog(type = 'error', 'Extents do not overlap.') return() } @@ -233,11 +266,11 @@ xfer_area_module_server <- function(input, output, session, common) { thr <- stats::quantile(occPredVals, probs = input$trainPresQuantile) } xferAreaThr <- xferArea > thr - logger %>% writeLog(hlSpp(curSp()), "Transferion of model to new area with threshold ", + logger %>% writeLog(hlSpp(curSp()), "Transfer of model to new area with threshold ", input$threshold, ' (', formatC(thr, format = "e", 2), ').') } else { xferAreaThr <- xferArea - logger %>% writeLog(hlSpp(curSp()), "Transferion of model to new area with ", + logger %>% writeLog(hlSpp(curSp()), "Transfer of model to new area with ", predType, ' output.') } raster::crs(xferAreaThr) <- raster::crs(envs()) @@ -295,12 +328,12 @@ xfer_area_module_server <- function(input, output, session, common) { common$update_component(tab = "Map") }) - # Reset Transferion Extent button functionality + # Reset Transfer Extent button functionality observeEvent(input$goResetXfer, { spp[[curSp()]]$polyXfXY <- NULL spp[[curSp()]]$polyXfID <- NULL spp[[curSp()]]$transfer <- NULL - logger %>% writeLog("Reset transferion extent.") + logger %>% writeLog("Reset transfer extent.") }) return(list( @@ -338,7 +371,7 @@ xfer_area_module_map <- function(map, common) { circleOptions = FALSE, markerOptions = FALSE, circleMarkerOptions = FALSE, editOptions = leaflet.extras::editToolbarOptions() ) - # Add just transferion Polygon + # Add just transfer Polygon req(spp[[curSp()]]$transfer$xfExt) polyXfXY <- spp[[curSp()]]$transfer$xfExt@polygons[[1]]@Polygons if(length(polyXfXY) == 1) { @@ -375,7 +408,7 @@ xfer_area_module_map <- function(map, common) { values = mapXferVals, layerId = 'xfer', labFormat = reverseLabel(2, reverse_order = TRUE)) } - # map model prediction raster and transferion polygon + # map model prediction raster and transfer polygon map %>% clearMarkers() %>% clearShapes() %>% removeImage('xferRas') %>% addRasterImage(mapXfer(), colors = rasPal, opacity = 0.7, layerId = 'xferRas', group = 'xfer', method = "ngb") @@ -399,9 +432,9 @@ xfer_area_module_rmd <- function(species) { polyXfID_rmd = if(!is.null(species$rmm$code$wallace$drawExtPolyXfCoords)){ species$polyXfID} else {0}, BgBuf_rmd = species$rmm$code$wallace$XfBuff, - ##Determine the type of transferion extent to use correct RMD function + ##Determine the type of transfer extent to use correct RMD function xfer_area_extent_knit = !is.null(species$rmm$code$wallace$userXfShpParams), - ##Use of threshold for transferion + ##Use of threshold for transfer xfer_area_threshold_knit = !is.null(species$rmm$prediction$transfer$environment1$thresholdSet), xfer_thresholdRule_rmd = species$rmm$prediction$transfer$environment1$thresholdRule, xfer_threshold_rmd = if (!is.null(species$rmm$prediction$transfer$environment1$thresholdSet)){ diff --git a/inst/shiny/modules/xfer_area.md b/inst/shiny/modules/xfer_area.md index f214c4475..7ba3e11de 100644 --- a/inst/shiny/modules/xfer_area.md +++ b/inst/shiny/modules/xfer_area.md @@ -19,12 +19,12 @@ NOTE: To reset the selected spatial transfer extent, a red *Reset* button is ava **REFERENCES** -Anderson R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. https://doi.org/10.1111/nyas.12264 +Anderson R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. DOI: 10.1111/nyas.12264 -Fitzpatrick, M. C., & Hargrove, W. W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. https://doi.org/10.1007/s10531-009-9584-8 +Fitzpatrick, M. C., & Hargrove, W. W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. DOI: 10.1007/s10531-009-9584-8 -Hijmans, R.J., Phillips, S., Leathwick, J., Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. https://CRAN.R-project.org/package=dismo +Hijmans, R.J., Phillips, S., Leathwick, J., Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. CRAN -Kass, J., Muscarella, R., Galante, P. J., Bohl, C. L., Pinilla-Buitrago, G. E., Boria, R. A., Soley-Guardia, M., Anderson, R. P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 https://CRAN.R-project.org/package=ENMeval +Kass, J., Muscarella, R., Galante, P. J., Bohl, C. L., Pinilla-Buitrago, G. E., Boria, R. A., Soley-Guardia, M., Anderson, R. P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 CRAN diff --git a/inst/shiny/modules/xfer_area.yml b/inst/shiny/modules/xfer_area.yml index eda4ecb8c..fda7610bd 100644 --- a/inst/shiny/modules/xfer_area.yml +++ b/inst/shiny/modules/xfer_area.yml @@ -1,5 +1,5 @@ component: "xfer" short_name: "Transfer to New Extent" long_name: "Transfer to New Extent" -authors: "Jamie M. Kass, Bruno Vilela, Gonzalo E. Pinilla-Buitrago, Robert P. Anderson" +authors: "Jamie M. Kass, Bruno Vilela, Gonzalo E. Pinilla-Buitrago, Bethany A. Johnson, Robert P. Anderson" package: [dismo] diff --git a/inst/shiny/modules/xfer_mess.R b/inst/shiny/modules/xfer_mess.R index 9c0f48955..fdefcec19 100644 --- a/inst/shiny/modules/xfer_mess.R +++ b/inst/shiny/modules/xfer_mess.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_mess.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# xfer_mess_module_ui <- function(id) { ns <- shiny::NS(id) tagList( diff --git a/inst/shiny/modules/xfer_mess.md b/inst/shiny/modules/xfer_mess.md index d9a5807e8..c2534c340 100644 --- a/inst/shiny/modules/xfer_mess.md +++ b/inst/shiny/modules/xfer_mess.md @@ -13,15 +13,15 @@ Users must first select a model. Depending on the ENMeval (Kass et al. 2021) set **REFERENCES** -Anderson R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. https://doi.org/10.1111/nyas.12264 +Anderson R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. DOI: 10.1111/nyas.12264 -Elith, J., Kearney, M., Phillips, S. (2010). The art of modelling range-shifting species. Methods in Ecology and Evolution, 1(4), 330-342. https://doi.org/10.1111/j.2041-210X.2010.00036.x +Elith, J., Kearney, M., Phillips, S. (2010). The art of modelling range-shifting species. Methods in Ecology and Evolution, 1(4), 330-342. DOI: 10.1111/j.2041-210X.2010.00036.x -Fitzpatrick, M. C., Hargrove, W. W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. https://doi.org/10.1007/s10531-009-9584-8 +Fitzpatrick, M. C., Hargrove, W. W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. DOI: 10.1007/s10531-009-9584-8 -Hijmans, R.J., Phillips, S., Leathwick, J., Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. https://CRAN.R-project.org/package=dismo +Hijmans, R.J., Phillips, S., Leathwick, J., Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. CRAN -Kass, J., Muscarella, R., Galante, P. J., Bohl, C. L., Pinilla-Buitrago, G. E., Boria, R. A., Soley-Guardia, M., Anderson, R. P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 https://CRAN.R-project.org/package=ENMeval +Kass, J., Muscarella, R., Galante, P. J., Bohl, C. L., Pinilla-Buitrago, G. E., Boria, R. A., Soley-Guardia, M., Anderson, R. P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 CRAN -Williams, J. W., & Jackson, S. T. (2007). Novel climates, no-analog communities, and ecological surprises. Frontiers in Ecology and the Environment, 5(9), 475-482. https://doi.org/10.1890/070037 +Williams, J. W., & Jackson, S. T. (2007). Novel climates, no-analog communities, and ecological surprises. Frontiers in Ecology and the Environment, 5(9), 475-482. DOI: 10.1890/070037 diff --git a/inst/shiny/modules/xfer_time.R b/inst/shiny/modules/xfer_time.R index 61639e029..0dce7a60c 100644 --- a/inst/shiny/modules/xfer_time.R +++ b/inst/shiny/modules/xfer_time.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_time.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# xfer_time_module_ui <- function(id) { ns <- shiny::NS(id) tagList( @@ -223,7 +246,7 @@ xfer_time_module_server <- function(input, output, session, common) { polyXf <- spp[[curSp()]]$procEnvs$bgExt logger %>% writeLog( hlSpp(curSp()), - 'Transferion extent equal to current extent region.') + 'Transfer extent equal to current extent region.') } # LOAD INTO SPP #### spp[[curSp()]]$transfer$xfExt <- polyXf @@ -252,7 +275,6 @@ xfer_time_module_server <- function(input, output, session, common) { 'resolutions >30 arc seconds.')) return() } - if(!all(names(envs()) %in% paste0('bio', sprintf("%02d", 1:19)))) { nonBios <- names(envs())[!names(envs()) %in% paste0('bio', sprintf("%02d", 1:19))] logger %>% @@ -262,6 +284,18 @@ xfer_time_module_server <- function(input, output, session, common) { "). You can not transfer to a New Time.") return() } + if(input$selTime == "") { + logger %>% writeLog(type = 'error', "Please select transfer time period.") + return() + } + if(input$selGCM == "") { + logger %>% writeLog(type = 'error', "Please select global circulation model.") + return() + } + if(input$selRCP == "") { + logger %>% writeLog(type = 'error', "Please select RCP.") + return() + } # DATA #### if (input$selTimeVar == 'worldclim') { @@ -310,11 +344,12 @@ xfer_time_module_server <- function(input, output, session, common) { # ERRORS #### # Check that the extents of raster and extent of transfer intersects - if (!rgeos::gIntersects(spp[[curSp()]]$transfer$xfExt, - methods::as(raster::extent(xferTimeEnvs), - 'SpatialPolygons'))) { + Xfer_sfc <- sf::st_as_sfc(spp[[curSp()]]$transfer$xfExt) #convert poly to sfc + xferTimeEnvs_sp <- methods::as(raster::extent(xferTimeEnvs),'SpatialPolygons') + xferTimeEnvs_sfc <- sf::st_as_sfc(xferTimeEnvs_sp) #convert xfer envs to sfc + if (!sf::st_intersects(Xfer_sfc, xferTimeEnvs_sfc, sparse = FALSE)[1,1]) { logger %>% - writeLog(type = 'error', 'Extents do not overlap') + writeLog(type = 'error', 'Extents do not overlap.') return() } @@ -359,13 +394,13 @@ xfer_time_module_server <- function(input, output, session, common) { } xferTimeThr <- xferTime > thr if (input$selTimeVar == 'worldclim') { - logger %>% writeLog(hlSpp(curSp()), "Transferion of model to ", paste0('20', input$selTime), + logger %>% writeLog(hlSpp(curSp()), "Transfer of model to ", paste0('20', input$selTime), ' with threshold ', input$threshold, ' (', formatC(thr, format = "e", 2), ") for GCM ", GCMlookup[input$selGCM], " under RCP ", as.numeric(input$selRCP)/10.0, ".") } else if (input$selTimeVar == 'ecoclimate') { - logger %>% writeLog(hlSpp(curSp()), "Transferion of model to ", input$xfScenario, + logger %>% writeLog(hlSpp(curSp()), "Transfer of model to ", input$xfScenario, ' with threshold ', input$threshold, ' (', formatC(thr, format = "e", 2), ") for GCM ", input$xfAOGCM, ".") @@ -373,11 +408,11 @@ xfer_time_module_server <- function(input, output, session, common) { } else { xferTimeThr <- xferTime if (input$selTimeVar == 'worldclim') { - logger %>% writeLog(hlSpp(curSp()), "Transferion of model to ", paste0('20', input$selTime), + logger %>% writeLog(hlSpp(curSp()), "Transfer of model to ", paste0('20', input$selTime), ' with ', predType, " output for GCM ", GCMlookup[input$selGCM], " under RCP ", as.numeric(input$selRCP)/10.0, ".") } else if (input$selTimeVar == 'ecoclimate') { - logger %>% writeLog(hlSpp(curSp()), "Transferion of model to ", input$xfScenario, + logger %>% writeLog(hlSpp(curSp()), "Transfer of model to ", input$xfScenario, ' with ', predType, " output for GCM ", input$xfAOGCM, ".") } } @@ -476,7 +511,7 @@ xfer_time_module_server <- function(input, output, session, common) { common$update_component(tab = "Map") }) - # Reset Transferion Extent button functionality + # Reset Transfer Extent button functionality observeEvent(input$goResetXfer, { spp[[curSp()]]$polyXfXY <- NULL spp[[curSp()]]$polyXfID <- NULL diff --git a/inst/shiny/modules/xfer_time.md b/inst/shiny/modules/xfer_time.md index 8496e8edd..06ab41442 100644 --- a/inst/shiny/modules/xfer_time.md +++ b/inst/shiny/modules/xfer_time.md @@ -4,7 +4,7 @@ In simple terms, applying or “transferring” a niche/distributional model to a region or time period different from the ones used to make the model involves making a prediction based on the model and the new values of the predictor variables. In reality, however, researchers should be cognizant of many possible pitfalls, including non-analog conditions (e.g., requiring extrapolation in environmental space; see **Component: Build and Evaluate Niche Model**) and heterogeneity in the effects of species interactions (Fitzpatrick and Hargrove 2009; Anderson 2013). -To predict to different times, datasets describing environmental variables in these times are needed. Global circulation models (GCMs) provide estimates for climate for both the past and future. Various GCMs may have disparate estimates because they are based on different assumptions. Wallace currently uses future climate data for 2050 and 2070 from the IPCC fifth assessment report (AR5) climate projections based on the user’s selection of WorldClim or ecoClimate source variables. The four Representative Concentration Pathways (RCPs) available (RCP2.6, RCP4.5, RCP6.0, and RCP8.5) span a range of climate change scenarios from different greenhouse gas emission outcomes. More information on climate change models can be found here(Hausfather 2019). +To predict to different times, datasets describing environmental variables in these times are needed. Global circulation models (GCMs) provide estimates for climate for both the past and future. Various GCMs may have disparate estimates because they are based on different assumptions. Wallace currently uses future climate data for 2050 and 2070 from the IPCC fifth assessment report (AR5) climate projections based on the user’s selection of WorldClim or ecoClimate source variables. The four Representative Concentration Pathways (RCPs) available (RCP2.6, RCP4.5, RCP6.0, and RCP8.5) span a range of climate change scenarios from different greenhouse gas emission outcomes. More information on climate change models can be found here (Hausfather 2019). NOTE: The IPCC sixth assessment report replaced the use of RCPs with Shared Socioeconomic Pathways (SSPs). The user should note that Wallace uses the terminology associated with AR5, but future versions, as well as other source material, may mention SSPs. @@ -22,13 +22,13 @@ Users may choose a thresholding rule to convert the continuous prediction to a b **REFERENCES** -Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. https://doi.org/10.1111/nyas.12264 +Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. DOI: 10.1111/nyas.12264 -Fitzpatrick, M.C., & Hargrove, W.W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. https://doi.org/10.1007/s10531-009-9584-8 +Fitzpatrick, M.C., & Hargrove, W.W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. DOI: 10.1007/s10531-009-9584-8 -Hausfather, Z. (2019). CMIP6: the next generation of climate models explained. CarbonBrief. https://www.carbonbrief.org/cmip6-the-next-generation-of-climate-models-explained +Hausfather, Z. (2019). CMIP6: the next generation of climate models explained. CarbonBrief. www.carbonbrief.org -Hijmans, R.J., Phillips, S., Leathwick, J., & Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. https://CRAN.R-project.org/package=dismo +Hijmans, R.J., Phillips, S., Leathwick, J., & Elith, J. (2020). dismo: Species Distribution Modeling. R package version 1.3-3. CRAN -Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 https://CRAN.R-project.org/package=ENMeval +Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 CRAN diff --git a/inst/shiny/modules/xfer_time.yml b/inst/shiny/modules/xfer_time.yml index d1bd57972..9408ed7c7 100644 --- a/inst/shiny/modules/xfer_time.yml +++ b/inst/shiny/modules/xfer_time.yml @@ -1,5 +1,5 @@ component: "xfer" short_name: "Transfer to New Time" long_name: "Transfer to New Time" -authors: "Jamie M. Kass, Bruno Vilela, Gonzalo E. Pinilla-Buitrago, Robert P. Anderson" +authors: "Jamie M. Kass, Bruno Vilela, Gonzalo E. Pinilla-Buitrago, Bethany A. Johnson, Robert P. Anderson" package: [dismo] diff --git a/inst/shiny/modules/xfer_user.R b/inst/shiny/modules/xfer_user.R index 00fd9e3cd..47eae8234 100644 --- a/inst/shiny/modules/xfer_user.R +++ b/inst/shiny/modules/xfer_user.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# xfer_user.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# xfer_user_module_ui <- function(id) { ns <- shiny::NS(id) tagList( @@ -227,11 +250,12 @@ xfer_user_module_server <- function(input, output, session, common) { # ERRORS #### # Check that the extents of raster and extent of transfer intersects - if (!rgeos::gIntersects(spp[[curSp()]]$transfer$xfExt, - methods::as(raster::extent(userXferEnvs), - 'SpatialPolygons'))) { + Xfer_sfc <- sf::st_as_sfc(spp[[curSp()]]$transfer$xfExt) #convert poly to sfc + userXferEnvs_sp <- methods::as(raster::extent(userXferEnvs),'SpatialPolygons') + userXferEnvs_sfc <- sf::st_as_sfc(userXferEnvs_sp) #convert user envs to sfc + if (!sf::st_intersects(Xfer_sfc, userXferEnvs_sfc, sparse = FALSE)[1,1]) { logger %>% - writeLog(type = 'error', 'Extents do not overlap') + writeLog(type = 'error', 'Extents do not overlap.') return() } diff --git a/inst/shiny/modules/xfer_user.md b/inst/shiny/modules/xfer_user.md index 33e320fff..ff0c7ecaf 100644 --- a/inst/shiny/modules/xfer_user.md +++ b/inst/shiny/modules/xfer_user.md @@ -16,9 +16,9 @@ Users also may choose a thresholding rule to convert the continuous prediction t **REFERENCES** -Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. https://doi.org/10.1111/nyas.12264 +Anderson, R.P. (2013). A framework for using niche models to estimate impacts of climate change on species distributions. Annals of the New York Academy of Sciences, 1297(1), 8-28. DOI: 10.1111/nyas.12264 -Fitzpatrick, M.C., & Hargrove, W.W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. https://doi.org/10.1007/s10531-009-9584-8 +Fitzpatrick, M.C., & Hargrove, W.W. (2009). The projection of species distribution models and the problem of non-analog climate. Biodiversity and Conservation, 18, 2255. DOI: 10.1007/s10531-009-9584-8 -Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 https://CRAN.R-project.org/package=ENMeval +Kass, J., Muscarella, R., Galante, P.J., Bohl, C.L., Pinilla-Buitrago, G.E., Boria, R.A., Soley-Guardia, M., & Anderson, R.P. (2021). ENMeval: Automated Tuning and Evaluations of Ecological Niche Models. R package version 2.0 CRAN diff --git a/inst/shiny/modules/xfer_user.yml b/inst/shiny/modules/xfer_user.yml index e0b6c7c96..c6e7017a8 100644 --- a/inst/shiny/modules/xfer_user.yml +++ b/inst/shiny/modules/xfer_user.yml @@ -1,5 +1,5 @@ component: "xfer" short_name: "Transfer to User Environments" long_name: "Transfer to User Environments" -authors: "Gonzalo E. Pinilla-Buitrago, Jamie M. Kass, Robert P. Anderson" +authors: "Gonzalo E. Pinilla-Buitrago, Jamie M. Kass, Bethany A. Johnson, Robert P. Anderson" package: [dismo] diff --git a/inst/shiny/server.R b/inst/shiny/server.R index eb72bc644..985f9c1a6 100644 --- a/inst/shiny/server.R +++ b/inst/shiny/server.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# server.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# function(input, output, session) { ########################## # # REACTIVE VALUES LISTS #### @@ -453,11 +476,11 @@ function(input, output, session) { on.exit(setwd(owd)) n <- curSp() - rgdal::writeOGR(obj = bgExt(), + sf::st_write(obj = sf::st_as_sf(bgExt()), dsn = tmpdir, layer = paste0(n, '_bgShp'), driver = "ESRI Shapefile", - overwrite_layer = TRUE) + append = FALSE) exts <- c('dbf', 'shp', 'shx') fs <- paste0(n, '_bgShp.', exts) @@ -578,8 +601,8 @@ function(input, output, session) { mSp <- curSp() } req(spp[[mSp]]$occDens) - ecospat::ecospat.plot.niche(spp[[mSp]]$occDens[[sp1]], title = spName(sp1)) - ecospat::ecospat.plot.niche(spp[[mSp]]$occDens[[sp2]], title = spName(sp2)) + ecospat.plot.nicheDEV(spp[[mSp]]$occDens[[sp1]], title = spName(sp1)) + ecospat.plot.nicheDEV(spp[[mSp]]$occDens[[sp2]], title = spName(sp2)) dev.off() } ) @@ -828,7 +851,7 @@ function(input, output, session) { tmpdir <- tempdir() owd <- setwd(tmpdir) on.exit(setwd(owd)) - if(require(rgdal)) { + if(require(sf)) { if (input$predFileType == 'png') { req(mapPred()) if (!webshot::is_phantomjs_installed()) { @@ -899,7 +922,7 @@ function(input, output, session) { } } else { logger %>% - writeLog("Please install the rgdal package before downloading rasters.") + writeLog("Please install the sf package before downloading rasters.") } } ) @@ -923,11 +946,11 @@ function(input, output, session) { owd <- setwd(tmpdir) on.exit(setwd(owd)) n <- curSp() - rgdal::writeOGR(obj = spp[[curSp()]]$transfer$xfExt, + sf::st_write(obj = sf::st_as_sf(spp[[curSp()]]$transfer$xfExt), dsn = tmpdir, layer = paste0(n, '_xferShp'), driver = "ESRI Shapefile", - overwrite_layer = TRUE) + append = FALSE) exts <- c('dbf', 'shp', 'shx') fs <- paste0(n, '_xferShp.', exts) @@ -981,7 +1004,7 @@ function(input, output, session) { tmpdir <- tempdir() owd <- setwd(tmpdir) on.exit(setwd(owd)) - if(require(rgdal)) { + if(require(sf)) { if (input$xferFileType == 'png') { req(mapXfer()) if (!webshot::is_phantomjs_installed()) { @@ -1054,7 +1077,7 @@ function(input, output, session) { file.rename(r@file@name, file) } } else { - logger %>% writeLog("Please install the rgdal package before downloading rasters.") + logger %>% writeLog("Please install the sf package before downloading rasters.") } } ) @@ -1070,7 +1093,7 @@ function(input, output, session) { tmpdir <- tempdir() owd <- setwd(tmpdir) on.exit(setwd(owd)) - if(require(rgdal)) { + if(require(sf)) { req(spp[[curSp()]]$transfer$mess, spp[[curSp()]]$transfer$xfExt) mess <- spp[[curSp()]]$transfer$mess if (input$messFileType == 'png') { @@ -1137,7 +1160,7 @@ function(input, output, session) { file.rename(r@file@name, file) } } else { - logger %>% writeLog("Please install the rgdal package before downloading rasters.") + logger %>% writeLog("Please install the sf package before downloading rasters.") } } ) @@ -1173,7 +1196,7 @@ function(input, output, session) { paste0(curSp(), '_mask.', ext) }, content = function(file) { - if (require(rgdal)) { + if (require(sf)) { req(spp[[curSp()]]$mask$prediction) maskRaster <- spp[[curSp()]]$mask$prediction maskValues <- terra::spatSample(x = terra::rast(maskRaster), @@ -1234,7 +1257,7 @@ function(input, output, session) { } } else { logger %>% - writeLog("Please install the rgdal package before downloading rasters.") + writeLog("Please install the sf package before downloading rasters.") } } ) @@ -1251,11 +1274,11 @@ function(input, output, session) { c(args = lapply(seq_along(spp[[curSp()]]$mask$expertPoly), function(i){spp[[curSp()]]$mask$expertPoly[i][[1]]}), makeUniqueIDs = TRUE)) - rgdal::writeOGR(obj = expertPolys, + sf::st_write(obj = sf::st_as_sf(expertPolys), dsn = tmpdir, layer = paste0(n, '_maskExpShp'), driver = "ESRI Shapefile", - overwrite_layer = TRUE) + append = FALSE) exts <- c('dbf', 'shp', 'shx') fs <- paste0(n, '_maskExpShp.', exts) zip::zipr(zipfile = file, files = fs) @@ -1305,7 +1328,7 @@ function(input, output, session) { paste0(curSp(), "_AOO", '.', ext) }, content = function(file) { - if(require(rgdal)) { + if(require(sf)) { if (input$AOOFileType == 'png') { if (!webshot::is_phantomjs_installed()) { logger %>% @@ -1358,7 +1381,7 @@ function(input, output, session) { file.rename(r@file@name, file) } } else { - logger %>% writeLog("Please install the rgdal package before downloading rasters.") + logger %>% writeLog("Please install the sf package before downloading rasters.") } } ) @@ -1370,7 +1393,7 @@ function(input, output, session) { paste0(curSp(), "_overlap", '.', ext) }, content = function(file) { - if(require(rgdal)) { + if(require(sf)) { if (input$OverlapFileType == 'png') { if (!webshot::is_phantomjs_installed()) { logger %>% @@ -1404,7 +1427,7 @@ function(input, output, session) { if (file.exists(paste0(file, ".zip"))) {file.rename(paste0(file, ".zip"), file)} } } else { - logger %>% writeLog("Please install the rgdal package before downloading rasters.") + logger %>% writeLog("Please install the sf package before downloading rasters.") } } ) @@ -1463,7 +1486,7 @@ function(input, output, session) { paste0("richness", '.', ext) }, content = function(file) { - if(require(rgdal)) { + if(require(sf)) { if (input$richFileType == 'png') { if (!webshot::is_phantomjs_installed()) { logger %>% @@ -1506,7 +1529,7 @@ function(input, output, session) { file.rename(r@file@name, file) } } else { - logger %>% writeLog("Please install the rgdal package before downloading rasters.") + logger %>% writeLog("Please install the sf package before downloading rasters.") } } ) @@ -1521,7 +1544,7 @@ function(input, output, session) { }, content = function(file) { - if(require(rgdal)) { + if(require(sf)) { if (input$endFileType == 'png') { if (!webshot::is_phantomjs_installed()) { logger %>% @@ -1567,7 +1590,7 @@ function(input, output, session) { file.rename(r@file@name, file) } } else { - logger %>% writeLog("Please install the rgdal package before downloading rasters.") + logger %>% writeLog("Please install the sf package before downloading rasters.") } } ) diff --git a/inst/shiny/ui.R b/inst/shiny/ui.R index 4da3e9065..133613692 100644 --- a/inst/shiny/ui.R +++ b/inst/shiny/ui.R @@ -1,3 +1,26 @@ +# Wallace EcoMod: a flexible platform for reproducible modeling of +# species niches and distributions. +# +# ui.R +# File author: Wallace EcoMod Dev Team. 2023. +# -------------------------------------------------------------------------- +# This file is part of the Wallace EcoMod application +# (hereafter “Wallace”). +# +# Wallace is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# Wallace is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Wallace. If not, see . +# -------------------------------------------------------------------------- +# resourcePath <- system.file("shiny", "www", package = "wallace") shiny::addResourcePath("wallaceres", resourcePath) diff --git a/inst/shiny/www/img/beth.png b/inst/shiny/www/img/beth.png new file mode 100644 index 000000000..9232f936b Binary files /dev/null and b/inst/shiny/www/img/beth.png differ diff --git a/man/ecospat.plot.nicheDEV.Rd b/man/ecospat.plot.nicheDEV.Rd new file mode 100644 index 000000000..dd6470efd --- /dev/null +++ b/man/ecospat.plot.nicheDEV.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helper_functions.R +\name{ecospat.plot.nicheDEV} +\alias{ecospat.plot.nicheDEV} +\title{ecospat.plot.nicheDEV} +\usage{ +ecospat.plot.nicheDEV( + z, + title = "", + name.axis1 = "Axis 1", + name.axis2 = "Axis 2", + cor = FALSE +) +} +\arguments{ +\item{z}{A gridclim object for the species distribution created by ecospat.grid.clim.dyn()/espace_occDens().} + +\item{title}{A title for the plot.} + +\item{name.axis1}{A label for the first axis.} + +\item{name.axis2}{A label for the second axis.} + +\item{cor}{Correct the occurrence densities of the species by the prevalence of the environments in its range (TRUE = yes, FALSE = no).} +} +\description{ +For internal use. Plot occ density +} +\keyword{internal} diff --git a/man/envs_ecoClimate.Rd b/man/envs_ecoClimate.Rd index 9fe841db2..5e1d34479 100644 --- a/man/envs_ecoClimate.Rd +++ b/man/envs_ecoClimate.Rd @@ -49,5 +49,5 @@ Sara Varela Jamie M. Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/envs_userEnvs.Rd b/man/envs_userEnvs.Rd index 23e7c78f0..e5a395f9a 100644 --- a/man/envs_userEnvs.Rd +++ b/man/envs_userEnvs.Rd @@ -45,5 +45,5 @@ userEnvs <- envs_userEnvs(rasPath = pathRast, rasName = nameRast) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/envs_worldclim.Rd b/man/envs_worldclim.Rd index b94c068b2..fcc5e7b10 100644 --- a/man/envs_worldclim.Rd +++ b/man/envs_worldclim.Rd @@ -50,5 +50,5 @@ arcmin10 <- envs_worldclim(bcRes, bcSel = envar) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/espace_nicheOv.Rd b/man/espace_nicheOv.Rd index aca88242e..6e905998c 100644 --- a/man/espace_nicheOv.Rd +++ b/man/espace_nicheOv.Rd @@ -30,7 +30,7 @@ shiny, otherwise leave the default NULL.} } \value{ A list of 4 elements if all is set to TRUE. Elements are overlap - (Schoener's D), USE (ecopstat.niche.dyn.index), equiv and simil. + (Schoener's D), USE (ecospat.niche.dyn.index), equiv and simil. } \description{ Function evaluates niche overlap between the two species for diff --git a/man/espace_occDens.Rd b/man/espace_occDens.Rd index 31e504446..e686cd2ba 100644 --- a/man/espace_occDens.Rd +++ b/man/espace_occDens.Rd @@ -19,7 +19,7 @@ shiny, otherwise leave the default NULL.} } \value{ Returns a list of 2 lists (one for each species). Each list is an - ecospat noche object that contains 10 species specific slots with + ecospat niche object that contains 10 species specific slots with information outputed by ecospat::grid.clim.dyn. z.uncor is the density of occurrence of the species and z.cor the occupancy of the environment by the species. It has the input parameters as individual slots. diff --git a/man/model_bioclim.Rd b/man/model_bioclim.Rd index e59963f3b..960fabd7a 100644 --- a/man/model_bioclim.Rd +++ b/man/model_bioclim.Rd @@ -59,5 +59,5 @@ m <- model_bioclim(occs, bg, partblock, envs) \author{ Jamie M. Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/model_maxent.Rd b/man/model_maxent.Rd index 47258591b..6a2e5ac47 100644 --- a/man/model_maxent.Rd +++ b/man/model_maxent.Rd @@ -103,5 +103,5 @@ m <- model_maxent(occs = occs, bg = bg, user.grp = partblock, \author{ Jamie M. Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/occs_paleoDb.Rd b/man/occs_paleoDb.Rd deleted file mode 100644 index 909a41ce2..000000000 --- a/man/occs_paleoDb.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/occs_paleoDb.R -\name{occs_paleoDb} -\alias{occs_paleoDb} -\title{`occs_paleoDb` query paleobioDB database} -\usage{ -occs_paleoDb(spName, occNum, timeInterval, logger = NULL) -} -\arguments{ -\item{spName}{character. Species name. For paleobioDb it returns records -associated with the specified taxonomic name, including any synonyms.} - -\item{occNum}{integer maximum number of records.} - -\item{timeInterval}{character currently a single timeInterval is allowed: -"Holocene" (Holocene).} - -\item{logger}{Stores all notification messages to be displayed in the -Log Window of Wallace GUI. Insert the logger reactive list here for -running in shiny, otherwise leave the default NULL} -} -\value{ -A list of 2 dataframes. First dataframe is the original downloaded - dataset, second dataframe without duplicates and with appropriate fields - for analyses. -} -\description{ -query paleobioDB database and returns the complete list of data, data with - coordinates, and data with no duplicates -} -\details{ -This function is called by the module occs_queryDb to query the paleobioDB - database for species occurrence records in the Holocene. It removes - records with duplicate coordinates, and selects some columns with fields - appropriate to studies in biogeography. -} -\examples{ -\dontrun{ -spName <- "Didelphis virginiana" -occNum <- 100 -timeInterval <- "Holocene" -occsPaleo <- occs_paleoDb(spName, occNum, timeInterval) -} -} -\author{ -Jamie Kass - -Gonzalo E. Pinilla-Buitrago - -Sara Varela -} diff --git a/man/occs_queryDb.Rd b/man/occs_queryDb.Rd index aeefc6cb4..8c0cbb675 100644 --- a/man/occs_queryDb.Rd +++ b/man/occs_queryDb.Rd @@ -67,7 +67,7 @@ occs_queryDb(spName = "Bassaricyon alleni", occDb = "gbif", occNum = 10) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago Hannah Owens diff --git a/man/occs_userOccs.Rd b/man/occs_userOccs.Rd index c022f3ed9..9c7303457 100644 --- a/man/occs_userOccs.Rd +++ b/man/occs_userOccs.Rd @@ -45,5 +45,5 @@ user.occs <- occs_userOccs(txtPath, txtName) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/part_partitionOccs.Rd b/man/part_partitionOccs.Rd index 3d22ca7e2..3e311bedd 100644 --- a/man/part_partitionOccs.Rd +++ b/man/part_partitionOccs.Rd @@ -82,7 +82,7 @@ partblock <- part_partitionOccs(occs, bg, method = 'rand', kfold = 4) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago Andrea Paz } diff --git a/man/penvs_bgExtent.Rd b/man/penvs_bgExtent.Rd index 35d6ef583..dae0893f9 100644 --- a/man/penvs_bgExtent.Rd +++ b/man/penvs_bgExtent.Rd @@ -24,7 +24,7 @@ shiny, otherwise leave the default NULL.} Obtain occurrence data. Used to obtain species name for logger messages.} } \value{ -A SpatialPolygonsDataFrame object that contains all occurrences from occs +A SpatialPolygons object that contains all occurrences from occs } \description{ This function generates a background area according to a user- @@ -51,5 +51,7 @@ bgExt <- penvs_bgExtent(occs, bgSel = 'bounding box', bgBuf = 0.5) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago + +Bethany A. Johnson } diff --git a/man/penvs_bgMask.Rd b/man/penvs_bgMask.Rd index ce8a060ae..24bf1664b 100644 --- a/man/penvs_bgMask.Rd +++ b/man/penvs_bgMask.Rd @@ -62,5 +62,5 @@ bgMask <- penvs_bgMask(occs, envs, bgExt) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/penvs_bgSample.Rd b/man/penvs_bgSample.Rd index 37856bb4a..3c2f8b068 100644 --- a/man/penvs_bgSample.Rd +++ b/man/penvs_bgSample.Rd @@ -66,5 +66,5 @@ bgsample <- penvs_bgSample(occs, bgMask, bgPtsNum = 1000) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/penvs_drawBgExtent.Rd b/man/penvs_drawBgExtent.Rd index b1000f621..80e84b6da 100644 --- a/man/penvs_drawBgExtent.Rd +++ b/man/penvs_drawBgExtent.Rd @@ -34,9 +34,9 @@ occs: Obtain occurrence data. Used to obtain species name for logger messages.} } \value{ -This functions returns a SpatialPolygonsDataFrame based on the user -specified coordinates (drawn on map). This SpatialPolygonsDataFrame may be -larger than specified if drawBgBuf > 0. The SpatialPolygonsDataFrame will +This functions returns a SpatialPolygons object based on the user +specified coordinates (drawn on map). This SpatialPolygons object may be +larger than specified if drawBgBuf > 0. The SpatialPolygons object will include all occurrences. } \description{ @@ -70,5 +70,7 @@ drawBgBf <- penvs_drawBgExtent(polyExtXY = expertDrawPoly, polyExtID = 1, \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago + +Bethany A. Johnson } diff --git a/man/penvs_userBgExtent.Rd b/man/penvs_userBgExtent.Rd index 22c9a4d64..1de10e7a4 100644 --- a/man/penvs_userBgExtent.Rd +++ b/man/penvs_userBgExtent.Rd @@ -34,7 +34,7 @@ shiny, otherwise leave the default NULL.} } \value{ This function returns a SpatialPolygons object with the user - provided shape (+ a buffer is userBgBuf >0). The polygon will be at least + provided shape (+ a buffer if userBgBuf >0). The polygon will be at least large enough to contain all occurrences. } \description{ @@ -68,7 +68,9 @@ userBgbf <- penvs_userBgExtent(bgShp_path = pathShp, bgShp_name = nameShp, \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago Andrea Paz + +Bethany A. Johnson } diff --git a/man/poccs_removeByID.Rd b/man/poccs_removeByID.Rd index 9be416d0f..c61d4ee79 100644 --- a/man/poccs_removeByID.Rd +++ b/man/poccs_removeByID.Rd @@ -43,5 +43,5 @@ out.ID <- poccs_removeByID(occs, 11) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/poccs_selectOccs.Rd b/man/poccs_selectOccs.Rd index 40c3812ee..96f827a2a 100644 --- a/man/poccs_selectOccs.Rd +++ b/man/poccs_selectOccs.Rd @@ -55,5 +55,5 @@ out.occs <- poccs_selectOccs(occs, polySelXY = expertAddedPoly, \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/poccs_thinOccs.Rd b/man/poccs_thinOccs.Rd index 70d758be6..7ab1510d7 100644 --- a/man/poccs_thinOccs.Rd +++ b/man/poccs_thinOccs.Rd @@ -10,7 +10,7 @@ poccs_thinOccs(occs, thinDist, logger = NULL, spN = NULL) \item{occs}{data frame of cleaned occurrences obtained from component occs: Obtain occurrence data} -\item{thinDist}{distance in meters to be used for thinning. Number must be +\item{thinDist}{distance in kilometers to be used for thinning. Number must be positive.} \item{logger}{Stores all notification messages to be displayed in the Log @@ -48,5 +48,5 @@ out.thin <- poccs_thinOccs(occs = occs, thinDist = 30) \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/run_wallace.Rd b/man/run_wallace.Rd index 1a1a87e6a..90c5c9277 100644 --- a/man/run_wallace.Rd +++ b/man/run_wallace.Rd @@ -36,5 +36,5 @@ run_wallace() \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/vis_bioclimPlot.Rd b/man/vis_bioclimPlot.Rd index 84f0f3642..8bb4d8f30 100644 --- a/man/vis_bioclimPlot.Rd +++ b/man/vis_bioclimPlot.Rd @@ -63,5 +63,5 @@ bioclimPlot <- vis_bioclimPlot(x = m@models$bioclim, \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/xfer_area.Rd b/man/xfer_area.Rd index 027b6ac7e..476f9429f 100644 --- a/man/xfer_area.Rd +++ b/man/xfer_area.Rd @@ -98,5 +98,5 @@ Jamie Kass Andrea Paz -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/xfer_draw.Rd b/man/xfer_draw.Rd index 978e179e0..460debb8f 100644 --- a/man/xfer_draw.Rd +++ b/man/xfer_draw.Rd @@ -22,7 +22,7 @@ running in shiny, otherwise leave the default NULL} \item{spN}{character. Used to obtain species name for logger messages} } \value{ -This functions returns a SpatialPolygonsDataFrame based on the user +This functions returns a SpatialPolygons object based on the user specified coordinates (drawn on map). This SpatialPolygonsDataFrame may be larger than specified if drawBgBuf > 0. } @@ -53,5 +53,7 @@ polygonTest <- xfer_draw(polyXfXY = userDrawPoly, polyXfID, \code{\link{xfer_userEnvs}} } \author{ -Gonzalo Pinilla +Gonzalo Pinilla + +Bethany A. Johnson } diff --git a/man/xfer_mess.Rd b/man/xfer_mess.Rd index 945807cf8..681863777 100644 --- a/man/xfer_mess.Rd +++ b/man/xfer_mess.Rd @@ -67,5 +67,5 @@ xferMess <- xfer_mess(occs = occsEnvs, bg = bgEnvs, bgMsk = envs, \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/xfer_time.Rd b/man/xfer_time.Rd index d58b31434..07336a301 100644 --- a/man/xfer_time.Rd +++ b/man/xfer_time.Rd @@ -107,5 +107,5 @@ Jamie Kass Andrea Paz -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/xfer_userEnvs.Rd b/man/xfer_userEnvs.Rd index ea1fa3f6a..35a674807 100644 --- a/man/xfer_userEnvs.Rd +++ b/man/xfer_userEnvs.Rd @@ -92,5 +92,5 @@ Jamie Kass Andrea Paz -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago } diff --git a/man/xfer_userExtent.Rd b/man/xfer_userExtent.Rd index 3d7f725ee..d4266e8fc 100644 --- a/man/xfer_userExtent.Rd +++ b/man/xfer_userExtent.Rd @@ -54,7 +54,9 @@ xferUser <- xfer_userExtent(bgShp_path = pathShp, bgShp_name = nameShp, \author{ Jamie Kass -Gonzalo E. Pinilla-Buitrago +Gonzalo E. Pinilla-Buitrago Andrea Paz + +Bethany A. Johnson } diff --git a/tests/testthat/test_envs_userEnvs.R b/tests/testthat/test_envs_userEnvs.R index 11a40c301..f1c1efb7d 100755 --- a/tests/testthat/test_envs_userEnvs.R +++ b/tests/testthat/test_envs_userEnvs.R @@ -38,6 +38,7 @@ userEnvs_stack <- envs_userEnvs(rasPath = Path, rasName = Name, # 'guidance text in this module for more details.'), # fixed = TRUE) # }) +# BAJ (2024-02-14) rgdal has been retired and removed. this test may be added back? ### test output features test_that("output type checks", { diff --git a/tests/testthat/test_envs_worldclim.R b/tests/testthat/test_envs_worldclim.R index ab946f707..cee97849d 100755 --- a/tests/testthat/test_envs_worldclim.R +++ b/tests/testthat/test_envs_worldclim.R @@ -9,11 +9,13 @@ bcRes <- 10 # (10 arcmin) envar <- c('bio05', 'bio06', 'bio13', 'bio14') ### run function -arcmin10 <- envs_worldclim(bcRes, bcSel = envar) +arcmin10 <- try(envs_worldclim(bcRes, bcSel = envar), silent = TRUE) ### test if the error messages appear when they are supposed to test_that("error checks", { + # Skip if cannot download + skip_if(class(arcmin10) == "try-error") # the user has not selected a raster resolution expect_error(envs_worldclim(bcRes = '', bcSel = envar, doBrick = FALSE), 'Select a raster resolution.') @@ -23,6 +25,8 @@ test_that("error checks", { test_that("output type checks", { # skip on CRAN skip_on_cran() + # Skip if cannot download + skip_if(class(arcmin10) == "try-error") # the output is a RasterBrick expect_is(arcmin10, "RasterStack") # the number of layer is the same as specified in the selected variables list diff --git a/tests/testthat/test_espace_occDens.R b/tests/testthat/test_espace_occDens.R index e4719f155..6ed2b0e99 100644 --- a/tests/testthat/test_espace_occDens.R +++ b/tests/testthat/test_espace_occDens.R @@ -52,17 +52,17 @@ test_that("output checks", { ## Test that all outputs but x and y and inputs (including occupancy, density ## and weights) are all raster layers #sp1 - expect_is(TestOccDens[[sp.name1]]$z,'RasterLayer') - expect_is(TestOccDens[[sp.name1]]$Z,'RasterLayer') - expect_is(TestOccDens[[sp.name1]]$z.uncor,'RasterLayer') - expect_is(TestOccDens[[sp.name1]]$z.cor,'RasterLayer') - expect_is(TestOccDens[[sp.name1]]$w,'RasterLayer') + expect_is(TestOccDens[[sp.name1]]$z,'SpatRaster') + expect_is(TestOccDens[[sp.name1]]$Z,'SpatRaster') + expect_is(TestOccDens[[sp.name1]]$z.uncor,'SpatRaster') + expect_is(TestOccDens[[sp.name1]]$z.cor,'SpatRaster') + expect_is(TestOccDens[[sp.name1]]$w,'SpatRaster') #sp2 - expect_is(TestOccDens[[sp.name2]]$z,'RasterLayer') - expect_is(TestOccDens[[sp.name2]]$Z,'RasterLayer') - expect_is(TestOccDens[[sp.name2]]$z.uncor,'RasterLayer') - expect_is(TestOccDens[[sp.name2]]$z.cor,'RasterLayer') - expect_is(TestOccDens[[sp.name2]]$w,'RasterLayer') + expect_is(TestOccDens[[sp.name2]]$z,'SpatRaster') + expect_is(TestOccDens[[sp.name2]]$Z,'SpatRaster') + expect_is(TestOccDens[[sp.name2]]$z.uncor,'SpatRaster') + expect_is(TestOccDens[[sp.name2]]$z.cor,'SpatRaster') + expect_is(TestOccDens[[sp.name2]]$w,'SpatRaster') }) diff --git a/tests/testthat/test_occs_paleoDb.R b/tests/testthat/test_occs_paleoDb.R index 7ab326efc..354f4f18b 100644 --- a/tests/testthat/test_occs_paleoDb.R +++ b/tests/testthat/test_occs_paleoDb.R @@ -1,104 +1,104 @@ -#### COMPONENT occs: Obtain Occurrence Data -#### MODULE: Query Database (Past) -context("paleoDb") - -##Set parameters - -#species name -spName <- "Didelphis virginiana" -spNameError <- "Panthera onc" -genus <- "panthera" -#maximum number of occurrences to download -occNum <- 100 -# For PaleobioDB only Holocene is allowed. -timeInterval <- "Holocene" - -# run function if no Windows -if (Sys.info()['sysname'] != "Windows") { - occsPaleo <- occs_paleoDb(spName, occNum, timeInterval, logger = NULL) -} - - -###Test that errors check - ### test if the error messages appear when they are supposed to -test_that("error checks", { - # paleobioDB failing in Windows - skip_on_os("windows") - # the user doesn't input any species name - expect_error(occs_paleoDb( occNum, occNum, timeInterval), - 'Please input both genus and species names of ONE species.', - fixed = TRUE) - # the user inputs just one name (genus or epithet) - expect_error(occs_paleoDb(spName = genus,occNum, timeInterval), - 'Please input both genus and species names of ONE species.', - fixed = TRUE) - # the species' name has spelling errors, or it is not found in the database - expect_error(occs_paleoDb(spName = spNameError, occNum, timeInterval), - paste0(hlSpp(spNameError), - "No records found, please check the spelling."), - fixed = TRUE) -}) - -###Test of warnings: -##Function has one warning for records without coordinates, this is forbidden by -##the database -##thus making the case impossible. If it was possible it would look like this: -# test_that("warnings checks", { -# # the species is found in the database, but it does not have coordinates (Log & lat) -# expect_warning(occs_paleoDb(spName = "impossible species", occNum = 1, -# timeInterval), -# paste0(hlSpp("impossible species"), -# "No records with coordinates found in paleobioDB."), +# #### COMPONENT occs: Obtain Occurrence Data +# #### MODULE: Query Database (Past) +# context("paleoDb") +# +# ##Set parameters +# +# #species name +# spName <- "Didelphis virginiana" +# spNameError <- "Panthera onc" +# genus <- "panthera" +# #maximum number of occurrences to download +# occNum <- 100 +# # For PaleobioDB only Holocene is allowed. +# timeInterval <- "Holocene" +# +# # run function if no Windows +# if (Sys.info()['sysname'] != "Windows") { +# occsPaleo <- occs_paleoDb(spName, occNum, timeInterval, logger = NULL) +# } +# +# +# ###Test that errors check +# ### test if the error messages appear when they are supposed to +# test_that("error checks", { +# # paleobioDB failing in Windows +# skip_on_os("windows") +# # the user doesn't input any species name +# expect_error(occs_paleoDb( occNum, occNum, timeInterval), +# 'Please input both genus and species names of ONE species.', # fixed = TRUE) +# # the user inputs just one name (genus or epithet) +# expect_error(occs_paleoDb(spName = genus,occNum, timeInterval), +# 'Please input both genus and species names of ONE species.', +# fixed = TRUE) +# # the species' name has spelling errors, or it is not found in the database +# expect_error(occs_paleoDb(spName = spNameError, occNum, timeInterval), +# paste0(hlSpp(spNameError), +# "No records found, please check the spelling."), +# fixed = TRUE) +# }) +# +# ###Test of warnings: +# ##Function has one warning for records without coordinates, this is forbidden by +# ##the database +# ##thus making the case impossible. If it was possible it would look like this: +# # test_that("warnings checks", { +# # # the species is found in the database, but it does not have coordinates (Log & lat) +# # expect_warning(occs_paleoDb(spName = "impossible species", occNum = 1, +# # timeInterval), +# # paste0(hlSpp("impossible species"), +# # "No records with coordinates found in paleobioDB."), +# # fixed = TRUE) +# # }) +# +# # test output features +# test_that("output type checks", { +# # paleobioDB failing in Windows +# skip_on_os("windows") +# # skip on CRAN +# skip_on_cran() +# #output is a list +# expect_is(occsPaleo, "list") +# #List has two elements +# expect_equal(length(occsPaleo), 2) +# }) +# test_that("output data checks", { +# # paleobioDB failing in Windows +# skip_on_os("windows") +# # skip on CRAN +# skip_on_cran() +# # if the original database has records without coordinates OR duplicates: +# if ((TRUE %in% duplicated(occsPaleo$orig[,c('longitude','latitude')]) == TRUE) | +# (NA %in% occsPaleo$orig[,c('longitude','latitude')]) == TRUE){ +# # the cleaned table must have fewer records than the original one +# expect_true((nrow(occsPaleo$orig)) > (nrow(occsPaleo$cleaned))) +# } else { # if not, +# # both tables should have the same number of records +# expect_true((nrow(occsPaleo$orig)) == (nrow(occsPaleo$cleaned))) +# } +# # there are not "NA" values in longitude OR latitude columns in the cleaned table +# expect_false(NA %in% occsPaleo$cleaned$latitude) | +# (NA %in% occsPaleo$cleaned$longitude) +# # there are not duplicate values in longitude AND latitude columns in the cleaned table +# expect_false(TRUE %in% duplicated(occsPaleo$cleaned[, c('longitude','latitude')])) +# # downloaded species corresponds to queried species. T +# expect_match(unique(occsPaleo$cleaned$scientific_name), +# spName, ignore.case = TRUE, all = TRUE) +# }) +# ##Check headers for both original and cleaned tables +# keyPaleoHeaders <- c("occID", "scientific_name", "longitude", "latitude", +# # "early_interval", "late_interval", +# "country", "collection_no", "record_type", +# "early_age", "late_age") +# +# test_that("headers check", { +# # paleobioDB failing in Windows +# skip_on_os("windows") +# # +# expect_false('FALSE' %in% (keyPaleoHeaders %in% names(occsPaleo$orig))) +# # the headers in the cleaned table are the ones specified in the function +# expect_equal(names(occsPaleo$cleaned),c(keyPaleoHeaders,"pop")) # }) - -# test output features -test_that("output type checks", { - # paleobioDB failing in Windows - skip_on_os("windows") - # skip on CRAN - skip_on_cran() - #output is a list - expect_is(occsPaleo, "list") - #List has two elements - expect_equal(length(occsPaleo), 2) -}) -test_that("output data checks", { - # paleobioDB failing in Windows - skip_on_os("windows") - # skip on CRAN - skip_on_cran() - # if the original database has records without coordinates OR duplicates: - if ((TRUE %in% duplicated(occsPaleo$orig[,c('longitude','latitude')]) == TRUE) | - (NA %in% occsPaleo$orig[,c('longitude','latitude')]) == TRUE){ - # the cleaned table must have fewer records than the original one - expect_true((nrow(occsPaleo$orig)) > (nrow(occsPaleo$cleaned))) - } else { # if not, - # both tables should have the same number of records - expect_true((nrow(occsPaleo$orig)) == (nrow(occsPaleo$cleaned))) - } - # there are not "NA" values in longitude OR latitude columns in the cleaned table - expect_false(NA %in% occsPaleo$cleaned$latitude) | - (NA %in% occsPaleo$cleaned$longitude) - # there are not duplicate values in longitude AND latitude columns in the cleaned table - expect_false(TRUE %in% duplicated(occsPaleo$cleaned[, c('longitude','latitude')])) - # downloaded species corresponds to queried species. T - expect_match(unique(occsPaleo$cleaned$scientific_name), - spName, ignore.case = TRUE, all = TRUE) -}) -##Check headers for both original and cleaned tables -keyPaleoHeaders <- c("occID", "scientific_name", "longitude", "latitude", - # "early_interval", "late_interval", - "country", "collection_no", "record_type", - "early_age", "late_age") - -test_that("headers check", { - # paleobioDB failing in Windows - skip_on_os("windows") - # - expect_false('FALSE' %in% (keyPaleoHeaders %in% names(occsPaleo$orig))) - # the headers in the cleaned table are the ones specified in the function - expect_equal(names(occsPaleo$cleaned),c(keyPaleoHeaders,"pop")) -}) - - +# +# diff --git a/tests/testthat/test_penvs_bgExtent.R b/tests/testthat/test_penvs_bgExtent.R index c7b5b0cea..3496a9b74 100644 --- a/tests/testthat/test_penvs_bgExtent.R +++ b/tests/testthat/test_penvs_bgExtent.R @@ -45,15 +45,15 @@ test_that("error checks", { # buffer == 0 while using Point Buffers as background extent expect_error(penvs_bgExtent(occs , bgSel = bPoint, bgBuf = 0), - 'Change buffer distance to positive or negative value.') + 'Change buffer distance to a positive value.') }) ### test output features test_that("output type checks", { # the output is a SpatialPolygonsDataFrame - expect_is(bgExt1, "SpatialPolygonsDataFrame") - expect_is(bgExt2, "SpatialPolygonsDataFrame") - expect_is(bgExt3, "SpatialPolygonsDataFrame") + expect_is(bgExt1, "SpatialPolygons") + expect_is(bgExt2, "SpatialPolygons") + expect_is(bgExt3, "SpatialPolygons") # the area of each type of the background extents is different expect_false(raster::area(bgExt1) == raster::area(bgExt2)) expect_false(raster::area(bgExt1) == raster::area(bgExt3)) diff --git a/tests/testthat/test_penvs_drawBgExtent.R b/tests/testthat/test_penvs_drawBgExtent.R index 67d3f848a..f3a3033ba 100644 --- a/tests/testthat/test_penvs_drawBgExtent.R +++ b/tests/testthat/test_penvs_drawBgExtent.R @@ -50,8 +50,8 @@ test_that("error checks", { ### test output features test_that("output type checks", { # the output is a SpatialPolygons - expect_is(drawBgBf, "SpatialPolygonsDataFrame") - expect_is(drawBg, "SpatialPolygonsDataFrame") + expect_is(drawBgBf, "SpatialPolygons") + expect_is(drawBg, "SpatialPolygons") # the area of background buffered is different from the one not buffered expect_true(raster::area(drawBgBf) > raster::area(drawBg)) ## check if all the records are within the drawn polygon diff --git a/tests/testthat/test_xfer_draw.R b/tests/testthat/test_xfer_draw.R index 70f97a6b6..d5e59a12e 100644 --- a/tests/testthat/test_xfer_draw.R +++ b/tests/testthat/test_xfer_draw.R @@ -20,8 +20,8 @@ polygonTestZero <- xfer_draw(polyXfXY = userDrawPoly, polyXfID, test_that("output type checks", { # the drawn polygon does not include all localities - expect_is(polygonTest,'SpatialPolygonsDataFrame') - expect_is(polygonTestZero,'SpatialPolygonsDataFrame') + expect_is(polygonTest,'SpatialPolygons') + expect_is(polygonTestZero,'SpatialPolygons') ###the extent of the polygon for buffer = 0 corresponds to maximum provided expect_equal(sp::bbox(polygonTestZero)[1,1],min(longitude)) expect_equal(sp::bbox(polygonTestZero)[2,1],min(latitude)) diff --git a/vignettes/module-addition.Rmd b/vignettes/module-addition.Rmd index 5fa880bb8..412cb2ea3 100644 --- a/vignettes/module-addition.Rmd +++ b/vignettes/module-addition.Rmd @@ -1,6 +1,6 @@ --- title: "How to write a module in Wallace" -author: "Gonzalo Pinilla-Buitrago, Jamie M. Kass, Siew Fong Chen, Peter Galante, Bethany Johnson, Dean Attali" +author: "Gonzalo Pinilla-Buitrago, Jamie M. Kass, Siew Fong Chen, Peter Galante, Bethany A. Johnson, Dean Attali" date: "April 19, 2022" output: rmarkdown::html_vignette vignette: > diff --git a/vignettes/tutorial-v2-esp.Rmd b/vignettes/tutorial-v2-esp.Rmd index 7ec312d58..3427f3c18 100644 --- a/vignettes/tutorial-v2-esp.Rmd +++ b/vignettes/tutorial-v2-esp.Rmd @@ -2,7 +2,7 @@ title: "Tutorial de Wallace Aplicación de modelado Ecológico v2.0" author: - Bethany A. Johnson, Gonzalo E. Pinilla-Buitrago, Andrea Paz, Jamie M. Kass, Sarah I. Meenan, Robert P. Anderson -- Traducción al español por Andrea Paz y Bethany Johnson +- Traducción al español por Andrea Paz y Bethany A. Johnson date: "2023-03-11" output: rmarkdown::html_vignette vignette: > @@ -130,6 +130,7 @@ knitr::include_graphics("vignette_img/occs_1.png") ```{r, fig.align = 'center'} knitr::include_graphics("vignette_img/occs_2.png") ``` +*Nota: A partir del 01 September 2023, el módulo Query Database (Paleo) [Consultar base de datos (Paleo)], no estará disponible temporalmente.* Procedemos a obtener datos de ocurrencia. Usaremos ocurrencias del presente (en contraste con los del pasado obtenidos mediante datos fósiles, etc.) y por lo tanto usaremos el módulo: *Query Database (Present)*[Consultar base de datos (presente)]. Hay una selección de bases de datos para escoger, como también una opción para obtener solo las ocurrencias con información sobre la incertidumbre de las coordenadas (esto puede ser útil para filtrar más adelante). Si usted tiene un ID de usuario de GBIF, marcar la casilla "Include Data Source" [Incluir fuente de los datos] le permitirá iniciar sesión con su nombre de usuario y contraseña. Para que esto funcione, debe instalar el paquete de R occCite antes de ejecutar Wallace. Dado que `occCite` es un paquete sugerido, este no será instalado automáticamente como otras dependencias. diff --git a/vignettes/tutorial-v2.Rmd b/vignettes/tutorial-v2.Rmd index 17f07c79d..94d0275b8 100644 --- a/vignettes/tutorial-v2.Rmd +++ b/vignettes/tutorial-v2.Rmd @@ -49,7 +49,7 @@ If you use *Wallace* in your teaching, we would like to hear about your experien For `wallace` to work, you should be using R version 3.5.0 or later. Download for Windows or Mac. -To install and load *Wallace v2.0.4*, open either the `R` GUI or RStudio and run the code below. It's the only code you'll have to run to use `wallace`. +To install and load *Wallace v2.0.6*, open either the `R` GUI or RStudio and run the code below. It's the only code you'll have to run to use `wallace`. ```{r, eval = FALSE, echo = TRUE} # Install Wallace from CRAN @@ -103,7 +103,7 @@ knitr::include_graphics("vignette_img/orientation_2.png") (**2**) This is the toolbar with all the user interface controls, such as buttons, text inputs, etc. You can see that the module *Query Database (Present)* is currently selected. You'll see that two other modules exist for this component: *Query Database (Paleo)* and *User-specified*. This last module lets you upload your own occurrence data. Try choosing it instead and notice that the toolbar changes, then click back to *Query Database (Present)*.\ Both the **Component** and *Module* have question mark buttons (?) next to the title text. Clicking these will link to the respective guidance texts.\ Within this toolbar, you can find the module name and the `R` packages it uses (**2a**), as well as the control panel for the selected module (**2b**). Modules can be contributed by other researchers and the developers; CRAN links and documentation are at the bottom.\ -(**3**) The right side is the visualization space. Any functions performed will trigger a message in the log window (**3a**). This window will also display any error messages. *Wallace v2.0.4* now allows the user to load multiple species. If multiple species are loaded, toggle and select between species using the species drop-down menu (**3b**).\ +(**3**) The right side is the visualization space. Any functions performed will trigger a message in the log window (**3a**). This window will also display any error messages. *Wallace v2.0* now allows the user to load multiple species. If multiple species are loaded, toggle and select between species using the species drop-down menu (**3b**).\ The visualization space includes several tabs (**3c**), including an interactive map, occurrence records table, results window, model and component guidance text windows, and a tab for saving outputs and the current session.\ At this stage of the analysis, no results exist, and you have no data yet for the table, but you can view the **Component Guidance** and *Module Guidance* text now. This text was written by the developers to prepare users for each component and module *theoretically* (why we should use the tools) and *methodologically* (what the tools do). The guidance text also references scientific papers from the literature for more detailed reading. Please get into the habit of consulting these before undertaking analyses---and discussing them with your peers—-as this should give you a more solid foundation for moving forward.\ @@ -127,6 +127,7 @@ knitr::include_graphics("vignette_img/occs_1.png") ```{r, fig.align = 'center'} knitr::include_graphics("vignette_img/occs_2.png") ``` +*Note: As of 01 September 2023, Module: Query Database [Paleo] will be temporarily unavailable.* Let's proceed to get some occurrence data. We'll be using present occurrences (as opposed to those from the deep past via fossil data, etc.) and therefore use Module: *Query Database (Present)*. There is a selection of databases to choose from, as well as the option to return only those occurrences that contain information on coordinate uncertainty (which can be useful to filter by later). If you have a GBIF User ID, checking the "Include Data Source" box will allow you to log in with your username and password to download a DOI for the dataset. In order for this to work, you will need to install the R-package `occCite` prior to running Wallace. Since `occCite` is a suggested package, it will not install automatically like the other package dependencies.