From cbae9485845a02ce62674225db395501e84669b5 Mon Sep 17 00:00:00 2001 From: Francisco Rodriguez-Sanchez Date: Wed, 18 Feb 2026 17:01:55 +0100 Subject: [PATCH 1/3] delete old files --- .github/workflows/check-release.yaml | 35 -- .gitignore | 1 + DESCRIPTION | 2 +- README.Rmd | 2 + docs/404.html | 118 ------ docs/LICENSE.html | 285 ------------- ...mpleteness-of-the-recruitment-network.html | 258 ------------ docs/articles/The-RecruitNet-database.html | 156 ------- docs/articles/index.html | 91 ----- docs/authors.html | 127 ------ docs/bootstrap-toc.css | 60 --- docs/bootstrap-toc.js | 159 -------- docs/docsearch.css | 148 ------- docs/docsearch.js | 85 ---- docs/index.html | 203 --------- docs/link.svg | 12 - docs/news/index.html | 92 ----- docs/pkgdown.css | 384 ------------------ docs/pkgdown.js | 108 ----- docs/pkgdown.yml | 8 - docs/reference/CanopyCover.html | 104 ----- docs/reference/RN_to_matrix.html | 136 ------- docs/reference/RecruitNet.html | 104 ----- docs/reference/RecruitNetP-package.html | 107 ----- docs/reference/Rplot001.png | Bin 1011 -> 0 bytes docs/reference/comm_subset.html | 124 ------ docs/reference/comm_summary.html | 120 ------ docs/reference/comm_to_RN.html | 137 ------- docs/reference/download_RN.html | 127 ------ docs/reference/index.html | 126 ------ docs/reference/link_completeness.html | 142 ------- docs/reference/sign_net.html | 159 -------- docs/sitemap.xml | 60 --- 33 files changed, 4 insertions(+), 3776 deletions(-) delete mode 100644 .github/workflows/check-release.yaml delete mode 100644 docs/404.html delete mode 100644 docs/LICENSE.html delete mode 100644 docs/articles/Completeness-of-the-recruitment-network.html delete mode 100644 docs/articles/The-RecruitNet-database.html delete mode 100644 docs/articles/index.html delete mode 100644 docs/authors.html delete mode 100644 docs/bootstrap-toc.css delete mode 100644 docs/bootstrap-toc.js delete mode 100644 docs/docsearch.css delete mode 100644 docs/docsearch.js delete mode 100644 docs/index.html delete mode 100644 docs/link.svg delete mode 100644 docs/news/index.html delete mode 100644 docs/pkgdown.css delete mode 100644 docs/pkgdown.js delete mode 100644 docs/pkgdown.yml delete mode 100644 docs/reference/CanopyCover.html delete mode 100644 docs/reference/RN_to_matrix.html delete mode 100644 docs/reference/RecruitNet.html delete mode 100644 docs/reference/RecruitNetP-package.html delete mode 100644 docs/reference/Rplot001.png delete mode 100644 docs/reference/comm_subset.html delete mode 100644 docs/reference/comm_summary.html delete mode 100644 docs/reference/comm_to_RN.html delete mode 100644 docs/reference/download_RN.html delete mode 100644 docs/reference/index.html delete mode 100644 docs/reference/link_completeness.html delete mode 100644 docs/reference/sign_net.html delete mode 100644 docs/sitemap.xml diff --git a/.github/workflows/check-release.yaml b/.github/workflows/check-release.yaml deleted file mode 100644 index 7dc44bc..0000000 --- a/.github/workflows/check-release.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check - -permissions: read-all - -jobs: - R-CMD-check: - timeout-minutes: 10 - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.gitignore b/.gitignore index 565f2b6..9168bf8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .Rdata .httr-oauth .DS_Store +docs diff --git a/DESCRIPTION b/DESCRIPTION index ba97313..4e1576c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,7 +19,7 @@ License: GPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 -URL: https://github.com/EcologyR/RecruitNetP +URL: https://github.com/EcologyR/RecruitNetP, https://ecologyr.github.io/RecruitNetP/ BugReports: https://github.com/EcologyR/RecruitNetP/issues Depends: R (>= 4.1.0) diff --git a/README.Rmd b/README.Rmd index 8bc68fd..b1f010f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -22,6 +22,8 @@ knitr::opts_chunk$set( `r badger::badge_repostatus("WIP")` [![HitCount](https://hits.dwyl.com/EcologyR/RecruitNetP.svg?style=flat-square)](http://hits.dwyl.com/EcologyR/RecruitNetP) [![HitCount](https://hits.dwyl.com/EcologyR/RecruitNetP.svg?style=flat-square&show=unique)](http://hits.dwyl.com/EcologyR/RecruitNetP) +[![R-CMD-check](https://github.com/EcologyR/RecruitnetP/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/EcologyR/RecruitnetP/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/EcologyR/RecruitnetP/graph/badge.svg)](https://app.codecov.io/gh/EcologyR/RecruitnetP) The goal of RecruitNetP is to ... diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 029222a..0000000 --- a/docs/404.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - -Page not found (404) • RecruitNetP - - - - - - - - - - - -
-
- - - - -
-
- - -Content not found. Please use links in the navbar. - -
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.9.

-
- -
-
- - - - - - - - diff --git a/docs/LICENSE.html b/docs/LICENSE.html deleted file mode 100644 index 043519f..0000000 --- a/docs/LICENSE.html +++ /dev/null @@ -1,285 +0,0 @@ - -GNU General Public License • RecruitNetP - - -
-
- - - -
-
- - -
- -

Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

-

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.

-
-
- -

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.

-
<one line to give the program's name and a brief idea of what it does.>
-Copyright (C) <year>  <name of author>
-
-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 <http://www.gnu.org/licenses/>.
-

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:

-
<program>  Copyright (C) <year>  <name of author>
-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 <http://www.gnu.org/licenses/>.

-

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 <http://www.gnu.org/philosophy/why-not-lgpl.html>.

-
-
- -
- - - -
- - - -
- -
-

Site built with pkgdown 2.0.9.

-
- -
- - - - - - - - diff --git a/docs/articles/Completeness-of-the-recruitment-network.html b/docs/articles/Completeness-of-the-recruitment-network.html deleted file mode 100644 index c667b4d..0000000 --- a/docs/articles/Completeness-of-the-recruitment-network.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - -Completeness of the recruitment network • RecruitNetP - - - - - - - - - - - - -
-
- - - - -
-
- - - - - -
-

Is my RN representative of the “true” RN of the local -community? -

-

The basic parameters of a RN are its order (number of nodes: -S) and size (number of links: l). The ratio -of the size to the square of order is the connectance of the -network: \(C = l/S^2\) (proportion of -the maximum possible number of links that are actually realized). An -important preliminary step before the analysis of the RN is determining -to which extent our sampling provides a good approximation to estimate -these basic parameters for the “real” RN.

-

It is well known in community ecology that estimates of S -depend on sampling effort, and there is ample literature on how to -determine the completeness of the list of species sampled in a local -assemblage (see Chao et al. 2020 and references therein). The same -problem affects the estimation of the number of links that can take -place in a local assemblage. Even if we scan a locality inch by inch, -some interactions may not be realized within the scanned area just by -chance. Besides, the frequency of some interactions may be too low to be -detected with a limited sampling effort, and some canopy species may -pose difficulties to searching beneath them (e.g. those covered by -spines or thorns). The studies that have assessed the completeness of -ecological networks (Goldwasser and Roughgarden 1997, Nielsen and -Bascompte 2007, Rivera-Hutinel et al. 2012, Costa et al. 2016, -Vizentin-Bugoni et al. 2016, Pulgar et al. 2017, Henriksen et al 2019) -agree in that the level of sampling effort needed for a good coverage of -the links present in a network is much larger than the effort needed to -obtain a good coverage of the number of species in the local assemblage. -This implies that C may often be underestimated and that other -properties of the network can also be affected. Networks inferred with -insufficient or biased data will lead to biased or totally wrong -conclusions. This was a fundamental flaw in the early studies on food -webs that slowed down the development of this field (Pascual & Dunne -2006).

-

Analytical procedures developed to estimate species richness can be -adapted for the study of interactions in ecological networks, simply -treating each link as if it was a “species” and its frequency as -equivalent to species abundance (Chacoff et al. 2012, Jordano 2016, Chiu -et al. 2023). Particularly interesting is the adaptation for the study -of interaction networks made by Chiu et al. (2023) of the methods for -the analysis of completeness developed by Chao et al. (2014, 2020) based -in Hill’s numbers (q). In the context of ecological networks, -we are mostly interested in the Hill’s numbers of order 0 and 1 as -applied to species and interactions counts. Hill’s number of order 0 -(q0) estimated with the whole sample is simply the observed -number of species or links (q0obs). But the observed -number underestimates the real number, so we need an estimate of the -real q0est, which can be obtained using -non-parametric estimators (e.g, Chao1, Chao2, ACE or ICE). Using the -non-parametric estimate as reference, we can estimate the completeness -of q0 as \(^0^C = -q0~obs~/q0~est~\). In turn, Hill’s number of order 1 -(q1) is the exponential of Shannon’s index of -diversity. Differently from q0, q1 incorporates -information on the relative frequencies. The completeness of -q1 (1C) is most often referred -to as “coverage”, and indicates the proportion of the total number of -individuals of any species, or of events of any interaction, occurring -the real community that belong to species or links that have already -been sampled.

-

The counts to estimate the number of species or links can be obtained -by means of different sampling schemes but, in general, there are two -types of counting: abundance counts and incidence counts (a.k.a. -occurrence or presence counts) (Gotelli and Colwell 2001). Cases -(defined as independent individuals of any species or as occurrences of -any link in different sampling units) are randomly sampled from the -whole set of cases in the local assemblage. In abundance counts, the -cases are counted individually, as when counting the number of recruits -of each species in a plot. Incidence counts are used when individual -cases cannot be clearly distinguished to be counted (e.g. when counting -clonal plants or corals) or when they cannot be considered as -independent samples (e.g. multiple individual ants of the same species -falling in a pit-fall trap). In these cases, we count the number of -times each species or link is detected across multiple samples, and -these samples are considered as randomly chosen “replicates” of the -local community. When estimating species richness, incidence-based -estimates are less sensitive to the spatial aggregation of individuals -than abundance-based estimates (Chazdon et al. 1998, Colwell et -al. 2004, Chao et al. 2014).

-

Incidence data have another interesting advantage over abundance data -in the context of networks: when each sample is sufficiently large to be -considered as a replicate of the local community, the stability of -network descriptors against sampling effort can be estimated (Nielsen -and Bascompte 2007, Costa et al. 2016, Pulgar et al. 2017). Basically, -if we sample canopy-recruit interactions in N plots, we can use -the following process:

-
    -
  1. Build the partial RN of each of the N plots.
  2. -
  3. Combine the partial RNs of k (see explanation below) -randomly chosen pairs of plots, obtain their metric and calculate the -mean and 95%CL. This is the value with sampling effort -n=2.
  4. -
  5. Repeat the process for all the levels of sampling effort up to -n=N-2 plots.
  6. -
-

The metrics for sampling effort of n=1 plot and for -n=N-1 plots can only be based on N different -values (one for each of the N plots or one per each of the -N possible combination of N-1 plots). However, the -number of random combinations (k) of n = 2, 3 … -N-2 partial RNs can be much larger than N -(i.e. combinations of N partial RNs taken n at a -time). Therefore, to obtain comparable confidence intervals across -levels of sampling effort, k must be constant in all levels. -The value of k should not be too small so that the confidence -intervals are obtained for a large number of random combinations. For -example, with N=20 plots, there are 20 possible combinations of -1 (or of N-1) plots, 190 possible combinations of 2 (or of -N-2) plots and 1140 possible combinations of 3 (or of -N-3) plots. In this example, if we set k = 100, then -we could estimate the effect of sampling effort for n in the -range between 2 and 18 plots.

-

This procedure allows determining whether the value of each network -metric stabilizes within the sampling effort of the survey.

-

To address the quality of a dataset for the study of recruitment -networks, we will determine (1) the completeness -(0C) and coverage (1C) of the -number of species and links detected, and (2) the stability of network -metrics to sampling effort.

-
- -

The following analyses apply to data collected using the Recruitment -Network protocol described in Alcantara et al. (2019), which involves -partial RNs sampled in multiple plots. Accordingly, to obtain -completeness and coverage estimates for a recruitment network, we will -use iNEXT package (Hsieh et al. 2016) for incidence -data.

-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.9.

-
- -
-
- - - - - - - - diff --git a/docs/articles/The-RecruitNet-database.html b/docs/articles/The-RecruitNet-database.html deleted file mode 100644 index 074dda4..0000000 --- a/docs/articles/The-RecruitNet-database.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - -The RecruitNet database • RecruitNetP - - - - - - - - - - - - -
-
- - - - -
-
- - - - - -
-

Introduction to the RecruitNet database. -

-

The RecruitNet is a dataset containing information on plant-plant -recruitment interactions in 143 local plant communities (Study sites) -from 23 countries across five continents, including temperate and -tropical ecosystems. Each network provides information on the number of -individuals of every “recruit” species recruiting in the proximity of -every “canopy” species or away from other plants (in so called “open” -interspaces). The data set includes more than 850000 recruiting -individuals involved in 87924 different canopy-recruit pairs among 3186 -vascular plant species. The cover of canopy species and open ground is -also provided. It was published as a data paper by Verdu et -al. (2023)1 and can be downloaded from:

-

https://esajournals.onlinelibrary.wiley.com/doi/full/10.1002/ecy.3923

-

1Verdú, M., Garrido, J. L., Alcantara, J. M., -Montesinos‐Navarro, A., Aguilar, S., Aizen, M. A., … & Zamora, R. -(2023). RecruitNet: A global database of plant recruitment networks. -Ecology 104(2):e3923.

-

The objectives of this script are: (1) extracting from RecruitNet -database the information from one of the study sites, and (2) define the -optional data structures required for different analyses. Before -starting, it is always a good idea to familiarize with the contentes of -the dataset by reading the Metadata file provided with the paper.

-

The RecruitNet contains two “csv” files: -RecruitNet.csv, with the bulk of data for -canopy-recruit interactions, and CanopyCover.csv with -data on the cover of each species in each study site.

-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.9.

-
- -
-
- - - - - - - - diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index 26fc706..0000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,91 +0,0 @@ - -Articles • RecruitNetP - - -
-
- - - -
-
- - - -
-
- - -
- -
-

Site built with pkgdown 2.0.9.

-
- -
- - - - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 0ec12df..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,127 +0,0 @@ - -Authors and Citation • RecruitNetP - - -
-
- - - -
-
-
- - - -
  • -

    Alicia Montesinos-Navarro. Author, copyright holder. -

    -
  • -
  • -

    José Luis Garrido. Author, copyright holder. -

    -
  • -
  • -

    Miguel Verdú. Author, copyright holder. -

    -
  • -
  • -

    Julio M. Alcántara. Author, copyright holder. -

    -
  • -
  • -

    Francisco Rodriguez-Sanchez. Author, maintainer, copyright holder. -

    -
  • -
-
-
-

Citation

- Source: DESCRIPTION -
-
- - -

Montesinos-Navarro A, Garrido J, Verdú M, Alcántara J, Rodriguez-Sanchez F (2024). -RecruitNetP: Analysis of Recruitment Networks. -R package version 0.0.0.9000, https://github.com/EcologyR/RecruitNetP. -

-
@Manual{,
-  title = {RecruitNetP: Analysis of Recruitment Networks},
-  author = {Alicia Montesinos-Navarro and José Luis Garrido and Miguel Verdú and Julio M. Alcántara and Francisco Rodriguez-Sanchez},
-  year = {2024},
-  note = {R package version 0.0.0.9000},
-  url = {https://github.com/EcologyR/RecruitNetP},
-}
- -
- -
- - - -
- -
-

Site built with pkgdown 2.0.9.

-
- -
- - - - - - - - diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a85941..0000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573..0000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1..0000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504c..0000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index d4b1ac6..0000000 --- a/docs/index.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - -Analysis of Recruitment Networks • RecruitNetP - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    - - - -

    The goal of RecruitNetP is to …

    -
    -

    Installation -

    -
    -# install.packages("remotes")
    -remotes::install_github("EcologyR/RecruitNetP")
    -
    -
    -

    Example -

    -

    This is a basic example which shows you how to solve a common problem:

    -
    -
    -

    Citation -

    -

    If using this package, please cite it:

    -
    citation("RecruitNetP")
    -Warning in citation("RecruitNetP"): could not determine year for 'RecruitNetP'
    -from package DESCRIPTION file
    -To cite package 'RecruitNetP' in publications use:
    -
    -  Montesinos-Navarro A, Garrido J, Verdú M, Alcántara J,
    -  Rodriguez-Sanchez F (????). _RecruitNetP: Analysis of Recruitment
    -  Networks_. R package version 0.0.0.9000,
    -  <https://github.com/EcologyR/RecruitNetP>.
    -
    -A BibTeX entry for LaTeX users is
    -
    -  @Manual{,
    -    title = {RecruitNetP: Analysis of Recruitment Networks},
    -    author = {Alicia Montesinos-Navarro and José Luis Garrido and Miguel Verdú and Julio M. Alcántara and Francisco Rodriguez-Sanchez},
    -    note = {R package version 0.0.0.9000},
    -    url = {https://github.com/EcologyR/RecruitNetP},
    -  }
    -
    -
    -

    Funding -

    -

    The development of this software has been funded by Fondo Europeo de Desarrollo Regional (FEDER) and Consejería de Transformación Económica, Industria, Conocimiento y Universidades of Junta de Andalucía (proyecto US-1381388 led by Francisco Rodríguez Sánchez, Universidad de Sevilla).

    -

    -
    -
    -
    - - -
    - - -
    - -
    -

    -

    Site built with pkgdown 2.0.9.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/link.svg b/docs/link.svg deleted file mode 100644 index 88ad827..0000000 --- a/docs/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/docs/news/index.html b/docs/news/index.html deleted file mode 100644 index 5298a2f..0000000 --- a/docs/news/index.html +++ /dev/null @@ -1,92 +0,0 @@ - -Changelog • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    - -
    • Added a NEWS.md file to track changes to the package.
    • -
    -
    - - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 80ea5b8..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,384 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -/* Ensure in-page images don't run outside their container */ -.contents img { - max-width: 100%; - height: auto; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - display: none; - margin-left: 5px; - width: 20px; - height: 20px; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - display: inline-block; -} - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre, code, pre code { - background-color: #f8f8f8; - color: #333; -} -pre, pre code { - white-space: pre-wrap; - word-break: break-all; - overflow-wrap: break-word; -} - -pre { - border: 1px solid #eee; -} - -pre .img, pre .r-plt { - margin: 5px 0; -} - -pre .img img, pre .r-plt img { - background-color: #fff; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.error {font-weight: bolder;} -.warning {font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} - -/* Section anchors --------------------------------- - Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 -*/ - -div.csl-bib-body { } -div.csl-entry { - clear: both; -} -.hanging-indent div.csl-entry { - margin-left:2em; - text-indent:-2em; -} -div.csl-left-margin { - min-width:2em; - float:left; -} -div.csl-right-inline { - margin-left:2em; - padding-left:1em; -} -div.csl-indent { - margin-left: 2em; -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 6f0eee4..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,108 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $('.navbar-fixed-top').headroom(); - - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $("div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index 995aca8..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,8 +0,0 @@ -pandoc: 3.1.11 -pkgdown: 2.0.9 -pkgdown_sha: ~ -articles: - Completeness-of-the-recruitment-network: Completeness-of-the-recruitment-network.html - The-RecruitNet-database: The-RecruitNet-database.html -last_built: 2024-07-11T17:45Z - diff --git a/docs/reference/CanopyCover.html b/docs/reference/CanopyCover.html deleted file mode 100644 index 28dfe30..0000000 --- a/docs/reference/CanopyCover.html +++ /dev/null @@ -1,104 +0,0 @@ - -CanopyCover — CanopyCover • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    Canopy cover of plant-plant interactions global database

    -
    - -
    -
    CanopyCover
    -
    - -
    -

    Format

    -

    An object of class data.frame with 26812 rows and 7 columns.

    -
    -
    -

    Source

    -

    https://doi.org/10.1002/ecy.3923

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/RN_to_matrix.html b/docs/reference/RN_to_matrix.html deleted file mode 100644 index 11a69b0..0000000 --- a/docs/reference/RN_to_matrix.html +++ /dev/null @@ -1,136 +0,0 @@ - -Function RN_matrixForm — RN_to_matrix • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    For some analyses, the data must be stored as a matrix rather than data frame. -The next function takes a RN stored as data frame and transforms it into a matrix. -The output matrix can be used input for bipartite package.

    -
    - -
    -
    RN_to_matrix(RNdata = NULL, weight = NULL)
    -
    - -
    -

    Arguments

    -
    RNdata
    -

    A data frame generated with comm_subset() or a data.frame -containing columns with all the information needed for the basic analysis of -recruitment networks: canopy species (canopy), recruit species (recruit), -cover of the canopy (cj) and recruit (ci), -and columns with possible weighting variables.

    - - -
    weight
    -

    The name of the column of the data frame to be used as weight -variable for the links.

    - -
    -
    -

    Value

    - - -

    A matrix object with the species names as row (recruit species) and -column names (canopy species), and cells indicating the chosen weight for -each interaction. For example, the output of function local_RN provides the -number of recruits of species i interacting with canopy species j (fij), -the number of plots (i.e. incidence) where the interaction has been found (Tij), -and the binary presence/absence of the interaction in the whole study site (Pij). -Can be used as bipartite input.

    -
    - -
    -

    Examples

    -
    data(RecruitNet)
    -data(CanopyCover)
    -Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero")
    -Ventisquero_matrix <- RN_to_matrix(Ventisquero_RNc, weight = "fij")
    -Ventisquero_matrix <- RN_to_matrix(Ventisquero_RNc, weight = "Tij")
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/RecruitNet.html b/docs/reference/RecruitNet.html deleted file mode 100644 index e8e75e9..0000000 --- a/docs/reference/RecruitNet.html +++ /dev/null @@ -1,104 +0,0 @@ - -RecruitNet — RecruitNet • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    Plant-plant interactions global database

    -
    - -
    -
    RecruitNet
    -
    - -
    -

    Format

    -

    An object of class data.frame with 135210 rows and 26 columns.

    -
    -
    -

    Source

    -

    https://doi.org/10.1002/ecy.3923

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/RecruitNetP-package.html b/docs/reference/RecruitNetP-package.html deleted file mode 100644 index ad80df5..0000000 --- a/docs/reference/RecruitNetP-package.html +++ /dev/null @@ -1,107 +0,0 @@ - -RecruitNetP: Analysis of Recruitment Networks — RecruitNetP-package • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    Analyze recruitment networks and patterns of plant-plant interactions.

    -
    - - - -
    -

    Author

    -

    Maintainer: Francisco Rodriguez-Sanchez f.rodriguez.sanc@gmail.com (ORCID) [copyright holder]

    -

    Authors:

    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png deleted file mode 100644 index 17a358060aed2a86950757bbd25c6f92c08c458f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1011 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|=9Be?5+AI5}0x7m6Z+90U4Fo@(ch>_c&H|6f zVg?3oArNM~bhqvg0|WD9PZ!6KiaBo&GBN^{G%5UFpXcEKVvd5*5Eu=C0SJK)8A6*F U7`aXvEC5;V>FVdQ&MBb@00SN#Z2$lO diff --git a/docs/reference/comm_subset.html b/docs/reference/comm_subset.html deleted file mode 100644 index d703c53..0000000 --- a/docs/reference/comm_subset.html +++ /dev/null @@ -1,124 +0,0 @@ - -Subset sites — comm_subset • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    This function extracts the information of a given local community and -stores it in a separate data frame. It can also extract more than one site.

    -
    - -
    -
    comm_subset(dataset = NULL, site = NULL)
    -
    - -
    -

    Arguments

    -
    dataset
    -

    A data frame containing recruitment data.

    - - -
    site
    -

    character. Name of a study site within the dataset or -a character vector with the names of several study sites.

    - -
    -
    -

    Value

    - - -

    A data frame containing all the data from the desired community/ies

    -
    - -
    -

    Examples

    -
    data(RecruitNet)
    -
    -Ventisquero <- comm_subset(RecruitNet, site = "Ventisquero")
    -
    -TwoSites <- comm_subset(RecruitNet, c("Ventisquero","Agadir"))
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/comm_summary.html b/docs/reference/comm_summary.html deleted file mode 100644 index c48d2f7..0000000 --- a/docs/reference/comm_summary.html +++ /dev/null @@ -1,120 +0,0 @@ - -Summarise metadata of a community — comm_summary • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    This function provides a summary of the characteristics (i.e. metadata) of -a local community.

    -
    - -
    -
    comm_summary(dataset = NULL)
    -
    - -
    -

    Arguments

    -
    dataset
    -

    A data frame for a single site (or a group of sites). -For example, a data frame created with comm_subset(). This function relies on -the variable names used in the original RecruitNet database, so it cannot be used -with other datasets unless they follow exactly the ordering and the names used in RecruitNet.

    - -
    -
    -

    Value

    - - -

    A data frame with summary information of the local community/ies.

    -
    - -
    -

    Examples

    -
    All_sites_details <- comm_summary(RecruitNet)
    -Ventisquero <- comm_subset(RecruitNet, site = "Ventisquero")
    -Ventisquero_details <- comm_summary(Ventisquero)
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/comm_to_RN.html b/docs/reference/comm_to_RN.html deleted file mode 100644 index 2642ff1..0000000 --- a/docs/reference/comm_to_RN.html +++ /dev/null @@ -1,137 +0,0 @@ - -Merge cover data with interaction data for a given site — comm_to_RN • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    This function returns a data frame that merges the information from the -recruitment network and species cover for a local community. -It is a shortcut to directly obtain the data for a local community -from the RecruitNet dataset.

    -
    - -
    -
    comm_to_RN(RN_data = NULL, cover_data = NULL, site = NULL)
    -
    - -
    -

    Arguments

    -
    RN_data
    -

    data set where recruitment networks are stored. -Usually, it will be "RecruitNet" (or the name assigned to the dataset when it was imported).

    - - -
    cover_data
    -

    data set where cover data is stored. -Usually, it will be "CanopyCover" (or the name assigned to the dataset -"CanopyCover.csv" when it was imported).

    - - -
    site
    -

    name of the study site.

    - -
    -
    -

    Value

    - - -

    A data.frame containing 7 columns with all the information needed -for the basic analysis of recruitment networks and canopy-recruit interactions: -canopy species (Canopy), recruit species (Recruit), recruitment frequency (fij), -Tij = TODO, -Pij = TODO, -cover of the canopy (cj) and cover of the recruit (ci).

    -
    - -
    -

    Examples

    -
    data(RecruitNet)
    -data(CanopyCover)
    -Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero")
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/download_RN.html b/docs/reference/download_RN.html deleted file mode 100644 index 83889f6..0000000 --- a/docs/reference/download_RN.html +++ /dev/null @@ -1,127 +0,0 @@ - -Download RecruitNet database — download_RN • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    Download latest version of the RecruitNet database (Verdú et al. 2023, -doi:10.1002/ecy.3923 -).

    -
    - -
    -
    download_RN(path = getwd(), destfile = "RN.zip", unzip = TRUE)
    -
    - -
    -

    Arguments

    -
    path
    -

    character. Path to folder where the RecruitNet database should be saved.

    - - -
    destfile
    -

    character. Name of the zip file to be saved.

    - - -
    unzip
    -

    Logical. Uncompress the zip file? Default is TRUE.

    - -
    -
    -

    Value

    - - -

    A zip file or two CSV files, depending if unzip is TRUE.

    -
    - -
    -

    Examples

    -
    if (FALSE) { # interactive()
    -download_RN()
    -}
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 757e14a..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,126 +0,0 @@ - -Function reference • RecruitNetP - - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    CanopyCover

    -

    CanopyCover

    -

    RN_to_matrix()

    -

    Function RN_matrixForm

    -

    RecruitNet

    -

    RecruitNet

    -

    comm_subset()

    -

    Subset sites

    -

    comm_summary()

    -

    Summarise metadata of a community

    -

    comm_to_RN()

    -

    Merge cover data with interaction data for a given site

    -

    download_RN()

    -

    Download RecruitNet database

    -

    link_completeness()

    -

    Link_completeness

    -

    sign_net()

    -

    Association significance testing

    - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/link_completeness.html b/docs/reference/link_completeness.html deleted file mode 100644 index dd58df9..0000000 --- a/docs/reference/link_completeness.html +++ /dev/null @@ -1,142 +0,0 @@ - -Link_completeness — link_completeness • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    Observed and estimated number of links, and link completeness. -Methods based in Chao et al. (2014) as implemented in R package iNEXT.

    -
    - -
    -
    link_completeness(
    -  dataset = NULL,
    -  site = NULL,
    -  type = c("incidence", "abundance")
    -)
    -
    - -
    -

    Arguments

    -
    dataset
    -

    The name of the data set where recruitment networks are stored. -Usually, it will be "RecruitNet" (or the name assigned to the data set when -it was imported). At least, the data set must contain columns named -"Study_site", "Plot", "Canopy", "Recruit" and "Frequency". -In data sets containing a single site or a single plot, -the corresponding columns must be included anyway.

    - - -
    site
    -

    The name of a study site.

    - - -
    type
    -

    Can take two values: "incidence" or "abundance". -Estimates based on incidence data are recommended, but can only be obtained -if your data set is structured in multiple plots. Alternatively, for data -collected in a single plot, estimates can be based only on abundance data.

    - -
    -
    -

    Value

    - - -

    A data frame TODO

    -
    - -
    -

    Examples

    -
    if (FALSE) { # interactive()
    -
    -link_completeness(RecruitNet, "Ventisquero", "incidence")
    -link_completeness(RecruitNet, "Laxe", "abundance")
    -link_completeness(RecruitNet, "Laxe", "incidence") # Issues a warning
    -link_completeness(RecruitNet, "LosReyes", "abundance")
    -link_completeness(RecruitNet, "LosReyes", "incidence") #Issues an error
    -}
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/sign_net.html b/docs/reference/sign_net.html deleted file mode 100644 index c2a19ce..0000000 --- a/docs/reference/sign_net.html +++ /dev/null @@ -1,159 +0,0 @@ - -Association significance testing — sign_net • RecruitNetP - - -
    -
    - - - -
    -
    - - -
    -

    Generate a list with four elements, a data base with the significance tests -of association of each interaction (in rows) and three matrices of interaction -of positive, negative and neutral interactions, from a study site (for a single sites)

    -
    - -
    -
    sign_net(inter_data, cover_data, site, type)
    -
    - -
    -

    Arguments

    -
    inter_data
    -

    data frame with at least four columns: -Study_site (unique name of the study site), -Recruit (species of the recruit), -Canopy (species of the canopy, or "Open"), and -Frequency (number of recruits of that species observed under that canopy species -in any plot, with "Open" representing recruits observed without a canopy species).

    - - -
    cover_data
    -

    data frame with at least five columns: -Study_site (unique name of the study site), -Plot (unique name of each plot within a study site), -Canopy (species of the canopy), -Cover (percentage of cover of that species in that plot), and -Sampled_distance_or_area (total area of that plot or length in the case of transects).

    - - -
    site
    -

    is the name of the Study_site

    - - -
    type
    -

    is a character that identifies which hypothesis is being tested with three options:

    1. "by_pairwise_interaction": whether the number of recuits of each recruit species under each canopy species is significantly different from -the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively.

    2. -
    3. "by_recruit_sp": whether the number of recuits of each recruit species under any canopy species (all together) is significantly different from -the number observed in the open, considering the percentage of cover of all canopy species together and open area (i.e.bare ground), respectively.

    4. -
    5. "by_canopy_sp": whether the number of recuits of any recruit species (all together) under a given canopy species is significantly different from -the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively

    6. -
    - -
    -
    -

    Value

    - - -

    a list with four elements. The first element data frame with the -same structure as the input with three additional columns: -int_p (p-value of the binomial test of association), -int_sign (the sign of the association, being Posive (or Negative) if the -association is stronger (or weaker) than expected by the percentage cover -of Canopy and Open, and Neutral if there is not enought power to conduct the test, -stdres (standarized resdual quantifying the difference between the observed -and expected values), and -testability (indicating whether the sample size allow to conduct or not the test -being Non-testable those rows in which int_sign = Neutral). -The second, third and fourth elements of teh list are the matrices of only positive, -negative and neutral ( testable) associations based on the database generated in the first element of the list.

    -
    - -
    -

    Examples

    -
    if (FALSE) { # interactive()
    -
    -sign_vest <- sign_net(RecruitNet, CanopyCover, "Ventisquero", "by_pairwise_interaction" )
    -}
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.9.

    -
    - -
    - - - - - - - - diff --git a/docs/sitemap.xml b/docs/sitemap.xml deleted file mode 100644 index 2ba91c7..0000000 --- a/docs/sitemap.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - /404.html - - - /LICENSE.html - - - /articles/Completeness-of-the-recruitment-network.html - - - /articles/The-RecruitNet-database.html - - - /articles/index.html - - - /authors.html - - - /index.html - - - /news/index.html - - - /reference/CanopyCover.html - - - /reference/RN_to_matrix.html - - - /reference/RecruitNet.html - - - /reference/RecruitNetP-package.html - - - /reference/comm_subset.html - - - /reference/comm_summary.html - - - /reference/comm_to_RN.html - - - /reference/download_RN.html - - - /reference/index.html - - - /reference/link_completeness.html - - - /reference/sign_net.html - - From b488042976a992cbfd17f93ebdd9d0429de269a3 Mon Sep 17 00:00:00 2001 From: Francisco Rodriguez-Sanchez Date: Wed, 18 Feb 2026 17:02:56 +0100 Subject: [PATCH 2/3] update GHA --- .github/workflows/R-CMD-check.yaml | 51 +++++++++++++++++++++++ .github/workflows/pkgdown.yaml | 49 ++++++++++++++++++++++ .github/workflows/test-coverage.yaml | 62 ++++++++++++++++++++++++++++ _pkgdown.yml | 4 ++ 4 files changed, 166 insertions(+) create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 _pkgdown.yml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..562fe0f --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,51 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..bfc9f4d --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..0ab748d --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,62 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr, any::xml2 + needs: coverage + + - name: Test coverage + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + print(cov) + covr::to_cobertura(cov) + shell: Rscript {0} + + - uses: codecov/codecov-action@v5 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + files: ./cobertura.xml + plugins: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..0a33daf --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: https://ecologyr.github.io/RecruitNetP/ +template: + bootstrap: 5 + From d87b685c78e8ca6b9950134d40cee88144401e19 Mon Sep 17 00:00:00 2001 From: Francisco Rodriguez-Sanchez Date: Wed, 18 Feb 2026 17:04:45 +0100 Subject: [PATCH 3/3] delete old files --- R/RN_to_matrix.R | 45 ------- R/RecruitnetP-package.R | 6 - R/aggr_RN.R | 47 ------- R/aggr_cover.R | 26 ---- R/associndex.R | 123 ------------------ R/canopy_level.R | 82 ------------ R/chisq.test2.R | 155 ----------------------- R/comm_summary.R | 109 ---------------- R/comm_to_RN.R | 36 ------ R/datasets.R | 13 -- R/funtopol.R | 147 ---------------------- R/globals.R | 4 - R/link_completeness.R | 129 ------------------- R/merge_RN_cover.R | 66 ---------- R/plot_to_site.R | 159 ----------------------- R/pre_asocindex.R | 131 ------------------- R/recruit_level.R | 64 ---------- R/sig_test.R | 138 -------------------- R/sign_net.R | 103 --------------- R/site_level.R | 91 -------------- man/CanopyCover.Rd | 19 --- man/RN_to_matrix.Rd | 39 ------ man/RecruitNet.Rd | 19 --- man/RecruitNetP-package.Rd | 31 ----- man/associndex.Rd | 76 ----------- man/comm_subset.Rd | 28 ----- man/comm_summary.Rd | 26 ---- man/comm_to_RN.Rd | 37 ------ man/download_RN.Rd | 27 ---- man/funtopol.Rd | 56 --------- man/link_completeness.Rd | 44 ------- man/sign_net.Rd | 60 --------- tests/testthat/test-RN_to_matrix.R | 161 ------------------------ tests/testthat/test-comm_summary.R | 31 ----- tests/testthat/test-comm_to_RN.R | 35 ------ tests/testthat/test-link_completeness.R | 23 ---- 36 files changed, 2386 deletions(-) delete mode 100644 R/RN_to_matrix.R delete mode 100644 R/RecruitnetP-package.R delete mode 100644 R/aggr_RN.R delete mode 100644 R/aggr_cover.R delete mode 100644 R/associndex.R delete mode 100644 R/canopy_level.R delete mode 100644 R/chisq.test2.R delete mode 100644 R/comm_summary.R delete mode 100644 R/comm_to_RN.R delete mode 100644 R/datasets.R delete mode 100644 R/funtopol.R delete mode 100644 R/globals.R delete mode 100644 R/link_completeness.R delete mode 100644 R/merge_RN_cover.R delete mode 100644 R/plot_to_site.R delete mode 100644 R/pre_asocindex.R delete mode 100644 R/recruit_level.R delete mode 100644 R/sig_test.R delete mode 100644 R/sign_net.R delete mode 100644 R/site_level.R delete mode 100644 man/CanopyCover.Rd delete mode 100644 man/RN_to_matrix.Rd delete mode 100644 man/RecruitNet.Rd delete mode 100644 man/RecruitNetP-package.Rd delete mode 100644 man/associndex.Rd delete mode 100644 man/comm_subset.Rd delete mode 100644 man/comm_summary.Rd delete mode 100644 man/comm_to_RN.Rd delete mode 100644 man/download_RN.Rd delete mode 100644 man/funtopol.Rd delete mode 100644 man/link_completeness.Rd delete mode 100644 man/sign_net.Rd delete mode 100644 tests/testthat/test-RN_to_matrix.R delete mode 100644 tests/testthat/test-comm_summary.R delete mode 100644 tests/testthat/test-comm_to_RN.R delete mode 100644 tests/testthat/test-link_completeness.R diff --git a/R/RN_to_matrix.R b/R/RN_to_matrix.R deleted file mode 100644 index 3567700..0000000 --- a/R/RN_to_matrix.R +++ /dev/null @@ -1,45 +0,0 @@ -#' Function RN_matrixForm -#' -#' For some analyses, the data must be stored as a matrix rather than data frame. -#' The next function takes a RN stored as data frame and transforms it into a matrix. -#' The output matrix can be used input for bipartite package. -#' -#' @param RNdata A data frame generated with [comm_subset()] or a data.frame -#' containing columns with all the information needed for the basic analysis of -#' recruitment networks: canopy species (canopy), recruit species (recruit), -#' cover of the canopy (cj) and recruit (ci), -#' and columns with possible weighting variables. -#' -#' @param weight The name of the column of the data frame to be used as weight -#' variable for the links. -#' -#' @return A matrix object with the species names as row (recruit species) and -#' column names (canopy species), and cells indicating the chosen weight for -#' each interaction. For example, the output of function local_RN provides the -#' number of recruits of species i interacting with canopy species j (fij), -#' the number of plots (i.e. incidence) where the interaction has been found (Tij), -#' and the binary presence/absence of the interaction in the whole study site (Pij). -#' Can be used as bipartite input. -#' -#' @export -#' -#' @examples -#' data(RecruitNet) -#' data(CanopyCover) -#' Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero") -#' Ventisquero_matrix <- RN_to_matrix(Ventisquero_RNc, weight = "fij") -#' Ventisquero_matrix <- RN_to_matrix(Ventisquero_RNc, weight = "Tij") - -RN_to_matrix <- function(RNdata = NULL, weight = NULL){ - - list_Canopy <- sort(unique(RNdata$Canopy)) - list_Recruit <- sort(unique(RNdata$Recruit)) - Num_canopy <- length(list_Canopy) - Num_recruit <- length(list_Recruit) - RNmat <- RNdata[[weight]] - dim(RNmat) <- c(Num_recruit, Num_canopy) - colnames(RNmat) <- list_Canopy - rownames(RNmat) <- list_Recruit - return(RNmat) - -} diff --git a/R/RecruitnetP-package.R b/R/RecruitnetP-package.R deleted file mode 100644 index a65cf64..0000000 --- a/R/RecruitnetP-package.R +++ /dev/null @@ -1,6 +0,0 @@ -#' @keywords internal -"_PACKAGE" - -## usethis namespace: start -## usethis namespace: end -NULL diff --git a/R/aggr_RN.R b/R/aggr_RN.R deleted file mode 100644 index 5a62d83..0000000 --- a/R/aggr_RN.R +++ /dev/null @@ -1,47 +0,0 @@ -#' Prepare recruitment data -#' -#' @description -#' -#' This function makes a data frame with the basic data needed to build the -#' recruitment network: the identity of canopy and recruit species, and several -#' possible weighting variables for the interactions: fij is the number of -#' recruits of species i interacting with canopy species j summed across plots, -#' Tij is the number of plots (i.e. incidence) where the interaction has been found, -#' and Pij is the presence/absence of the interaction in the whole study site. -#' -#' The output contains all possible pairs of interacting species, -#' including those that were not observed, which are assigned weight = 0. -#' -#' @param raw_RN A data frame containing, at least, the columns: -#' "Canopy", "Recruit" and "Frequency". -#' -#' @return A data frame containing the data to build a recruitment network -#' of a local community: "canopy", "recruit", "fij", "Tij" and "Pij". -#' -#' @noRd -#' -#' @examples -#' Ventisquero_raw <- comm_subset(RecruitNet, site = "Ventisquero") -#' Ventisquero_RN <- aggr_RN(Ventisquero_raw) - -aggr_RN <- function(raw_RN) { - - # Sum the number of recruits per interaction across plots - RN <- stats::aggregate(Frequency ~ Canopy*Recruit, data = raw_RN, FUN = sum) - colnames(RN) <- c("Canopy", "Recruit", "fij") - RN$Tij <- stats::aggregate(Frequency ~ Canopy*Recruit, data=raw_RN, FUN = NROW)[[3]] - RN$Pij <- ifelse(RN$Tij==0,0,1) - RN$Canopy <- gsub("[[:space:]]", "_", RN$Canopy) - RN$Recruit <- gsub("[[:space:]]", "_", RN$Recruit) - - # Incorporate the unobserved interactions - species_list <- unique(c(RN$Canopy, RN$Recruit)) - df <- expand.grid(Canopy = species_list, Recruit = species_list) - RN <- merge(df, RN, all = TRUE) - RN[is.na(RN)] <- 0 - RN$Canopy <- as.character(RN$Canopy) - RN$Recruit <- as.character(RN$Recruit) - RN <- RN[which(RN$Recruit!="Open"),] # Remove Open from the Recruit species - return(RN) - -} diff --git a/R/aggr_cover.R b/R/aggr_cover.R deleted file mode 100644 index b1385c3..0000000 --- a/R/aggr_cover.R +++ /dev/null @@ -1,26 +0,0 @@ -#' Calculate aggregated species cover -#' -#' Calculate the aggregated (i.e. summed) cover of each species across -#' all the plots from a local community. -#' -#' @param dataset character. Name of the data set where cover data are stored. -#' Usually, it will be "CanopyCover" (or the name assigned to the -#' dataset "CanopyCover.csv" when it was imported). -#' @param site character. Name of a study site. -#' -#' @return A data frame containing the total cover of each species in a local community, -#' aggregated across plots. It has two columns: "Canopy", with the name of each species (irrespective -#' of being acting as canopies or recruits); and "abundance". -#' -#' @noRd -#' -#' @examples -#' Ventisquero_cover <- aggr_cover(CanopyCover, site = "Ventisquero") - -aggr_cover <- function(dataset, site) { - cover <- dataset[which(dataset$Study_site == site), ] - cover$abundance <- (cover$Cover / 100) * cover$Sampled_distance_or_area - cover <- stats::aggregate(abundance ~ Canopy, data = cover, sum) - return(cover) - -} diff --git a/R/associndex.R b/R/associndex.R deleted file mode 100644 index 691804b..0000000 --- a/R/associndex.R +++ /dev/null @@ -1,123 +0,0 @@ - - -#' Calculate interaction strength indices -#' -#' @param int_data data frame with at least four columns: -#' - Study_site (unique name of the study site), -#' - Recruit (species of the recruit), -#' - Canopy (species of the canopy, or "Open"), and -#' - Frequency (number of recruits of that species observed under that -#' canopy species in any plot, with "Open" representing recruits observed -#' without a canopy species). -#' If available, the dimensions of the study plots can be also included as -#' variables PlotdimX and PlotdimY. -#' @param cover_data data frame with at least five columns: -#' - Study_site (unique name of the study site), -#' - Plot (unique name of each plot within a study site), -#' - Canopy (species of the canopy), -#' - Cover (percentage of cover of that species in that plot), and -#' - Sampled_distance_or_area (total area of the plot). -#' @param area_sampled Total area surveyed in the study site (in m2). -#' @param thr_dens Maximum density considered as reasonable. For example, if a canopy species is rare -#' (e.g. 0.01 m2) but there is one sapling growing beneath, we would estimate a density of 100 saplings/m2 -#' for this interaction, what is likely an overestimate because it seems reasonable that increasing the -#' effort under this canopy species we would obtain a much lower density estimate. The threshold is set -#' by default to 100 recruits/m2. -#' -#' @return data frame with indices of pair-wise interaction strength and the data neeeded for their estimation. -#' Each row corresponds to each pair-wise interaction, and contains the following columns: -#' Recruit: recruit species. -#' Canopy: canopy species. -#' inter_ID: a unique identifier for each pair-wise interaction, combining Study_site, Recruit, and Canopy species. -#' Study_site: name of the study site. -#' Canopy_Freq: number of recruits found in the vicinity of the canopy species. -#' Open_Freq: number of recruits found in open spaces. -#' Canopy_cover: percentage of the total area sampled in the study site occupied by the canopy species. -#' Open_cover: percentage of the total area sampled in the study site occupied by Open spaces. -#' Freq_tot: sum of Canopy_Freq and Open_Freq (total number of recruits of the recruit species in the area sampled -#' in the study site. -#' RecrDens_canopy: density of recruits under the canopy species (recruits/m2). -#' RecrDens_open: density of recruits in open spaces (recruits/m2). -#' Max_Recr_Density: maximum recruitment density between under the canopy species vs in open spaces. -#' max_Recr: maximum recruitment density of the recruit species in the study site. -#' Ns: Normalized Neighbour Suitability index (Mingo, 2014). -#' NintC: commutative symmetry intensity index (Díaz-Sierra et al., 2017) -#' NintA:additive symmetry intensity index (Díaz-Sierra et al., 2017) -#' RII: Relative Interaction Index (Armas et al., 2004). -#' -#' @export -#' -#' @examples -#' data(RecruitNet) -#' data(CanopyCover) -#' int_data <- comm_subset(RecruitNet, site = "Ventisquero") -#' cover_data <- CanopyCover[CanopyCover$Study_site == "Ventisquero", ] -#' Ventisquero_int <- associndex(int_data, cover_data) -#' - -associndex <- function(int_data = NULL, - cover_data = NULL, - area_sampled = NULL, - thr_dens = 100) { - - if (is.null(area_sampled) & !"PlotdimX" %in% names(int_data)) { - stop("ERROR: sampled area cannot be calculated with the data available. You must enter a value in area_sampled or add variables PlotdimX and PlotdimY in your data.") - } - - if (is.null(area_sampled)) { - area_sampled = comm_summary(int_data)["Area sampled (m2)"][1,1] - } - - threshold_density <- thr_dens - - # Assemble the data - db_inter <- pre_asocindex(int_data, cover_data) - - # Incorporate density of recruitment (recruits/m2) under each canopy species and in open. - db_inter$RecrDens_canopy <- db_inter$Canopy_Freq/((db_inter$Canopy_cover/100)*area_sampled) - db_inter$RecrDens_open <- db_inter$Open_Freq/((db_inter$Open_cover/100)*area_sampled) - - # remove the interactions with estimated density above the threshold. - db_inter <- db_inter[which(db_inter$RecrDens_canopy 0) { - db_inter <- db_inter[-which(db_inter$Recruit %in% lack_dens), ] - } else { - db_inter - } - - db_inter$max_Recr <- db_inter$Recruit - for (i in 1:(dim(db_inter)[1])) { - db_inter$max_Recr[i] <- replace( - db_inter$max_Recr[i], - match(Recr_list, db_inter$max_Recr[i]), - max_rd$Max_Recr_Density[match(db_inter$max_Recr[i], max_rd$Recruit)] - ) - } - - db_inter <- utils::type.convert(db_inter, as.is = TRUE) - - # Calculate indices Ns, NintC, NintA and RII - db_inter$Ns <- (db_inter$RecrDens_canopy - db_inter$RecrDens_open)/db_inter$max_Recr - db_inter$NintC <- 2*(db_inter$RecrDens_canopy - db_inter$RecrDens_open)/((db_inter$RecrDens_canopy + db_inter$RecrDens_open)+abs(db_inter$RecrDens_canopy-db_inter$RecrDens_open)) - db_inter$NintA <- 2*(db_inter$RecrDens_canopy - db_inter$RecrDens_open)/((db_inter$RecrDens_open) + abs(db_inter$RecrDens_canopy-db_inter$RecrDens_open)) - db_inter$RII <- (db_inter$RecrDens_canopy - db_inter$RecrDens_open)/(db_inter$RecrDens_canopy + db_inter$RecrDens_open) - - removed <- names(db_inter) %in% c("Frequency") - db_inter <- db_inter[!removed] - return(db_inter) - -} diff --git a/R/canopy_level.R b/R/canopy_level.R deleted file mode 100644 index 562057f..0000000 --- a/R/canopy_level.R +++ /dev/null @@ -1,82 +0,0 @@ -#' Calculate the number of recruits under each canopy species -#' -#' Calculate in separate columns the total number of recruits (of any species) -#' under each species of canopy and in the open and its respective percentage -#' of cover (either for multiple or a single site). -#' -#' @param inter_data data frame with at least four columns: Study_site -#' (unique name of the study site), Recruit (species of the recruit), -#' Canopy (species of the canopy, or "Open"), and Frequency (number of recruits -#' of that species observed under that canopy species in any plot, -#' with "Open" representing recruits observed without a canopy species). -#' -#' @param cover_data data frame with at least five columns: -#' Study_site (unique name of the study site), -#' Plot (unique name of each plot within a study site), -#' Canopy (species of the canopy), -#' Cover (percentage of cover of that species in that plot), and -#' Sampled_distance_or_area (total area of that plot or length in the case of transects). -#' -#' @return data frame with one row per Canopy species in each site and nine columns: -#' inter_ID (a unique identifier for each pair-wise interaction, -#' combining Study_site, Recruit, and Canopy species), -#' Recruit(recruit species), -#' Canopy (canopy speices), -#' Study_site (name of the study site), -#' Canopy_Freq and Open_Freq with the number of recuits observed under that -#' canopy species or in the Open, respectively and -#' Canopy_cover and Open_cover, with the percentage of the total area sampled -#' in the Study_site occupied by that canopy species and Open respectively. -#' Freq_tot is the sum of Canopy_Freq and Open_Freq (total number of recruits of -#' that speices observed in the area sampled in the Study_site). -#' -#' @noRd -#' -#' @examples -#' db_sp_can <- canopy_level (RecruitNet, CanopyCover) - -canopy_level <- function(inter_data = RecruitNet, - cover_data = CanopyCover -) { - - options(dplyr.summarise.inform = FALSE) - - data <- inter_data - dbcover <- cover_data - - db_inter <- pre_asocindex(data, dbcover) - - db_sp_can <- data.frame( - db_inter |> - dplyr::group_by(Study_site, Canopy) |> - dplyr::summarise( - Canopy_Freq = sum(Canopy_Freq, na.rm = TRUE), - Open_cover = unique(Open_cover, na.rm = TRUE), - Canopy_cover = unique(Canopy_cover, na.rm = TRUE) - ) - ) - - Rec_open <- data.frame( - db_inter |> - dplyr::group_by(Study_site, Recruit) |> - dplyr::summarise(Open_Freq = unique(Open_Freq, na.rm = TRUE)) - ) - - Rec_open <- data.frame( - Rec_open |> - dplyr::group_by(Study_site) |> - dplyr::summarise(Open_Freq = sum(Open_Freq, na.rm = TRUE))) - - - db_sp_can <- merge(db_sp_can, Rec_open, by = "Study_site") - - db_sp_can <- db_sp_can[, c("Study_site" , - "Canopy" , - "Canopy_Freq", - "Open_Freq", - "Open_cover", - "Canopy_cover")] - - return(db_sp_can) - -} diff --git a/R/chisq.test2.R b/R/chisq.test2.R deleted file mode 100644 index c79cf85..0000000 --- a/R/chisq.test2.R +++ /dev/null @@ -1,155 +0,0 @@ -#' @param x a numeric vector or matrix. `x` and `y` can also both be factors. -#' @param y a numeric vector; ignored if `x` is a matrix. `x` and `y` can also both be factors. -#' @param correct a logical indicating whether to apply continuity correction in the case of a 2x2 table. Default is TRUE. -#' @param p a vector of probabilities of the same length as `x`, used for goodness-of-fit tests. Default is rep(1/length(x), length(x)). -#' @param rescale.p a logical indicating whether to rescale `p` to sum to 1. Default is FALSE. -#' @param simulate.p.value a logical indicating whether to compute p-values by Monte Carlo simulation. Default is FALSE. -#' @param B an integer specifying the number of replicates used in the Monte Carlo test. Default is 2000. -#' -#' @return A list with class "htest". -#' @noRd -#' @details -#' The original function chisq.test performs a chi-squared test of the null hypothesis that the -#' proportions in a one-way table (goodness-of-fit) or the counts in a two-way -#' table (contingency) follow a specified distribution. -#' chisq.test2 is a modified version of chisq.test function that optimices the use of its argument simulated.p.value =T -#' This version uses tabulate instead of table to create frequency counts -#' -#' @examples -#' ## Goodness-of-fit test -#' chisq.test(c(4, 6, 17, 16, 8, 9), p = c(1, 1, 1, 1, 1, 1)/6) - - -chisq.test2 <-function (x, y = NULL, correct = TRUE, p = rep(1/length(x), length(x)), - rescale.p = FALSE, simulate.p.value = FALSE, B = 2000) -{ - DNAME <- deparse(substitute(x)) - if (is.data.frame(x)) - x <- as.matrix(x) - if (is.matrix(x)) { - if (min(dim(x)) == 1L) - x <- as.vector(x) - } - if (!is.matrix(x) && !is.null(y)) { - if (length(x) != length(y)) - stop("'x' and 'y' must have the same length") - DNAME2 <- deparse(substitute(y)) - xname <- if (length(DNAME) > 1L || nchar(DNAME, "w") > - 30) - "" - else DNAME - yname <- if (length(DNAME2) > 1L || nchar(DNAME2, "w") > - 30) - "" - else DNAME2 - OK <- stats::complete.cases(x, y) - x <- factor(x[OK]) - y <- factor(y[OK]) - if ((nlevels(x) < 2L) || (nlevels(y) < 2L)) - stop("'x' and 'y' must have at least 2 levels") - x <- table(x, y) - names(dimnames(x)) <- c(xname, yname) - DNAME <- paste(paste(DNAME, collapse = "\n"), "and", - paste(DNAME2, collapse = "\n")) - } - if (any(x < 0) || anyNA(x)) - stop("all entries of 'x' must be nonnegative and finite") - if ((n <- sum(x)) == 0) - stop("at least one entry of 'x' must be positive") - if (simulate.p.value) { - setMETH <- function() METHOD <<- paste(METHOD, "with simulated p-value\n\t (based on", - B, "replicates)") - almost.1 <- 1 - 64 * .Machine$double.eps - } - if (is.matrix(x)) { - METHOD <- "Pearson's Chi-squared test" - nr <- as.integer(nrow(x)) - nc <- as.integer(ncol(x)) - if (is.na(nr) || is.na(nc) || is.na(nr * nc)) - stop("invalid nrow(x) or ncol(x)", domain = NA) - sr <- rowSums(x) - sc <- colSums(x) - E <- outer(sr, sc)/n - v <- function(r, c, n) c * r * (n - r) * (n - c)/n^3 - V <- outer(sr, sc, v, n) - dimnames(E) <- dimnames(x) - if (simulate.p.value && all(sr > 0) && all(sc > 0)) { - setMETH() - tmp <- .Call(C_chisq_sim, sr, sc, B, E) - STATISTIC <- sum(sort((x - E)^2/E, decreasing = TRUE)) - PARAMETER <- NA - PVAL <- (1 + sum(tmp >= almost.1 * STATISTIC))/(B + - 1) - } - else { - if (simulate.p.value) - warning("cannot compute simulated p-value with zero marginals") - if (correct && nrow(x) == 2L && ncol(x) == 2L) { - YATES <- min(0.5, abs(x - E)) - if (YATES > 0) - METHOD <- paste(METHOD, "with Yates' continuity correction") - } - else YATES <- 0 - STATISTIC <- sum((abs(x - E) - YATES)^2/E) - PARAMETER <- (nr - 1L) * (nc - 1L) - PVAL <- stats::pchisq(STATISTIC, PARAMETER, lower.tail = FALSE) - } - } - else { - if (length(dim(x)) > 2L) - stop("invalid 'x'") - if (length(x) == 1L) - stop("'x' must at least have 2 elements") - if (length(x) != length(p)) - stop("'x' and 'p' must have the same number of elements") - if (any(p < 0)) - stop("probabilities must be non-negative.") - if (abs(sum(p) - 1) > sqrt(.Machine$double.eps)) { - if (rescale.p) - p <- p/sum(p) - else stop("probabilities must sum to 1.") - } - METHOD <- "Chi-squared test for given probabilities" - E <- n * p - V <- n * p * (1 - p) - STATISTIC <- sum((x - E)^2/E) - names(E) <- names(x) - # if (simulate.p.value) { - # setMETH() - # nx <- length(x) - # sm <- matrix(sample.int(nx, B * n, TRUE, prob = p), - # nrow = n) - # ss <- apply(sm, 2L, function(x, E, k) { - # sum((table(factor(x, levels = 1L:k)) - E)^2/E) - # }, E = E, k = nx) - # PARAMETER <- NA - # PVAL <- (1 + sum(ss >= almost.1 * STATISTIC))/(B + - # 1) - # } - - if (simulate.p.value) { - setMETH() - nx <- length(x) - sm <- matrix(sample.int(nx, B * n, TRUE, prob = p), nrow = n) - ss <- apply(sm, 2L, function(col) { - freq_table <- tabulate(col, nbins = nx) - sum((freq_table - E)^2 / E) - }) - PARAMETER <- NA - PVAL <- (1 + sum(ss >= almost.1 * STATISTIC)) / (B + 1) - } - - else { - PARAMETER <- length(x) - 1 - PVAL <- stats::pchisq(STATISTIC, PARAMETER, lower.tail = FALSE) - } - } - names(STATISTIC) <- "X-squared" - names(PARAMETER) <- "df" - if (any(E < 5) && is.finite(PARAMETER)) - warning("Chi-squared approximation may be incorrect") - structure(list(statistic = STATISTIC, parameter = PARAMETER, - p.value = PVAL, method = METHOD, data.name = DNAME, observed = x, - expected = E, residuals = (x - E)/sqrt(E), stdres = (x - - E)/sqrt(V)), class = "htest") -} diff --git a/R/comm_summary.R b/R/comm_summary.R deleted file mode 100644 index b3cdc47..0000000 --- a/R/comm_summary.R +++ /dev/null @@ -1,109 +0,0 @@ -#' Summarise metadata of a community -#' -#' This function provides a summary of the characteristics (i.e. metadata) of -#' a local community. -#' -#' @param dataset A data frame for a single site (or a group of sites). -#' For example, a data frame created with [comm_subset()]. This function relies on -#' the variable names used in the original RecruitNet database, so it cannot be used -#' with other datasets unless they follow exactly the ordering and the names used in RecruitNet. -#' -#' -#' @return A data frame with summary information of the local community/ies. -#' -#' @export -#' -#' @examples -#' All_sites_details <- comm_summary(RecruitNet) -#' Ventisquero <- comm_subset(RecruitNet, site = "Ventisquero") -#' Ventisquero_details <- comm_summary(Ventisquero) - - -comm_summary <- function(dataset = NULL) { - - dfList <- list() - - for (i in 1:length(unique(dataset$Study_site))) { - data <- comm_subset(dataset, unique(dataset$Study_site)[i]) - - # Plots data - n_plots <- length(unique(data$Plot)) - plotDim <- data$PlotdimX[1] * data$PlotdimY[1] - areaSampled <- plotDim * n_plots - - # Nodes data - isOpen <- ifelse(is.element('Open', data$Standardized_Canopy) == TRUE, "Yes", "No") - n_nodes <- length(unique(c( - data$Standardized_Canopy, data$Standardized_Recruit - ))) - n_sp <- ifelse(isOpen == "Yes", n_nodes - 1, n_nodes) - num_woody <- length(which(unique(data.frame( - c(data$LifeHabit_Canopy, data$LifeHabit_Recruit), - c(data$Standardized_Canopy, data$Standardized_Recruit) - ), margin = 1) == "W")) - num_herbs <- length(which(unique(data.frame( - c(data$LifeHabit_Canopy, data$LifeHabit_Recruit), - c(data$Standardized_Canopy, data$Standardized_Recruit) - ), margin = 1) == "H")) - num_others <- n_sp - num_woody - num_herbs - - # Function output - df <- data.frame( - c( - data$Study_site[1], - data$Country[1], - data$Latitude[1], - data$Longitude[1], - data$Sampling_date[1], - data$Site_responsible[1], - data$Biome[1], - data$Vegetation_type[1], - data$Community[1], - data$Successional_stage[1], - data$Disturbance[1], - data$Sampling_method[1], - n_plots, - plotDim, - areaSampled, - n_sp, - isOpen, - num_woody, - num_herbs, - num_others - ) - ) - colnames(df) <- c("Value") - rownames(df) <- c( - "Local Community", - "Country", - "Latitude", - "Longitude", - "Year of sampling", - "Site responsible", - "Biome", - "Vegetation", - "Plant Community", - "Successional stage", - "Disturbance", - "Sampling method", - "Number of plots", - "Plot area (m2)", - "Area sampled (m2)", - "Number of plant species", - "Contains Open node", - "Number of woody species", - "Number of herb species", - "Number of other types" - ) - - dfList[[i]] <- t(df) - - } - - dfAll <- as.data.frame(do.call(rbind, dfList)) - - dfAll <- utils::type.convert(dfAll, as.is = TRUE) - - return(dfAll) - -} diff --git a/R/comm_to_RN.R b/R/comm_to_RN.R deleted file mode 100644 index a854d49..0000000 --- a/R/comm_to_RN.R +++ /dev/null @@ -1,36 +0,0 @@ -#' Merge cover data with interaction data for a given site -#' -#' This function returns a data frame that merges the information from the -#' recruitment network and species cover for a local community. -#' It is a shortcut to directly obtain the data for a local community -#' from the RecruitNet dataset. -#' -#' @param RN_data data set where recruitment networks are stored. -#' Usually, it will be "RecruitNet" (or the name assigned to the dataset when it was imported). -#' -#' @param cover_data data set where cover data is stored. -#' Usually, it will be "CanopyCover" (or the name assigned to the dataset -#' "CanopyCover.csv" when it was imported). -#' -#' @param site name of the study site. -#' -#' @return A data.frame containing 7 columns with all the information needed -#' for the basic analysis of recruitment networks and canopy-recruit interactions: -#' canopy species (Canopy), recruit species (Recruit), recruitment frequency (fij), -#' Tij = TODO, -#' Pij = TODO, -#' cover of the canopy (cj) and cover of the recruit (ci). -#' -#' @export -#' -#' @examples -#' data(RecruitNet) -#' data(CanopyCover) -#' Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero") - -comm_to_RN <- function(RN_data = NULL, cover_data = NULL, site = NULL) { - - merge_RN_cover(aggr_RN(comm_subset(RN_data, site)), - aggr_cover(cover_data, site)) - -} diff --git a/R/datasets.R b/R/datasets.R deleted file mode 100644 index 1e0f4d1..0000000 --- a/R/datasets.R +++ /dev/null @@ -1,13 +0,0 @@ -#' RecruitNet -#' -#' Plant-plant interactions global database -#' -#' @source https://doi.org/10.1002/ecy.3923 -"RecruitNet" - -#' CanopyCover -#' -#' Canopy cover of plant-plant interactions global database -#' -#' @source https://doi.org/10.1002/ecy.3923 -"CanopyCover" diff --git a/R/funtopol.R b/R/funtopol.R deleted file mode 100644 index 8836ef4..0000000 --- a/R/funtopol.R +++ /dev/null @@ -1,147 +0,0 @@ - - -#' Functional topology of a recruitment network. -#' -#' @description -#' Alcantara & Rey (2012) derived a qualitative way to infer potential species -#' persistence from their position in the RNs based on a combination of non-negative -#' matrix theory and graph theory. Basically, directed unipartite graphs can be -#' unambiguously dissected into 'SCCs'. SCCs are the largest possible subgroups of -#' nodes connected so that all the nodes in a subgroup can be reached from all others -#' following the directions of the links. In the case of RNs, we can define five -#' types of SCCs which play different functional roles: -#' -#' - The "core" of the network is the SCC formed by the largest number of species. -#' All species in the core must recruit, at least, in the vicinity of another core -#' species, and allow the recruitment of at least another core species. -#' - “Satellites” are non-core species that can be reached from some core species, -#' following the direction of the arrows. For example, a satellite species is one -#' that recruits in the vicinity of some core species but that does not show -#' recruitment of any species in its vicinity. -#' - "Disturbance-dependent transients" are species that can be reached from the open -#' node but not from core or satellite species (i.e. for example, species that only -#' recruit away from established plants). -#' - "Strict transients" are species that cannot be reached from any other node (i.e. -#' those that do not recruit in the studied local assemblage). -#' -#' Assuming that the dynamics of the system is linear and time-invariant (LTI dynamics), -#' like in Markov models (Horn, 1975, Siles et al., 2008), only core and satellite -#' species will persist in equilibrium in the absence of disturbance. When the dynamics -#' are non-linear, this result cannot be guaranteed to hold, but simulations have shown -#' that the probability of persistence is higher and the time to extinction is longer -#' for core and satellite than for transient species (Alcantara et al., 2017). The sum -#' of core and satellite species is a qualitative approximation to the number of species -#' that can potentially persist. -#' -#' @param int_data Data frame with columns named "Canopy" and "Recruit" identifying -#' observed interactions (i.e. interactions with frequency > 0). -#' -#' @return The function returns two outputs: a data frame with the numeric summary of the -#' functional structure and a list containing the lists of species of each functional -#' type (core, satellite, strict transients and disturbance-dependent transients). -#' -#' @export -#' -#' @examples -#' data(RecruitNet) -#' int_data <- comm_subset(RecruitNet, site = "Ventisquero") -#' Ventisquero_funtopol <- funtopol(int_data) -#' Ventisquero_funtopol$Descriptors -#' Ventisquero_funtopol$Functional_classification - - -funtopol <- function(int_data){ - - if (!"Canopy" %in% names(int_data)) stop("ERROR: your interactions data lacks a column named: Canopy") - if (!"Recruit" %in% names(int_data)) stop("ERROR: your interactions data lacks a column named: Recruit") - if (!"Open" %in% int_data$Canopy) stop("ERROR: your data does not contain a node named Open or it is spelled differently.") - - int_data <- int_data[c("Canopy", "Recruit")] - g <- igraph::graph_from_data_frame(int_data, directed = TRUE) - g <- igraph::simplify(g, remove.multiple = TRUE, remove.loops = FALSE) - NEdges <- igraph::gsize(g) - NNodes <- igraph::gorder(g) - CDirected <- NEdges/(NNodes*(NNodes - 1)) - SCCs <- igraph::components(g, mode = "strong") - numSCCs <- SCCs$no - numNTSCCs <- sum(SCCs$csize > 1) - coreSize <- max(SCCs$csize) - SCC_memb <- SCCs$membership - SCC_memb <- as.data.frame(SCC_memb) - SCC_subgraphs <- igraph::decompose(g, mode = "strong") # Makes a subgraph of each SCC - IDcore <- match(coreSize, SCCs$csize) # locates the position of the core in the list of SCCs - MembersCore <- igraph::V(SCC_subgraphs[[IDcore]])$name # List of the species in the core - IDOpen <- SCC_memb$SCC_memb[match("Open", row.names(SCC_memb))] # Locate the position of the "open" node in the list of SCCs - outReachFromOpen <- names(igraph::subcomponent(g, "Open", "out")[-1]) # List of nodes reachable from the "open" - outReachFromCore <- vector("list", coreSize) # List of nodes reachable from core nodes - for (i in 1:coreSize) { - outReachFromCore[[i]] <- igraph::subcomponent(g, MembersCore[i], mode = "out") - } - a <- unlist(outReachFromCore) - a <- unique(names(a)) - MembersSatellites <- setdiff(a, MembersCore) - MembersTransients <- setdiff(igraph::V(g)$name,c(MembersCore,MembersSatellites)) - MembersTransients <- MembersTransients[!MembersTransients == "Open"] - MembersStrictTransients <- setdiff(MembersTransients, outReachFromOpen) - MembersDdTransients <- setdiff(MembersTransients, MembersStrictTransients) - numSat <- length(MembersSatellites) - numTransAll <- length(MembersTransients) - numDdTrans <- length(MembersDdTransients) - numStrictTrans <- length(MembersStrictTransients) - propCore <- coreSize/(NNodes - 1) - propSat <- numSat/(NNodes - 1) - propTrans <- numTransAll/(NNodes - 1) - propStrTrans <- numStrictTrans/(NNodes - 1) - propDdTrans <- numDdTrans/(NNodes - 1) - persistence <- propCore + propSat - - # Function output - - df <- data.frame( - c(NNodes, - NEdges, - CDirected, - numNTSCCs, - coreSize, - propCore, - numSat, - propSat, - numDdTrans, - propDdTrans, - numStrictTrans, - propStrTrans, - persistence) - ) - colnames(df) <- c("Value") - rownames(df) <- c( - "Num. nodes", - "Num. edges", - "Connectance", - "Num. non-trivial SCCs", - "Num. core species", - "Prop. core species", - "Num. satellite species", - "Prop. satellite species", - "Num. disturbance-dependent transients", - "Prop. disturbance-dependent transients", - "Num. strict transients", - "Prop. strict transients", - "Qualitative Persistence") - - classif <- list( - MembersSatellites, - MembersCore, - MembersStrictTransients, - MembersDdTransients) - classif <- stats::setNames(classif, - c("Satellites", - "Core", - "Strict_transients", - "Disturbance_dependent_transients") - ) - - outputs <- list("Descriptors" = df, "Functional_classification" = classif) - - return(outputs) - -} diff --git a/R/globals.R b/R/globals.R deleted file mode 100644 index 3bf1975..0000000 --- a/R/globals.R +++ /dev/null @@ -1,4 +0,0 @@ -utils::globalVariables(c("C_chisq_sim", "Canopy", "CanopyCover", "Canopy_Freq", - "Canopy_cover", "Canopy_cover_abs", "Frequency", - "Open_Freq", "Open_cover", "Recruit", "RecruitNet", - "Sampled_distance_or_area", "Study_site", "inter_ID")) diff --git a/R/link_completeness.R b/R/link_completeness.R deleted file mode 100644 index fbfee13..0000000 --- a/R/link_completeness.R +++ /dev/null @@ -1,129 +0,0 @@ -#' Link_completeness -#' -#' Observed and estimated number of links, and link completeness. -#' Methods based in Chao et al. (2014) as implemented in R package iNEXT. -#' -#' @param dataset The name of the data set where recruitment networks are stored. -#' Usually, it will be "RecruitNet" (or the name assigned to the data set when -#' it was imported). At least, the data set must contain columns named -#' "Study_site", "Plot", "Canopy", "Recruit" and "Frequency". -#' In data sets containing a single site or a single plot, -#' the corresponding columns must be included anyway. -#' -#' @param site The name of a study site. -#' @param type Can take two values: "incidence" or "abundance". -#' Estimates based on incidence data are recommended, but can only be obtained -#' if your data set is structured in multiple plots. Alternatively, for data -#' collected in a single plot, estimates can be based only on abundance data. -#' -#' @export -#' -#' @return A data frame TODO -#' -#' @examplesIf interactive() -#' -#' link_completeness(RecruitNet, "Ventisquero", "incidence") -#' link_completeness(RecruitNet, "Laxe", "abundance") -#' link_completeness(RecruitNet, "Laxe", "incidence") # Issues a warning -#' link_completeness(RecruitNet, "LosReyes", "abundance") -#' link_completeness(RecruitNet, "LosReyes", "incidence") #Issues an error - - -link_completeness <- function(dataset = NULL, - site = NULL, - type = c("incidence", "abundance")) { - - stopifnot( - c("Study_site", - "Plot", - "Canopy", - "Recruit", - "Frequency" - ) %in% names(dataset)) - - stopifnot(is.character(site)) - stopifnot(length(site) == 1) - - type <- match.arg(type) - - - data_raw <- data.frame(dataset[dataset$Study_site %in% site, ]) - data_RN <- aggr_RN(data_raw) - - # Completeness based on incidence data. - - if (type == "incidence") { - netRaw <- data.frame(cbind(data_raw$Plot, paste(data_raw$Canopy, data_raw$Recruit))) - colnames(netRaw) <- c("Plot", "Pair") - nPlots <- length(unique(netRaw$Plot)) - - # Check points. - - if (nPlots == 1) - stop( - "ERROR: your data is not structured in multiple plots. Incidence approach cannot be used. Try the abundance approach." - ) - if (nPlots < 10) - warning( - "WARNING: your are using the incidence approach with very few plots. Consider using the abundance approach if appropriate." - ) - - # Combine the lists of canopy and recruit species to obtain the total list of species sampled. - - a1 <- split(netRaw[-1], f = netRaw[1]) - a2 <- lapply(a1, unique) - a3 <- unlist(unlist(a2, recursive = FALSE, use.names = FALSE)) - - # Table showing the incidence of each species in the study site - - a4 <- table(a3) - linkIncidence <- as.data.frame(a4) - colnames(linkIncidence) <- c("Pair", "Incidence") - - # Incidence list to be passed to iNEXT - - data_iNEXT <- c(nPlots, sort(linkIncidence$Incidence, decreasing = TRUE)) - - # Call to iNEXT to obtain completeness values - - out <- iNEXT::iNEXT( - data_iNEXT, - q = c(0, 1), - datatype = "incidence_freq", - se = FALSE, - size = nPlots - ) - Lobs <- out$AsyEst[1, 1] - Lest <- out$AsyEst[1, 2] - Lest_LCL <- out$AsyEst[1, 4] - Lest_UCL <- out$AsyEst[1, 5] - Cq0_L <- Lobs / Lest - Cq1_L <- out$DataInfo[1, 5] - df <- data.frame(c(Lobs, Lest, Cq0_L, Cq1_L)) - colnames(df) <- c("Incidence based estimate") - rownames(df) <- c("Lobs", - "Lest", - "Completeness Links (q=0)", - "Coverage Links (q=1)") - } - - # Completeness based on abundance or frequency of recruits. - - if (type == "abundance") { - # Call to iNEXT to obtain completeness values - - out <- iNEXT::iNEXT(data_RN$fij[which(data_RN$fij > 0)], q = 0, datatype = "abundance") - Lobs <- out$AsyEst[1, 1] - Lest <- out$AsyEst[1, 2] - Cq0_L <- Lobs / Lest - Cq1_L <- out$DataInfo[1, 4] - df <- data.frame(c(Lobs, Lest, Cq0_L, Cq1_L)) - colnames(df) <- c("Abundance based estimate") - rownames(df) <- c("Lobs", - "Lest", - "Completeness of links (q=0)", - "Coverage of links (q=1)") - } - - return(df) -} diff --git a/R/merge_RN_cover.R b/R/merge_RN_cover.R deleted file mode 100644 index ccac748..0000000 --- a/R/merge_RN_cover.R +++ /dev/null @@ -1,66 +0,0 @@ -#' Merge cover data with interaction data -#' -#' This function makes a data frame that merges the information from the recruitment network -#' and species cover for a local community. -#' -#' @param RN_data A data frame created with local_comm, containing all the -#' available data from a local community. -#' @param cover_data data set where cover data are stored. Usually, it will be "CanopyCover" -#' (or the name assigned to the dataset "CanopyCover.csv" when it was imported). -#' -#' @return A data.frame containing 5 columns with all the information needed -#' for the basic analysis of recruitment networks and canopy-recruit interactions: -#' canopy species (canopy), recruit species (recruit), recruitment frequency (fij), -#' cover of the canopy (cj) and cover of the recruit (ci). -#' -#' @noRd -#' -#' @examples -#' Ventisquero_raw <- comm_subset(RecruitNet, site = "Ventisquero") -#' Ventisquero_RN <- aggr_RN(Ventisquero_raw) -#' Ventisquero_cover <- aggr_cover(CanopyCover, site = "Ventisquero") -#' Ventisquero_RNc <- merge_RN_cover(Ventisquero_RN, Ventisquero_cover) - -merge_RN_cover <- function(RN_data, cover_data) { - - # Find species present in RN but that lack data on cover. - cover_list <- sort(unique(cover_data$Canopy)) - RN_list <- sort(unique(c(RN_data$Canopy, RN_data$Recruit))) - lack_cover <- setdiff(RN_list, cover_list) - - # Remove species lacking cover from RN - RNc <- if (length(which(RN_data$Recruit %in% lack_cover)) > 0) { - RNc <- RN_data[-which(RN_data$Recruit %in% lack_cover), ] - } else { - RN_data - } - RNc <- if (length(which(RNc$Canopy %in% lack_cover)) > 0) { - RNc <- RNc[-which(RNc$Canopy %in% lack_cover), ] - } else { - RNc - } - - # Add variables with the cover of the canopy (cj) and recruit (ci) species - RNc$cj <- RNc$Canopy - RNc$ci <- RNc$Recruit - for (i in 1:dim(RNc)[1]) { - RNc$cj[i] <- as.numeric(replace( - RNc$Canopy[i], - match(RN_list, RNc$Canopy[i]), - cover_data$abundance[match(RNc$Canopy[i], cover_data$Canopy)] - )) - } - - for (i in 1:dim(RNc)[1]) { - RNc$ci[i] <- as.numeric(replace( - RNc$Recruit[i], - match(RN_list, RNc$Recruit[i]), - cover_data$abundance[match(RNc$Recruit[i], cover_data$Canopy)] - )) - } - - RNc <- utils::type.convert(RNc, as.is = TRUE) - - return(RNc) - -} diff --git a/R/plot_to_site.R b/R/plot_to_site.R deleted file mode 100644 index 7c21c34..0000000 --- a/R/plot_to_site.R +++ /dev/null @@ -1,159 +0,0 @@ -#' TODO: title -#' -#' Convert plots into community data per site (either for a single or multiple sites) -#' -#' @param inter_data data frame with at least four columns: -#' Study_site (unique name of the study site), -#' Recruit (species of the recruit), Canopy (species of the canopy, or "Open"), -#' and Frequency (number of recruits of that species observed under that -#' canopy species in any plot, with "Open" representing recruits observed -#' without a canopy species). -#' -#' @param cover_data data frame with at least five columns: -#' Study_site (unique name of the study site), -#' Plot (unique name of each plot within a study site), -#' Canopy (species of the canopy), -#' Cover (percentage of cover of that species in that plot), and -#' Sampled_distance_or_area (total area of that plot or length in the case of transects). -#' -#' @return a list with two elements. The first element is a data frame with -#' the same structure as the input inter_data, but with two additional columns: -#' inter_ID (a unique identifier for each pair-wise interaction, -#' combining Study_site, Recruit, and Canopy species) and -#' Freq (the number of recruits of that species under that canopy species in -#' the entire study site). -#' The second element is a data frame with one row per canopy species in -#' each Study_site, including two new variables: -#' Canopy_cover (the percentage of cover of that species in the entire -#' sampled area of the Study_site) and mycover_sp (a unique identifier -#' for each canopy species in each Study_site, combining Study_site and Canopy species). -#' -#' @noRd -#' -#' @examples -#' all_nets <- plot_to_site(RecruitNet, CanopyCover) - - - -plot_to_site <- function(inter_data = RecruitNet, - cover_data = CanopyCover - ) { - data <- inter_data - dbcover <- cover_data - data$inter_ID <- paste(data$Study_site, data$Recruit, data$Canopy, sep = "_") - - options(dplyr.summarise.inform = FALSE) - - data$inter_ID <- paste(data$Study_site, data$Recruit, data$Canopy, sep = "_") - dbcover2 <- droplevels(dbcover[!is.na(dbcover$Cover), ]) - rmnets <- setdiff(dbcover$Study_site, dbcover2$Study_site) - - #Those study_site that does not - #have information about the canopy of any of its species will be removed - - dbcover <- dbcover[dbcover$Study_site %in% setdiff(dbcover$Study_site, rmnets), ] - - - data <- data[data$Study_site %in% setdiff(data$Study_site, rmnets), ] - - - #check if the pruning of the study sites, if required, have worked properly i.e. now all the study sites have at least one canopy species - # with information about its cover (if not stop the process) - - if (!(length(setdiff(dbcover$Study_site, data$Study_site)) == 0 | - length(setdiff(data$Study_site, dbcover$Study_site)) == 0)) - stop("Study_site with complete information in the two arguments x,y does not match") - - ############### - - dbcover$Canopy_cover_abs <- with (dbcover, (Cover * Sampled_distance_or_area) / - 100) - - surfN <- data.frame( - dbcover |> - dplyr::group_by(Study_site, Canopy) |> - dplyr::summarise(Canopy_cover_abs = sum(Canopy_cover_abs, na.rm = TRUE)) - ) - - - site_surf <- data.frame( - unique(dbcover[, c("Study_site", "Plot", "Sampled_distance_or_area")]) |> - dplyr::group_by(Study_site) |> - dplyr::summarise(Plot_sup = sum(Sampled_distance_or_area)) - ) - - - - Canopy_all <- merge(surfN, site_surf, by = "Study_site") - Canopy_all$Canopy_cover <- with(Canopy_all, (Canopy_cover_abs * 100) / Plot_sup) - Canopy_all <- Canopy_all[, c("Study_site", "Canopy", "Canopy_cover")] - - Canopy_all[Canopy_all$Canopy_cover == 0, "Canopy_cover"] <- "NA" - - Canopy_all$Canopy_cover <- as.numeric(Canopy_all$Canopy_cover) - data$mynet_sp <- paste(data$Study_site, data$Canopy, sep = "-") - Canopy_all$mycover_sp <- paste(Canopy_all$Study_site, Canopy_all$Canopy, sep = "-") - - Canopy_all <- Canopy_all[!is.na(Canopy_all$Canopy_cover), ] - - - rmnets_anyNA <- unique(data[data$mynet_sp %in% setdiff(unique(data$mynet_sp), (Canopy_all$mycover_sp)), "Study_site"]) - - dbcover <- droplevels(dbcover[dbcover$Study_site %in% setdiff(dbcover$Study_site, rmnets_anyNA), ]) - data <- droplevels(data[data$Study_site %in% setdiff(data$Study_site, rmnets_anyNA), ]) - Canopy_all <- droplevels(Canopy_all[Canopy_all$Study_site %in% setdiff(Canopy_all$Study_site, rmnets_anyNA), ]) - - - inter <- data.frame( - data |> - dplyr::group_by(Study_site, Recruit, Canopy, inter_ID) |> - dplyr::summarise(inter_ID = unique(inter_ID), Freq = sum(Frequency)) - ) - - - for (i in 1:length(unique(inter$Study_site))) - - { - mysite <- inter[inter$Study_site == unique(inter$Study_site)[i], ] - #if(!"Open"%in%unique(mysite$Canopy)) - - myadj <- data[data$Study_site == unique(Canopy_all$Study_site)[i], ] - - Freq <- data.frame(myadj |> - dplyr::group_by(inter_ID) |> - dplyr::summarise(Freq = sum(Frequency))) - - alledge <- merge(Freq, unique(myadj[, c("Study_site", "inter_ID", "Canopy", "Recruit")]), by = - "inter_ID") - myadj <- reshape2::dcast(data = alledge[, c("Recruit", "Canopy", "Freq")], Recruit ~ - Canopy, value.var = "Freq") - myadj2 <- as.matrix(myadj[, -1]) - colnames(myadj2) <- colnames(myadj)[-1] - rownames(myadj2) <- myadj[, 1] - myadj <- myadj2 - myadj2 <- rm - myadj[is.na(myadj)] <- 0 - mycovs <- Canopy_all[Canopy_all$Study_site == unique(Canopy_all$Study_site)[i], ] - myadj <- myadj[, colnames(myadj) %in% mycovs$Canopy] - - - - if (length(colnames(myadj)[which(colnames(myadj) == "Open")]) < 1) { - myadj <- cbind(myadj, rep(0, dim(myadj)[1])) - colnames(myadj)[dim(myadj)[2]] <- "Open" - } - - - } - - - Canopy_all <- Canopy_all |> dplyr::arrange(Study_site) - inter <- inter |> dplyr::arrange(Study_site) - - out <- list() - inter$Frequency <- inter$Freq - out[[1]] <- inter - out[[2]] <- Canopy_all - - return(out) -} diff --git a/R/pre_asocindex.R b/R/pre_asocindex.R deleted file mode 100644 index 712b5e5..0000000 --- a/R/pre_asocindex.R +++ /dev/null @@ -1,131 +0,0 @@ -#' TODO: title -#' -#' Calculate in separate columns the number of recuits of each species under -#' each species of canopy and in the open and its respective percentage of -#' cover (either for multiple or a single site) -#' -#' @param inter_data data frame with at least four columns: -#' Study_site (unique name of the study site), -#' Recruit (species of the recruit), -#' Canopy (species of the canopy, or "Open"), and -#' Frequency (number of recruits of that species observed under that -#' canopy species in any plot, with "Open" representing recruits observed without a canopy species). -#' -#' @param cover_data data frame with at least five columns: -#' Study_site (unique name of the study site), -#' Plot (unique name of each plot within a study site), -#' Canopy (species of the canopy), -#' Cover (percentage of cover of that species in that plot), and -#' Sampled_distance_or_area (total area of that plot or length in the case of transects). -#' -#' @return data frame with one row for each pair-wise interaction -#' (Recruit speices-Canopy species) in each site, and nine columns: -#' inter_ID (a unique identifier for each pair-wise interaction, -#' combining Study_site, Recruit, and Canopy species), -#' Recruit(recruit species), Canopy (canopy speices), -#' Study_site (name of the study site), -#' Canopy_Freq and Open_Freq with the number of recuits observed -#' under that canopy species or in the Open, respectively and -#' Canopy_cover and Open_cover, with the percentage of the total area sampled -#' in the Study_site occupied by that canopy species and Open respectively. -#' Freq_tot is the sum of Canopy_Freq and Open_Freq (total number of recruits -#' of that speices observed in the area sampled in the Study_site). -#' -#' @noRd -#' -#' @examples -#' pre_index_all <- pre_asocindex(RecruitNet, CanopyCover) - -pre_asocindex <- function(inter_data = RecruitNet, - cover_data = CanopyCover - ) { - - data <- inter_data - dbcover <- cover_data - - com <- plot_to_site(data, dbcover) - - inter <- com[[1]] - Canopy_all <- com[[2]] - - adjlist <- list() - coverlist <- list() - edgelist <- list() - net <- NULL - NorecrOpen <- NULL - for (z in 1:length(unique(Canopy_all$Study_site))) - { - net[z] <- unique(Canopy_all$Study_site)[z] - mycovs <- Canopy_all[Canopy_all$Study_site == unique(Canopy_all$Study_site)[z], ] - alledge <- inter[inter$Study_site == unique(Canopy_all$Study_site)[z], ] - myadj <- data.frame(reshape2::dcast(data = alledge[, c("Recruit", "Canopy", "Freq")], Recruit ~ Canopy, value.var = - "Freq")) - myadj2 <- as.matrix(myadj[, -1]) - colnames(myadj2) <- colnames(myadj)[-1] - rownames(myadj2) <- myadj[, 1] - myadj <- myadj2 - myadj[is.na(myadj)] <- 0 - - #select only those canopies from whcih there is recruit under and cover data( ver & adj mat) - myadj <- myadj[, colnames(myadj) %in% mycovs$Canopy] - - #Add a canopy called Open if there is no recruits in Open in that community - if (length(colnames(myadj)[which(colnames(myadj) == "Open")]) < 1) { - NorecrOpen[z] <- unique(Canopy_all$Study_site)[z] - myadj <- cbind(myadj, rep(0, dim(myadj)[1])) - colnames(myadj)[dim(myadj)[2]] <- "Open" - } - mycovs <- mycovs[mycovs$Canopy %in% colnames(myadj), ] - #order the matrix - myadj <- myadj[, c(mycovs$Canopy[-which(mycovs$Canopy == "Open")], "Open")] - rownames(mycovs) <- mycovs$Canopy - mycovs <- mycovs[colnames(myadj), ] - - - #expand the database to include the interactions zero in the inetarction matris ( i.e. non-observed interactions) - - obs_inter <- data.frame(expand.grid(dimnames(provideDimnames(myadj)))[1:2], as.vector(as.matrix(myadj))) - - colnames(obs_inter)[which(colnames(obs_inter) == "Var1")] <- "Recruit" - colnames(obs_inter)[which(colnames(obs_inter) == "Var2")] <- "Canopy" - colnames(obs_inter)[which(colnames(obs_inter) == "as.vector.as.matrix.myadj..")] <- "Freq" - - obs_inter$Study_site <- rep(paste(net[[z]]), dim(obs_inter)[1]) - obs_inter$inter_ID <- - paste(obs_inter$Study_site, - obs_inter$Recruit, - obs_inter$Canopy, - sep = "_") - - alledge <- obs_inter[, c("inter_ID", "Freq" , "Study_site", "Canopy", "Recruit")] - #prepare the database output - openedge <- alledge[alledge$Canopy == "Open", ] - myedge <- alledge[alledge$Canopy != "Open", ] - - # add Canopy_cover - myedge <- merge(myedge, mycovs[, c("Canopy", "Canopy_cover")], by = "Canopy") - #add Open cover - myedge$Open_cover <- rep(mycovs[mycovs$Canopy == "Open", "Canopy_cover"], dim(myedge)[1]) - - #add number or recruits in open per recruit sp - - myedge <- merge(myedge, openedge[, c("Recruit", "Freq")], by = "Recruit", all.x = T) - colnames(myedge)[which(colnames(myedge) == "Freq.x")] <- "Canopy_Freq" - colnames(myedge)[which(colnames(myedge) == "Freq.y")] <- "Open_Freq" - myedge[is.na(myedge$Open_Freq), "Open_Freq"] <- 0 - - myedge <- myedge[which(myedge$Canopy_Freq + myedge$Open_Freq > 0), ] - - adjlist[[z]] <- myadj - coverlist[[z]] <- mycovs - edgelist[[z]] <- myedge - - } - - db_inter <- data.frame(do.call("rbind", edgelist)) - - db_inter$Freq_tot <- db_inter$Canopy_Freq + db_inter$Open_Freq - db_inter$Frequency <- db_inter$Canopy_Freq - return(db_inter) - -} diff --git a/R/recruit_level.R b/R/recruit_level.R deleted file mode 100644 index 2e3c1ca..0000000 --- a/R/recruit_level.R +++ /dev/null @@ -1,64 +0,0 @@ -#' Calculate the number of recruits under any canopy species -#' -#' Calculate in separate columns the total number of recruits of each species -#' under any species of canopy and in the open and its respective percentage -#' of cover of vegetation and Open (either for multiple or a single site) -#' -#' @param inter_data data frame with at least four columns: -#' Study_site (unique name of the study site), -#' Recruit (species of the recruit), -#' Canopy (species of the canopy, or "Open"), and -#' Frequency (number of recruits of that species observed under -#' that canopy species in any plot, with "Open" representing recruits observed -#' without a canopy species). -#' -#' @param cover_data data frame with at least five columns: -#' Study_site (unique name of the study site), -#' Plot (unique name of each plot within a study site), -#' Canopy (species of the canopy), -#' Cover (percentage of cover of that species in that plot), and -#' Sampled_distance_or_area (total area of that plot or length in the case of transects). -#' -#' @return data frame with one row per Rercuit species in each site and nine columns: -#' inter_ID (a unique identifier for each pair-wise interaction, -#' combining Study_site, Recruit, and Canopy species), -#' Recruit(recruit species), -#' Canopy (canopy speices), -#' Study_site (name of the study site), -#' Canopy_Freq and Open_Freq with the number of recuits observed -#' under that canopy species or in the Open, respectively and Canopy_cover and -#' Open_cover, with the percentage of the total area sampled in the Study_site -#' occupied by that canopy species and Open respectively. -#' Freq_tot is the sum of Canopy_Freq and Open_Freq (total number of recruits -#' of that speices observed in the area sampled in the Study_site). -#' -#' @noRd -#' -#' @examples -#' db_sp_rec <- recruit_level (RecruitNet, CanopyCover) - -recruit_level <- function(inter_data = RecruitNet, - cover_data = CanopyCover - ) { - - options(dplyr.summarise.inform = FALSE) - - data <- inter_data - dbcover <- cover_data - - db_inter <- pre_asocindex(data, dbcover) - - db_sp_rec <- data.frame( - db_inter |> - dplyr::group_by(Study_site, Recruit) |> - dplyr::summarise( - Canopy_Freq = sum(Canopy_Freq, na.rm = TRUE), - Open_Freq = unique(Open_Freq, na.rm = TRUE), - Open_cover = unique(Open_cover, na.rm = TRUE), - Canopy_cover = 100 - unique(Open_cover, na.rm = TRUE) - ) - ) - - return(db_sp_rec) - -} diff --git a/R/sig_test.R b/R/sig_test.R deleted file mode 100644 index 972a7a6..0000000 --- a/R/sig_test.R +++ /dev/null @@ -1,138 +0,0 @@ -#' Calculate significance test of association -#' -#' @description -#' Calculate a significance tests of association for each row. -#' Rows can be a pair-wise interaction (Recruit species-Canopy species interaction), -#' the number of recruits observed under any canopy species (Recruit species) -#' or the number of Recruits of any given speies under a given canopy species -#' (Canopy species) -#' -#' @param db_inter data frame obtained as the output of the functions -#' pre_asocindex, recruit_level,canopy_level, or com_level -#' @param iteration number of iterations -#' @param threshold minimun number of recruits to perform the binomial test -#' -#' @return data frame with the same structure as the input with three -#' additional columns:int_p (p-value of the binomial test of association), -#' int_sign (the sign of the association, being Posive (or Negative) if the -#' association is stronger (or weaker) than expected by the percentage cover -#' of Canopy and Open, and Neutral if there is not enougth power to conduct -#' the test, stdres (standarized resdual quantifying the difference between -#' the observed and expected values), and testability (indicating whether -#' the sample size allow to conduct or not the test being Non-testable those -#' rows in which int_sign = Neutral) -#' -#' @noRd -#' -#' @examples -#' Ventisquero_RN <- comm_subset(RecruitNet, "Ventisquero") -#' Ventisquero_cover <- comm_subset(CanopyCover, "Ventisquero") -#' sig_test(site_level(Ventisquero_RN, Ventisquero_cover)) # overall -#' -#' sig_test(pre_asocindex(Ventisquero_RN, Ventisquero_cover)) # per species - -sig_test <- function(data_freq=db_inter, - iteration = 100, - threshold = 5) { - - db_inter<-data_freq - - - db_inter$int_p <- rep(NA, dim(db_inter)[1]) - db_inter$int_sign <- rep(NA, dim(db_inter)[1]) - - for (i in 1:dim(db_inter)[1]) { - if (sum(db_inter$Canopy_Freq[i] + db_inter$Open_Freq[i]) < 100000) { - test <- - chisq.test2( - c(db_inter$Canopy_Freq[i], db_inter$Open_Freq[i]), - p = c(db_inter$Canopy_cover[i], db_inter$Open_cover[i]), - rescale.p = TRUE, - simulate.p.value = TRUE - ) - db_inter$int_p[i] <- test$p.value - db_inter$stdres[i] <- test$stdres[1] - db_inter$int_sign[i] <- - ifelse( - test$p.value <= 0.05 & - test$stdres[1] > 0, - "Positive", - ifelse( - test$p.value <= 0.05 & test$stdres[1] < 0, - "Negative", - "Neutral" - ) - ) - } - - if (sum(db_inter$Canopy_Freq[i] + db_inter$Open_Freq[i]) >= 100000) { - test <- - chisq.test2( - c(db_inter$Canopy_Freq[i], db_inter$Open_Freq[i]), - p = c(db_inter$Canopy_cover[i], db_inter$Open_cover[i]), - rescale.p = TRUE, - simulate.p.value = FALSE - ) - db_inter$int_p[i] <- test$p.value - db_inter$stdres[i] <- test$stdres[1] - db_inter$int_sign[i] <- - ifelse( - test$p.value <= 0.05 & - test$stdres[1] > 0, - "Positive", - ifelse( - test$p.value <= 0.05 & test$stdres[1] < 0, - "Negative", - "Neutral" - ) - ) - } - - } - - - db_inter$testability <- rep("NA", dim(db_inter)[1]) - - for (i in 1:dim(db_inter)[1]) - { - if (db_inter[i, ]$int_sign != "Neutral") { - db_inter[i, ]$testability <- db_inter[i, ]$int_sign - } - - if (db_inter[i, ]$int_sign == "Neutral" & - sum(db_inter[i, ]$Canopy_Freq + db_inter[i, ]$Open_Freq) > 5) { - db_inter[i, ]$testability <- db_inter[i, ]$int_sign - } - - if (db_inter[i, ]$int_sign == "Neutral" & - sum(db_inter[i, ]$Canopy_Freq + db_inter[i, ]$Open_Freq) < 6) { - n <- sum(db_inter[i, ]$Canopy_Freq + db_inter[i, ]$Open_Freq) - fcan <- - ifelse(db_inter[i, ]$Canopy_cover <= db_inter[i, ]$Open_cover, n, 0) - fopen <- - ifelse(db_inter[i, ]$Open_cover < db_inter[i, ]$Canopy_cover, n, 0) - - db_inter[i, ]$testability <- - ifelse(length(which( - replicate( - iteration, - chisq.test2( - c(fcan, fopen), - p = c(db_inter$Canopy_cover[i], db_inter$Open_cover[i]), - rescale.p = T, - simulate.p = T - )$p.value - ) < 0.05 - )) > threshold, "testable", "non_testable") - } - - db_inter[db_inter$testability == "testable", "testability"] <- - "Neutral" - } - - - - return(db_inter) - - -} diff --git a/R/sign_net.R b/R/sign_net.R deleted file mode 100644 index 6dd6168..0000000 --- a/R/sign_net.R +++ /dev/null @@ -1,103 +0,0 @@ -#' Association significance testing -#' -#' Generate a list with four elements, a data base with the significance tests -#' of association of each interaction (in rows) and three matrices of interaction -#' of positive, negative and neutral interactions, from a study site (for a single sites) -#' -#' @param inter_data data frame with at least four columns: -#' Study_site (unique name of the study site), -#' Recruit (species of the recruit), -#' Canopy (species of the canopy, or "Open"), and -#' Frequency (number of recruits of that species observed under that canopy species -#' in any plot, with "Open" representing recruits observed without a canopy species). -#' -#' @param cover_data data frame with at least five columns: -#' Study_site (unique name of the study site), -#' Plot (unique name of each plot within a study site), -#' Canopy (species of the canopy), -#' Cover (percentage of cover of that species in that plot), and -#' Sampled_distance_or_area (total area of that plot or length in the case of transects). -#' -#' @param site is the name of the Study_site -#' -#' @param type is a character that identifies which hypothesis is being tested with three options: -#' 1) "by_pairwise_interaction": whether the number of recuits of each recruit species under each canopy species is significantly different from -#' the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively. -#' 2) "by_recruit_sp": whether the number of recuits of each recruit species under any canopy species (all together) is significantly different from -#' the number observed in the open, considering the percentage of cover of all canopy species together and open area (i.e.bare ground), respectively. -#' 3) "by_canopy_sp": whether the number of recuits of any recruit species (all together) under a given canopy species is significantly different from -#' the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively -#' -#' @return a list with four elements. The first element data frame with the -#' same structure as the input with three additional columns: -#' int_p (p-value of the binomial test of association), -#' int_sign (the sign of the association, being Posive (or Negative) if the -#' association is stronger (or weaker) than expected by the percentage cover -#' of Canopy and Open, and Neutral if there is not enought power to conduct the test, -#' stdres (standarized resdual quantifying the difference between the observed -#' and expected values), and -#' testability (indicating whether the sample size allow to conduct or not the test -#' being Non-testable those rows in which int_sign = Neutral). -#' The second, third and fourth elements of teh list are the matrices of only positive, -#' negative and neutral ( testable) associations based on the database generated in the first element of the list. -#' -#' @export -#' -#' @examplesIf interactive() -#' -#' sign_vest <- sign_net(RecruitNet, CanopyCover, "Ventisquero", "by_pairwise_interaction" ) - - -sign_net <- function(inter_data, cover_data, site, type) { - - inter <- droplevels(RecruitNet[RecruitNet$Study_site == site, ]) - cover <- droplevels(CanopyCover[CanopyCover$Study_site == site, ]) - site <- unique(inter$Study_site) - -if (type == "by_pairwise_interaction") { pre_index_all <- pre_asocindex(inter, cover)} -if (type == "by_recruit_sp") {pre_index_all <- recruit_level(inter, cover)} -if (type == "by_canopy_sp") {pre_index_all <- canopy_level(inter, cover)} - - - pre_index_all$Frequency <- pre_index_all$Canopy_Freq - - db_inter <- sig_test(pre_index_all) - - db_inter$fij <- db_inter$Canopy_Freq - - pos <- droplevels(db_inter[db_inter$testability == "Positive", ]) - neg <- droplevels(db_inter[db_inter$testability == "Negative", ]) - neu <- droplevels(db_inter[db_inter$testability == "Neutral", ]) - - cov_pos <- droplevels(cover[cover$Canopy %in% unique(pos$Canopy), ]) - cov_neg <- droplevels(cover[cover$Canopy %in% unique(neg$Canopy), ]) - cov_neu <- droplevels(cover[cover$Canopy %in% unique(neu$Canopy), ]) - - posRN <- comm_to_RN(pos, cov_pos, unique(pos$Study_site)) - negRN <- comm_to_RN(neg, cov_pos, unique(neg$Study_site)) - neuRN <- comm_to_RN(neu, cov_pos, unique(neu$Study_site)) - - pos_net <- RN_to_matrix(posRN[, c("Canopy", "Recruit", "fij")]) - pos_net <- pos_net[rowSums(pos_net) > 0, colSums(pos_net) > 0] - - neg_net <- RN_to_matrix(negRN[, c("Canopy", "Recruit", "fij")]) - neg_net <- neg_net[rowSums(neg_net) > 0, colSums(neg_net) > 0] - - neu_net <- RN_to_matrix(neuRN[, c("Canopy", "Recruit", "fij")]) - neu_net <- neu_net[rowSums(neu_net) > 0, colSums(neu_net) > 0] - - - sign_networks <- list() - - sign_networks[[1]] <- db_inter - sign_networks[[2]] <- pos_net - sign_networks[[3]] <- neg_net - sign_networks[[4]] <- neu_net - - names(sign_networks)[1] <- "All_interactions_db" - names(sign_networks)[2] <- "Positive_interactions" - names(sign_networks)[3] <- "Negative_interactions" - names(sign_networks)[4] <- "Neutral_interactions" - - return(sign_networks) -} diff --git a/R/site_level.R b/R/site_level.R deleted file mode 100644 index fcac079..0000000 --- a/R/site_level.R +++ /dev/null @@ -1,91 +0,0 @@ -#' TODO: title -#' -#' Calculate in separate columns the total number of recruits (of any species) -#' under any species of canopy and in the open and its respective percentage of -#' cover (either for multiple or a single site). -#' -#' @param inter_data data frame with at least four columns: -#' Study_site (unique name of the study site), -#' Recruit (species of the recruit), -#' Canopy (species of the canopy, or "Open"), and -#' Frequency (number of recruits of that species observed under that canopy species -#' in any plot, with "Open" representing recruits observed without a canopy species). -#' -#' @param cover_data data frame with at least five columns: -#' Study_site (unique name of the study site), -#' Plot (unique name of each plot within a study site), -#' Canopy (species of the canopy), -#' Cover (percentage of cover of that species in that plot), and -#' Sampled_distance_or_area (total area of that plot or length in the case of transects). -#' -#' @return data frame with one row per site and nine columns: -#' inter_ID (a unique identifier for each pair-wise interaction, -#' combining Study_site, Recruit, and Canopy species), -#' Recruit(recruit species), Canopy (canopy speices), -#' Study_site (name of the study site), -#' Canopy_Freq and Open_Freq with the number of recuits observed under -#' that canopy species or in the Open, respectively and -#' Canopy_cover and Open_cover, with the percentage of the total area sampled -#' in the Study_site occupied by that canopy species and Open respectively. -#' Freq_tot is the sum of Canopy_Freq and Open_Freq (total number of recruits -#' of that speices observed in the area sampled in the Study_site). -#' -#' @noRd -#' -#' @examples -#' db_sp_com <- site_level (RecruitNet, CanopyCover) - - -site_level <- function(inter_data = RecruitNet, - cover_data = CanopyCover) { - - options(dplyr.summarise.inform = FALSE) - - data <- inter_data - dbcover <- cover_data - - db_inter <- pre_asocindex(data, dbcover) - - db_sp_can <- data.frame( - db_inter |> - dplyr::group_by(Study_site, Canopy) |> - dplyr::summarise( - Canopy_Freq = sum(Canopy_Freq, na.rm = TRUE), - Open_cover = unique(Open_cover, na.rm = TRUE), - Canopy_cover = unique(Canopy_cover, na.rm = TRUE) - ) - ) - - Rec_open <- data.frame( - db_inter |> - dplyr::group_by(Study_site, Recruit) |> - dplyr::summarise(Open_Freq = unique(Open_Freq, na.rm = TRUE)) - ) - - Rec_open <- data.frame(Rec_open |> - dplyr::group_by(Study_site) |> - dplyr::summarise(Open_Freq = sum(Open_Freq, na.rm = TRUE))) - - db_sp_can <- merge(db_sp_can, Rec_open, by = "Study_site") - - db_sp_can <- db_sp_can[, c("Study_site" , - "Canopy" , - "Canopy_Freq", - "Open_Freq", - "Open_cover", - "Canopy_cover")] - - db_com <- data.frame( - db_sp_can |> - dplyr::group_by(Study_site) |> - dplyr::summarise( - Canopy_Freq = sum(Canopy_Freq, na.rm = TRUE), - Open_Freq = unique(Open_Freq, na.rm = TRUE), - Open_cover = unique(Open_cover, na.rm = TRUE), - Canopy_cover = 100 - unique(Open_cover, na.rm = TRUE) - ) - ) - - return(db_com) - -} diff --git a/man/CanopyCover.Rd b/man/CanopyCover.Rd deleted file mode 100644 index aebafe7..0000000 --- a/man/CanopyCover.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datasets.R -\docType{data} -\name{CanopyCover} -\alias{CanopyCover} -\title{CanopyCover} -\format{ -An object of class \code{data.frame} with 26812 rows and 7 columns. -} -\source{ -https://doi.org/10.1002/ecy.3923 -} -\usage{ -CanopyCover -} -\description{ -Canopy cover of plant-plant interactions global database -} -\keyword{datasets} diff --git a/man/RN_to_matrix.Rd b/man/RN_to_matrix.Rd deleted file mode 100644 index 6dd6598..0000000 --- a/man/RN_to_matrix.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RN_to_matrix.R -\name{RN_to_matrix} -\alias{RN_to_matrix} -\title{Function RN_matrixForm} -\usage{ -RN_to_matrix(RNdata = NULL, weight = NULL) -} -\arguments{ -\item{RNdata}{A data frame generated with \code{\link[=comm_subset]{comm_subset()}} or a data.frame -containing columns with all the information needed for the basic analysis of -recruitment networks: canopy species (canopy), recruit species (recruit), -cover of the canopy (cj) and recruit (ci), -and columns with possible weighting variables.} - -\item{weight}{The name of the column of the data frame to be used as weight -variable for the links.} -} -\value{ -A matrix object with the species names as row (recruit species) and -column names (canopy species), and cells indicating the chosen weight for -each interaction. For example, the output of function local_RN provides the -number of recruits of species i interacting with canopy species j (fij), -the number of plots (i.e. incidence) where the interaction has been found (Tij), -and the binary presence/absence of the interaction in the whole study site (Pij). -Can be used as bipartite input. -} -\description{ -For some analyses, the data must be stored as a matrix rather than data frame. -The next function takes a RN stored as data frame and transforms it into a matrix. -The output matrix can be used input for bipartite package. -} -\examples{ -data(RecruitNet) -data(CanopyCover) -Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero") -Ventisquero_matrix <- RN_to_matrix(Ventisquero_RNc, weight = "fij") -Ventisquero_matrix <- RN_to_matrix(Ventisquero_RNc, weight = "Tij") -} diff --git a/man/RecruitNet.Rd b/man/RecruitNet.Rd deleted file mode 100644 index 7d6c63a..0000000 --- a/man/RecruitNet.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datasets.R -\docType{data} -\name{RecruitNet} -\alias{RecruitNet} -\title{RecruitNet} -\format{ -An object of class \code{data.frame} with 135210 rows and 26 columns. -} -\source{ -https://doi.org/10.1002/ecy.3923 -} -\usage{ -RecruitNet -} -\description{ -Plant-plant interactions global database -} -\keyword{datasets} diff --git a/man/RecruitNetP-package.Rd b/man/RecruitNetP-package.Rd deleted file mode 100644 index 12dd607..0000000 --- a/man/RecruitNetP-package.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RecruitnetP-package.R -\docType{package} -\name{RecruitNetP-package} -\alias{RecruitNetP} -\alias{RecruitNetP-package} -\title{RecruitNetP: Analysis of Recruitment Networks} -\description{ -Analyze recruitment networks and patterns of plant-plant interactions. -} -\seealso{ -Useful links: -\itemize{ - \item \url{https://github.com/EcologyR/RecruitNetP} - \item Report bugs at \url{https://github.com/EcologyR/RecruitNetP/issues} -} - -} -\author{ -\strong{Maintainer}: Francisco Rodriguez-Sanchez \email{f.rodriguez.sanc@gmail.com} (\href{https://orcid.org/0000-0002-7981-1599}{ORCID}) [copyright holder] - -Authors: -\itemize{ - \item Alicia Montesinos-Navarro \email{alimontesinos@gmail.com} (\href{https://orcid.org/0000}{ORCID}) [copyright holder] - \item José Luis Garrido \email{jlgarridosan@gmail.com} (\href{https://orcid.org/0000}{ORCID}) [copyright holder] - \item Miguel Verdú \email{Miguel.Verdu@ext.uv.es} (\href{https://orcid.org/0000}{ORCID}) [copyright holder] - \item Julio M. Alcántara \email{jmalcan@ujaen.es} (\href{https://orcid.org/0000}{ORCID}) [copyright holder] -} - -} -\keyword{internal} diff --git a/man/associndex.Rd b/man/associndex.Rd deleted file mode 100644 index 501772f..0000000 --- a/man/associndex.Rd +++ /dev/null @@ -1,76 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/associndex.R -\name{associndex} -\alias{associndex} -\title{Calculate interaction strength indices} -\usage{ -associndex( - int_data = NULL, - cover_data = NULL, - area_sampled = NULL, - thr_dens = 100 -) -} -\arguments{ -\item{int_data}{data frame with at least four columns: -\itemize{ -\item Study_site (unique name of the study site), -\item Recruit (species of the recruit), -\item Canopy (species of the canopy, or "Open"), and -\item Frequency (number of recruits of that species observed under that -canopy species in any plot, with "Open" representing recruits observed -without a canopy species). -If available, the dimensions of the study plots can be also included as -variables PlotdimX and PlotdimY. -}} - -\item{cover_data}{data frame with at least five columns: -\itemize{ -\item Study_site (unique name of the study site), -\item Plot (unique name of each plot within a study site), -\item Canopy (species of the canopy), -\item Cover (percentage of cover of that species in that plot), and -\item Sampled_distance_or_area (total area of the plot). -}} - -\item{area_sampled}{Total area surveyed in the study site (in m2).} - -\item{thr_dens}{Maximum density considered as reasonable. For example, if a canopy species is rare -(e.g. 0.01 m2) but there is one sapling growing beneath, we would estimate a density of 100 saplings/m2 -for this interaction, what is likely an overestimate because it seems reasonable that increasing the -effort under this canopy species we would obtain a much lower density estimate. The threshold is set -by default to 100 recruits/m2.} -} -\value{ -data frame with indices of pair-wise interaction strength and the data neeeded for their estimation. -Each row corresponds to each pair-wise interaction, and contains the following columns: -Recruit: recruit species. -Canopy: canopy species. -inter_ID: a unique identifier for each pair-wise interaction, combining Study_site, Recruit, and Canopy species. -Study_site: name of the study site. -Canopy_Freq: number of recruits found in the vicinity of the canopy species. -Open_Freq: number of recruits found in open spaces. -Canopy_cover: percentage of the total area sampled in the study site occupied by the canopy species. -Open_cover: percentage of the total area sampled in the study site occupied by Open spaces. -Freq_tot: sum of Canopy_Freq and Open_Freq (total number of recruits of the recruit species in the area sampled -in the study site. -RecrDens_canopy: density of recruits under the canopy species (recruits/m2). -RecrDens_open: density of recruits in open spaces (recruits/m2). -Max_Recr_Density: maximum recruitment density between under the canopy species vs in open spaces. -max_Recr: maximum recruitment density of the recruit species in the study site. -Ns: Normalized Neighbour Suitability index (Mingo, 2014). -NintC: commutative symmetry intensity index (Díaz-Sierra et al., 2017) -NintA:additive symmetry intensity index (Díaz-Sierra et al., 2017) -RII: Relative Interaction Index (Armas et al., 2004). -} -\description{ -Calculate interaction strength indices -} -\examples{ -data(RecruitNet) -data(CanopyCover) -int_data <- comm_subset(RecruitNet, site = "Ventisquero") -cover_data <- CanopyCover[CanopyCover$Study_site == "Ventisquero", ] -Ventisquero_int <- associndex(int_data, cover_data) - -} diff --git a/man/comm_subset.Rd b/man/comm_subset.Rd deleted file mode 100644 index 0961b05..0000000 --- a/man/comm_subset.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/comm_subset.R -\name{comm_subset} -\alias{comm_subset} -\title{Subset sites} -\usage{ -comm_subset(dataset = NULL, site = NULL) -} -\arguments{ -\item{dataset}{A data frame containing recruitment data.} - -\item{site}{character. Name of a study site within the dataset or -a character vector with the names of several study sites.} -} -\value{ -A data frame containing all the data from the desired community/ies -} -\description{ -This function extracts the information of a given local community and -stores it in a separate data frame. It can also extract more than one site. -} -\examples{ -data(RecruitNet) - -Ventisquero <- comm_subset(RecruitNet, site = "Ventisquero") - -TwoSites <- comm_subset(RecruitNet, c("Ventisquero","Agadir")) -} diff --git a/man/comm_summary.Rd b/man/comm_summary.Rd deleted file mode 100644 index dd4f4b8..0000000 --- a/man/comm_summary.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/comm_summary.R -\name{comm_summary} -\alias{comm_summary} -\title{Summarise metadata of a community} -\usage{ -comm_summary(dataset = NULL) -} -\arguments{ -\item{dataset}{A data frame for a single site (or a group of sites). -For example, a data frame created with \code{\link[=comm_subset]{comm_subset()}}. This function relies on -the variable names used in the original RecruitNet database, so it cannot be used -with other datasets unless they follow exactly the ordering and the names used in RecruitNet.} -} -\value{ -A data frame with summary information of the local community/ies. -} -\description{ -This function provides a summary of the characteristics (i.e. metadata) of -a local community. -} -\examples{ -All_sites_details <- comm_summary(RecruitNet) -Ventisquero <- comm_subset(RecruitNet, site = "Ventisquero") -Ventisquero_details <- comm_summary(Ventisquero) -} diff --git a/man/comm_to_RN.Rd b/man/comm_to_RN.Rd deleted file mode 100644 index cf5e16b..0000000 --- a/man/comm_to_RN.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/comm_to_RN.R -\name{comm_to_RN} -\alias{comm_to_RN} -\title{Merge cover data with interaction data for a given site} -\usage{ -comm_to_RN(RN_data = NULL, cover_data = NULL, site = NULL) -} -\arguments{ -\item{RN_data}{data set where recruitment networks are stored. -Usually, it will be "RecruitNet" (or the name assigned to the dataset when it was imported).} - -\item{cover_data}{data set where cover data is stored. -Usually, it will be "CanopyCover" (or the name assigned to the dataset -"CanopyCover.csv" when it was imported).} - -\item{site}{name of the study site.} -} -\value{ -A data.frame containing 7 columns with all the information needed -for the basic analysis of recruitment networks and canopy-recruit interactions: -canopy species (Canopy), recruit species (Recruit), recruitment frequency (fij), -Tij = TODO, -Pij = TODO, -cover of the canopy (cj) and cover of the recruit (ci). -} -\description{ -This function returns a data frame that merges the information from the -recruitment network and species cover for a local community. -It is a shortcut to directly obtain the data for a local community -from the RecruitNet dataset. -} -\examples{ -data(RecruitNet) -data(CanopyCover) -Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero") -} diff --git a/man/download_RN.Rd b/man/download_RN.Rd deleted file mode 100644 index 5b70cb9..0000000 --- a/man/download_RN.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/download_RN.R -\name{download_RN} -\alias{download_RN} -\title{Download RecruitNet database} -\usage{ -download_RN(path = getwd(), destfile = "RN.zip", unzip = TRUE) -} -\arguments{ -\item{path}{character. Path to folder where the RecruitNet database should be saved.} - -\item{destfile}{character. Name of the zip file to be saved.} - -\item{unzip}{Logical. Uncompress the zip file? Default is TRUE.} -} -\value{ -A zip file or two CSV files, depending if unzip is TRUE. -} -\description{ -Download latest version of the RecruitNet database (Verdú et al. 2023, -\doi{doi:10.1002/ecy.3923}). -} -\examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -download_RN() -\dontshow{\}) # examplesIf} -} diff --git a/man/funtopol.Rd b/man/funtopol.Rd deleted file mode 100644 index d9bd577..0000000 --- a/man/funtopol.Rd +++ /dev/null @@ -1,56 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/funtopol.R -\name{funtopol} -\alias{funtopol} -\title{Functional topology of a recruitment network.} -\usage{ -funtopol(int_data) -} -\arguments{ -\item{int_data}{Data frame with columns named "Canopy" and "Recruit" identifying -observed interactions (i.e. interactions with frequency > 0).} -} -\value{ -The function returns two outputs: a data frame with the numeric summary of the -functional structure and a list containing the lists of species of each functional -type (core, satellite, strict transients and disturbance-dependent transients). -} -\description{ -Alcantara & Rey (2012) derived a qualitative way to infer potential species -persistence from their position in the RNs based on a combination of non-negative -matrix theory and graph theory. Basically, directed unipartite graphs can be -unambiguously dissected into 'SCCs'. SCCs are the largest possible subgroups of -nodes connected so that all the nodes in a subgroup can be reached from all others -following the directions of the links. In the case of RNs, we can define five -types of SCCs which play different functional roles: -\itemize{ -\item The "core" of the network is the SCC formed by the largest number of species. -All species in the core must recruit, at least, in the vicinity of another core -species, and allow the recruitment of at least another core species. -\item “Satellites” are non-core species that can be reached from some core species, -following the direction of the arrows. For example, a satellite species is one -that recruits in the vicinity of some core species but that does not show -recruitment of any species in its vicinity. -\item "Disturbance-dependent transients" are species that can be reached from the open -node but not from core or satellite species (i.e. for example, species that only -recruit away from established plants). -\item "Strict transients" are species that cannot be reached from any other node (i.e. -those that do not recruit in the studied local assemblage). -} - -Assuming that the dynamics of the system is linear and time-invariant (LTI dynamics), -like in Markov models (Horn, 1975, Siles et al., 2008), only core and satellite -species will persist in equilibrium in the absence of disturbance. When the dynamics -are non-linear, this result cannot be guaranteed to hold, but simulations have shown -that the probability of persistence is higher and the time to extinction is longer -for core and satellite than for transient species (Alcantara et al., 2017). The sum -of core and satellite species is a qualitative approximation to the number of species -that can potentially persist. -} -\examples{ -data(RecruitNet) -int_data <- comm_subset(RecruitNet, site = "Ventisquero") -Ventisquero_funtopol <- funtopol(int_data) -Ventisquero_funtopol$Descriptors -Ventisquero_funtopol$Functional_classification -} diff --git a/man/link_completeness.Rd b/man/link_completeness.Rd deleted file mode 100644 index 37bed4c..0000000 --- a/man/link_completeness.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/link_completeness.R -\name{link_completeness} -\alias{link_completeness} -\title{Link_completeness} -\usage{ -link_completeness( - dataset = NULL, - site = NULL, - type = c("incidence", "abundance") -) -} -\arguments{ -\item{dataset}{The name of the data set where recruitment networks are stored. -Usually, it will be "RecruitNet" (or the name assigned to the data set when -it was imported). At least, the data set must contain columns named -"Study_site", "Plot", "Canopy", "Recruit" and "Frequency". -In data sets containing a single site or a single plot, -the corresponding columns must be included anyway.} - -\item{site}{The name of a study site.} - -\item{type}{Can take two values: "incidence" or "abundance". -Estimates based on incidence data are recommended, but can only be obtained -if your data set is structured in multiple plots. Alternatively, for data -collected in a single plot, estimates can be based only on abundance data.} -} -\value{ -A data frame TODO -} -\description{ -Observed and estimated number of links, and link completeness. -Methods based in Chao et al. (2014) as implemented in R package iNEXT. -} -\examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -link_completeness(RecruitNet, "Ventisquero", "incidence") -link_completeness(RecruitNet, "Laxe", "abundance") -link_completeness(RecruitNet, "Laxe", "incidence") # Issues a warning -link_completeness(RecruitNet, "LosReyes", "abundance") -link_completeness(RecruitNet, "LosReyes", "incidence") #Issues an error -\dontshow{\}) # examplesIf} -} diff --git a/man/sign_net.Rd b/man/sign_net.Rd deleted file mode 100644 index 253a685..0000000 --- a/man/sign_net.Rd +++ /dev/null @@ -1,60 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sign_net.R -\name{sign_net} -\alias{sign_net} -\title{Association significance testing} -\usage{ -sign_net(inter_data, cover_data, site, type) -} -\arguments{ -\item{inter_data}{data frame with at least four columns: -Study_site (unique name of the study site), -Recruit (species of the recruit), -Canopy (species of the canopy, or "Open"), and -Frequency (number of recruits of that species observed under that canopy species -in any plot, with "Open" representing recruits observed without a canopy species).} - -\item{cover_data}{data frame with at least five columns: -Study_site (unique name of the study site), -Plot (unique name of each plot within a study site), -Canopy (species of the canopy), -Cover (percentage of cover of that species in that plot), and -Sampled_distance_or_area (total area of that plot or length in the case of transects).} - -\item{site}{is the name of the Study_site} - -\item{type}{is a character that identifies which hypothesis is being tested with three options: -\enumerate{ -\item "by_pairwise_interaction": whether the number of recuits of each recruit species under each canopy species is significantly different from -the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively. -\item "by_recruit_sp": whether the number of recuits of each recruit species under any canopy species (all together) is significantly different from -the number observed in the open, considering the percentage of cover of all canopy species together and open area (i.e.bare ground), respectively. -\item "by_canopy_sp": whether the number of recuits of any recruit species (all together) under a given canopy species is significantly different from -the number observed in the open, considering the percentage of cover of that canopy species and open area (i.e.bare ground), respectively -}} -} -\value{ -a list with four elements. The first element data frame with the -same structure as the input with three additional columns: -int_p (p-value of the binomial test of association), -int_sign (the sign of the association, being Posive (or Negative) if the -association is stronger (or weaker) than expected by the percentage cover -of Canopy and Open, and Neutral if there is not enought power to conduct the test, -stdres (standarized resdual quantifying the difference between the observed -and expected values), and -testability (indicating whether the sample size allow to conduct or not the test -being Non-testable those rows in which int_sign = Neutral). -The second, third and fourth elements of teh list are the matrices of only positive, -negative and neutral ( testable) associations based on the database generated in the first element of the list. -} -\description{ -Generate a list with four elements, a data base with the significance tests -of association of each interaction (in rows) and three matrices of interaction -of positive, negative and neutral interactions, from a study site (for a single sites) -} -\examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -sign_vest <- sign_net(RecruitNet, CanopyCover, "Ventisquero", "by_pairwise_interaction" ) -\dontshow{\}) # examplesIf} -} diff --git a/tests/testthat/test-RN_to_matrix.R b/tests/testthat/test-RN_to_matrix.R deleted file mode 100644 index bebafcd..0000000 --- a/tests/testthat/test-RN_to_matrix.R +++ /dev/null @@ -1,161 +0,0 @@ -test_that("RN_to_matrix works", { - data(RecruitNet) - data(CanopyCover) - Ventisquero_RNc <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero") - out <- RN_to_matrix(Ventisquero_RNc, weight = "fij") - expect_equal(out, - structure(c(2L, 0L, 0L, 20L, 1L, 1L, 2L, 0L, 19L, 2L, 5L, 13L, - 13L, 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 2L, 1L, 0L, 0L, 3L, 2L, 0L, 11L, 0L, 1L, 2L, - 0L, 5L, 1L, 0L, 3L, 8L, 2L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 4L, - 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 19L, - 3L, 0L, 6L, 0L, 12L, 7L, 2L, 40L, 16L, 2L, 59L, 41L, 16L, 1L, - 2L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 2L, - 0L, 0L, 0L, 0L, 2L, 0L, 0L, 12L, 0L, 1L, 2L, 0L, 6L, 1L, 0L, - 8L, 5L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 1L, 0L, 2L, 1L, 0L, 0L, 0L, - 2L, 1L, 0L, 3L, 4L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 5L, 6L, 0L, 13L, - 1L, 5L, 2L, 2L, 27L, 10L, 3L, 31L, 82L, 3L, 4L, 0L, 15L, 0L, - 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 3L, 3L, 0L, - 0L, 3L, 3L, 0L, 6L, 0L, 0L, 1L, 0L, 0L, 3L, 0L, 13L, 23L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 193L, 26L, 5L, 422L, 5L, 141L, 163L, 45L, - 306L, 77L, 26L, 435L, 457L, 132L, 1L, 5L, 87L, 13L, 7L, 21L, - 1L, 2L, 4L, 6L, 3L, 3L, 3L, 1L, 4L, 13L, 9L, 11L, 15L, 4L, 9L, - 9L, 0L, 0L, 9L, 5L, 4L, 4L, 0L, 14L, 4L, 15L, 20L, 33L, 11L, - 2L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 2L, 4L, 0L, 1L, 27L, 1L, 0L, 51L, 12L, 14L, 14L, 0L, 82L, - 2L, 7L, 91L, 58L, 13L, 4L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 3L, - 0L, 0L, 0L, 0L, 0L, 1L, 17L, 3L, 2L, 0L, 0L, 3L, 0L, 0L, 2L, - 0L, 0L, 1L, 0L, 17L, 1L, 0L, 7L, 10L, 1L, 1L, 0L, 0L, 0L, 0L, - 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, - 8L, 2L, 1L, 27L, 0L, 12L, 4L, 0L, 57L, 12L, 1L, 22L, 20L, 9L, - 2L, 1L, 2L, 0L, 0L, 2L, 0L, 0L, 2L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, - 1L, 1L, 0L, 0L, 1L, 108L, 27L, 6L, 201L, 9L, 128L, 79L, 29L, - 444L, 56L, 11L, 232L, 40L, 64L, 14L, 2L, 7L, 1L, 0L, 13L, 0L, - 0L, 1L, 8L, 0L, 0L, 0L, 0L, 0L, 7L, 5L, 8L, 19L, 0L, 0L, 24L, - 3L, 0L, 16L, 4L, 22L, 2L, 0L, 16L, 8L, 0L, 31L, 12L, 2L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, - 1L, 0L, 0L, 0L, 0L, 2L, 0L, 5L, 1L, 1L, 0L, 0L, 2L, 2L, 0L, 1L, - 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 1L, 0L, 2L, - 0L, 0L, 1L, 1L, 0L, 0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, - 0L, 1L, 1L, 2L, 0L, 4L, 19L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 3L, 1L, 0L, 0L, 1L, 0L, 6L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 2L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 7L, 0L, 0L, 1L, 1L, 0L, 1L, - 0L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 2L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, - 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, - 0L, 0L, 0L, 0L), dim = 35:36, - dimnames = list(c("Acer_monspessulanum", - "Amelanchier_ovalis", - "Berberis_hispanica", - "Bupleurum_gibraltaricum", - "Cistus_albidus", - "Crataegus_laciniata", - "Crataegus_monogyna", - "Cytisus_scoparius", - "Daphne_gnidium", - "Digitalis_obscura", - "Dorycnium_pentaphyllum", - "Fraxinus_angustifolia", - "Genista_cinerea", - "Helleborus_foetidus", - "Juniperus_oxycedrus", - "Juniperus_phoenicea", - "Lavandula_latifolia", - "Linum_sp", - "Phillyrea_latifolia", - "Pinus_halepensis", - "Pistacia_terebinthus", - "Prunus_mahaleb", - "Prunus_spinosa", - "Quercus_coccifera", - "Quercus_faginea", - "Quercus_ilex", - "Rhamnus_alaternus", - "Rhamnus_lycioides", - "Rhamnus_myrtifolius", - "Rosa_sp1", - "Ruscus_aculeatus", - "Staehelina_dubia", - "Thymus_mastichina", - "Thymus_orospedanus", - "Ulex_parviflorus"), - c("Acer_monspessulanum", - "Amelanchier_ovalis", - "Berberis_hispanica", - "Bupleurum_gibraltaricum", - "Cistus_albidus", - "Crataegus_laciniata", - "Crataegus_monogyna", - "Cytisus_scoparius", - "Daphne_gnidium", - "Digitalis_obscura", - "Dorycnium_pentaphyllum", - "Fraxinus_angustifolia", - "Genista_cinerea", - "Helleborus_foetidus", - "Juniperus_oxycedrus", - "Juniperus_phoenicea", - "Lavandula_latifolia", - "Linum_sp", "Open", - "Phillyrea_latifolia", - "Pinus_halepensis", - "Pistacia_terebinthus", - "Prunus_mahaleb", - "Prunus_spinosa", - "Quercus_coccifera", - "Quercus_faginea", - "Quercus_ilex", - "Rhamnus_alaternus", - "Rhamnus_lycioides", - "Rhamnus_myrtifolius", - "Rosa_sp1", - "Ruscus_aculeatus", - "Staehelina_dubia", - "Thymus_mastichina", - "Thymus_orospedanus", - "Ulex_parviflorus" - )))) - -}) diff --git a/tests/testthat/test-comm_summary.R b/tests/testthat/test-comm_summary.R deleted file mode 100644 index 48bda61..0000000 --- a/tests/testthat/test-comm_summary.R +++ /dev/null @@ -1,31 +0,0 @@ -test_that("comm_summary works", { - Ventisquero <- comm_subset(RecruitNet, site = "Ventisquero") - out <- comm_summary(Ventisquero) - expect_equal(out, - structure( - list( - `Local Community` = "Ventisquero", - Country = "Spain", - Latitude = 37.61555556, - Longitude = -3.734166667, - `Year of sampling` = 2020L, - `Site responsible` = "Julio M. Alcántara", - Biome = "Mediterranean Forests Woodlands and Scrub", - Vegetation = "Forest", - `Plant Community` = "Quercus ilex forest", - `Successional stage` = "Late", - Disturbance = NA, - `Sampling method` = "RN", - `Number of plots` = 20L, - `Plot area (m2)` = 500L, - `Area sampled (m2)` = 10000L, - `Number of plant species` = 43L, - `Contains Open node` = "Yes", - `Number of woody species` = 39L, - `Number of herb species` = 4L, - `Number of other types` = 0L - ), - row.names = "Value", - class = "data.frame" - )) -}) diff --git a/tests/testthat/test-comm_to_RN.R b/tests/testthat/test-comm_to_RN.R deleted file mode 100644 index 39f03ab..0000000 --- a/tests/testthat/test-comm_to_RN.R +++ /dev/null @@ -1,35 +0,0 @@ -test_that("comm_to_RN produces expected output", { - data(RecruitNet) - data(CanopyCover) - out <- comm_to_RN(RecruitNet, CanopyCover, site = "Ventisquero") - - expect_equal(head(out), - structure( - list( - Canopy = c( - "Acer_monspessulanum", - "Acer_monspessulanum", - "Acer_monspessulanum", - "Acer_monspessulanum", - "Acer_monspessulanum", - "Acer_monspessulanum" - ), - Recruit = c( - "Acer_monspessulanum", - "Berberis_hispanica", - "Cistus_albidus", - "Crataegus_monogyna", - "Daphne_gnidium", - "Helleborus_foetidus" - ), - fij = c(2L, 0L, 0L, 20L, 1L, 1L), - Tij = c(1L, 0L, 0L, 8L, 1L, 1L), - Pij = c(1L, 0L, 0L, 1L, 1L, 1L), - cj = c(96.39, 96.39, 96.39, 96.39, 96.39, 96.39), - ci = c(96.39, 31.39, 10.15, 214.34, 32.14, 12.76) - ), - row.names = c(NA, 6L), - class = "data.frame" - )) - -}) diff --git a/tests/testthat/test-link_completeness.R b/tests/testthat/test-link_completeness.R deleted file mode 100644 index 2a9c472..0000000 --- a/tests/testthat/test-link_completeness.R +++ /dev/null @@ -1,23 +0,0 @@ -test_that("link_completeness works", { - data(RecruitNet) - - out <- link_completeness(RecruitNet, "Ventisquero", "incidence") - expect_equal(out, structure( - list(`Incidence based estimate` = c(299, 488.535555555556, 0.612033242206868, 0.8813)), - class = "data.frame", - row.names = c("Lobs", "Lest", "Completeness Links (q=0)", "Coverage Links (q=1)") - )) - - - out <- link_completeness(RecruitNet, "Laxe", "abundance") - expect_equal(out, structure( - list(`Abundance based estimate` = c(99, 115.660283416316, 0.855955018229141, 0.9923)), - class = "data.frame", - row.names = c("Lobs", "Lest", "Completeness of links (q=0)", "Coverage of links (q=1)") - )) - - expect_warning(link_completeness(RecruitNet, "Laxe", "incidence")) - - expect_error(link_completeness(RecruitNet, "LosReyes", "incidence")) - -})