From 2d7445f329041150fff3da607a3b54158373d744 Mon Sep 17 00:00:00 2001 From: Daniel Falster Date: Fri, 3 Nov 2023 18:20:43 +1100 Subject: [PATCH] remove tests on traits.build functions (#782) These tests are no longer needed as functions and tests have been migrated to https://github.com/traitecoevo/traits.build Closes #780 --- tests/testthat/R/custom_R_code.R | 4 - tests/testthat/build.R | 34 -- tests/testthat/config/.gitignore | 2 - tests/testthat/config/metadata.yml | 73 ---- tests/testthat/config/taxon_list-orig.R | 5 - tests/testthat/config/taxon_list-orig.csv | 8 - tests/testthat/config/taxon_list.csv | 8 - tests/testthat/config/testgit.zip | Bin 5648 -> 0 bytes tests/testthat/config/traits.yml | 77 ----- tests/testthat/config/unit_conversions.csv | 149 -------- tests/testthat/data/Test_2022/.gitignore | 1 - tests/testthat/data/Test_2022/data.csv | 46 --- .../testthat/data/Test_2022/test-metadata.yml | 319 ------------------ tests/testthat/data/metadata.yml | 39 --- tests/testthat/data/test.bib | 11 - tests/testthat/data/test2.bib | 13 - tests/testthat/examples/test1-data.csv | 46 --- tests/testthat/examples/test1-metadata.yml | 316 ----------------- tests/testthat/examples/test2-data.csv | 46 --- tests/testthat/examples/test2-metadata.yml | 317 ----------------- tests/testthat/examples/test2.1-metadata.yml | 317 ----------------- tests/testthat/examples/test3-data.csv | 46 --- tests/testthat/examples/test3-metadata.yml | 318 ----------------- tests/testthat/examples/test4-data.csv | 34 -- tests/testthat/examples/test4-metadata.yml | 195 ----------- tests/testthat/functions.R | 126 ------- tests/testthat/helper.R | 3 - tests/testthat/test-get.R | 14 - tests/testthat/test-process.R | 52 --- tests/testthat/test-setup.R | 245 -------------- tests/testthat/test-utils.R | 62 ---- tests/testthat/test-xamples.R | 156 --------- 32 files changed, 3082 deletions(-) delete mode 100644 tests/testthat/R/custom_R_code.R delete mode 100644 tests/testthat/build.R delete mode 100644 tests/testthat/config/.gitignore delete mode 100644 tests/testthat/config/metadata.yml delete mode 100644 tests/testthat/config/taxon_list-orig.R delete mode 100644 tests/testthat/config/taxon_list-orig.csv delete mode 100644 tests/testthat/config/taxon_list.csv delete mode 100644 tests/testthat/config/testgit.zip delete mode 100644 tests/testthat/config/traits.yml delete mode 100644 tests/testthat/config/unit_conversions.csv delete mode 100644 tests/testthat/data/Test_2022/.gitignore delete mode 100644 tests/testthat/data/Test_2022/data.csv delete mode 100644 tests/testthat/data/Test_2022/test-metadata.yml delete mode 100644 tests/testthat/data/metadata.yml delete mode 100644 tests/testthat/data/test.bib delete mode 100644 tests/testthat/data/test2.bib delete mode 100644 tests/testthat/examples/test1-data.csv delete mode 100644 tests/testthat/examples/test1-metadata.yml delete mode 100644 tests/testthat/examples/test2-data.csv delete mode 100644 tests/testthat/examples/test2-metadata.yml delete mode 100644 tests/testthat/examples/test2.1-metadata.yml delete mode 100644 tests/testthat/examples/test3-data.csv delete mode 100644 tests/testthat/examples/test3-metadata.yml delete mode 100644 tests/testthat/examples/test4-data.csv delete mode 100644 tests/testthat/examples/test4-metadata.yml delete mode 100644 tests/testthat/functions.R delete mode 100644 tests/testthat/helper.R delete mode 100644 tests/testthat/test-get.R delete mode 100644 tests/testthat/test-process.R delete mode 100644 tests/testthat/test-setup.R delete mode 100644 tests/testthat/test-utils.R delete mode 100644 tests/testthat/test-xamples.R diff --git a/tests/testthat/R/custom_R_code.R b/tests/testthat/R/custom_R_code.R deleted file mode 100644 index d856f1e64..000000000 --- a/tests/testthat/R/custom_R_code.R +++ /dev/null @@ -1,4 +0,0 @@ - -# Put any functions you use in custom R code here - - diff --git a/tests/testthat/build.R b/tests/testthat/build.R deleted file mode 100644 index 0b77a4e27..000000000 --- a/tests/testthat/build.R +++ /dev/null @@ -1,34 +0,0 @@ -# This file is automatically generated from traits.build -# package, via the file remake.yml.whisker: -# edit the file there (or the files that it includes). - -# Load R resources -library(traits.build) - -# Load data resources -schema <- get_schema() -resource_metadata <- get_schema("config/metadata.yml", "metadata") -definitions <- get_schema("config/traits.yml", "traits") -unit_conversions <- get_unit_conversions("config/unit_conversions.csv") -taxon_list <- read_csv_char("config/taxon_list.csv") - -# Build each source -Test_2022_config <- dataset_configure("data/Test_2022/metadata.yml", definitions) -Test_2022_raw <- dataset_process("data/Test_2022/data.csv", Test_2022_config, schema, resource_metadata, unit_conversions) -Test_2022 <- build_update_taxonomy(Test_2022_raw, taxon_list) - - -austraits_raw <- build_combine( - Test_2022, - NULL) - -# Version information -version_number <- util_get_version("config/metadata.yml") -git_SHA <- util_get_SHA() - -# Combine all the source into one resource -austraits <- build_add_version(austraits_raw, version_number, git_SHA) - -# Save to file -dir.create("export/data/curr", FALSE, TRUE) -saveRDS(austraits, "export/data/curr/austraits.rds") diff --git a/tests/testthat/config/.gitignore b/tests/testthat/config/.gitignore deleted file mode 100644 index a04c39f6a..000000000 --- a/tests/testthat/config/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#keep this file -taxon_list.csv diff --git a/tests/testthat/config/metadata.yml b/tests/testthat/config/metadata.yml deleted file mode 100644 index 7f92c4ed3..000000000 --- a/tests/testthat/config/metadata.yml +++ /dev/null @@ -1,73 +0,0 @@ -metadata: - title: 'AusTraits: a curated plant trait database for the Australian flora' - description: "AusTraits is a transformative database, containing measurements on the traits of Australia's plant taxa, standardised from hundreds of disconnected primary sources. While this repository contains the harmonised data, the raw data and code used to build the resource are also available on the project's GitHub repository,http://traitecoevo.github.io/austraits.build. Further information on the project is available in the associated publication and at the project website https://austraits.org." - version: "4.0.0" - doi: 10.5281/zenodo.5112001 - structure_URI: https://github.com/traitecoevo/austraits.build - geo_location: - geo_location_place: Australia - geodetic_datum: EPSG:4326 - language: en - related_identifiers: - - related_identifier_type: url - identifier: https://github.com/traitecoevo/austraits.build/tree/v3.0.2 - relation_type: isCompiledBy - resource_type: dataset - - related_identifier_type: doi - identifier: 10.1038/s41597-021-01006-6 - relation_type: isCitedBy - resource_type: publication-article - references: "Falster, Gallagher et al (2021) *AusTraits, a curated plant trait database for the Australian flora*. Scientific Data 8: 254, https://doi.org/10.1038/s41597-021-01006-6" - publisher: Zenodo - publication_date: 27 Nov 2022 - license: - rights: CC-BY-4.0 - rights_holder: Falster, Daniel - rights_URI: https://creativecommons.org/licenses/by/4.0/ - description: Under this license, the material can be copied and redistributed in any medium or format. It can be remixed, transformed, and built upon for any purpose, even commercially. Re-users must give appropriate credit, provide a link to the license, and indicate if changes were made. Re-users may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. - subject: - subject_scheme: ANZSRC Field of Research - scheme_URI: https://linked.data.gov.au/def/anzsrc-for/2020/ - value_URI: - - https://linked.data.gov.au/def/anzsrc-for/2020/3103 - - https://linked.data.gov.au/def/anzsrc-for/2020/3104 - - https://linked.data.gov.au/def/anzsrc-for/2020/4104 - - https://linked.data.gov.au/def/anzsrc-for/2020/300703 - - https://linked.data.gov.au/def/anzsrc-for/2020/060705 - - https://linked.data.gov.au/def/anzsrc-for/2020/050202 - - https://linked.data.gov.au/def/anzsrc-for/2020/060208 - - https://linked.data.gov.au/def/anzsrc-for/2020/069902 - funding_reference: - - funder_name: Australian Research Data Commons (ARDC) - award_IRI: doi.org/10.47486/DP720 - award_number: DP720 - award_title: AusTraits, A national database on the traits of Australia's complete flora. - - funder_name: Australian Research Data Commons (ARDC) - award_IRI: doi.org/10.47486/TD044 - award_number: TD044 - award_title: AusTraits, A national database on the traits of Australia's complete flora. - - funder_name: Australian Research Council - award_IRI: purl.org/au-research/grants/arc/DE170100208 - award_number: DE170100208 - award_title: Discovery Early Career Researcher Award - - funder_name: Australian Research Council - award_IRI: purl.org/au-research/grants/arc/FT160100113 - award_number: FT160100113 - award_title: Future Fellowship - - funder_name: Australian Research Council - award_IRI: purl.org/au-research/grants/arc/FT100100910 - award_number: FT100100910 - award_title: Future Fellowship - creators: - - last_name: Falster - given_name: Daniel - ORCID: 0000-0002-9814-092X - affiliation: Evolution & Ecology Research Centre, UNSW Sydney, Australia - - last_name: Gallagher - given_name: Rachael - ORCID: 0000-0002-4680-8115 - affiliation: Hawkesbury Institute for the Environment, Western Sydney University, Australia - - last_name: Elizabeth - given_name: Wenk - ORCID: 0000-0001-5640-5910 - affiliation: Evolution & Ecology Research Centre, UNSW Sydney, Australia diff --git a/tests/testthat/config/taxon_list-orig.R b/tests/testthat/config/taxon_list-orig.R deleted file mode 100644 index 41c2a0cf7..000000000 --- a/tests/testthat/config/taxon_list-orig.R +++ /dev/null @@ -1,5 +0,0 @@ - -# to generate taxon_list-orig.csv -v1 <- read_csv("config/taxon_list.csv") -v2 <- read_csv("tests//testthat/config/taxon_list-orig.csv") -v1 %>% filter(taxon_id %in% v2$taxon_id, taxonomic_status=="accepted") %>% write_csv("tests/testthat/config/taxon_list-orig.csv") diff --git a/tests/testthat/config/taxon_list-orig.csv b/tests/testthat/config/taxon_list-orig.csv deleted file mode 100644 index fd33fee44..000000000 --- a/tests/testthat/config/taxon_list-orig.csv +++ /dev/null @@ -1,8 +0,0 @@ -aligned_name,taxonomic_dataset,aligned_scientific_name_id,aligned_name_taxonomic_status,aligned_name_alternative_taxonomic_status,taxon_name,taxon_id,scientific_name_authorship,taxon_rank,taxonomic_status,family,taxon_distribution,establishment_means,scientific_name,scientific_name_id -Acacia celsa,APC,https://id.biodiversity.org.au/name/apni/154988,accepted,NA,Acacia celsa,https://id.biodiversity.org.au/taxon/apni/51436506,Tindale,Species,accepted,Fabaceae,Qld,native,Acacia celsa Tindale,https://id.biodiversity.org.au/name/apni/154988 -Acronychia acidula,APC,https://id.biodiversity.org.au/name/apni/73794,accepted,NA,Acronychia acidula,https://id.biodiversity.org.au/node/apni/2913200,F.Muell.,Species,accepted,Rutaceae,Qld,native,Acronychia acidula F.Muell.,https://id.biodiversity.org.au/name/apni/73794 -Alphitonia petriei,APC,https://id.biodiversity.org.au/name/apni/82935,accepted,NA,Alphitonia petriei,https://id.biodiversity.org.au/node/apni/2887911,Braid & C.T.White,Species,accepted,Rhamnaceae,"Qld, NSW",native,Alphitonia petriei Braid & C.T.White,https://id.biodiversity.org.au/name/apni/82935 -Euodia elleryana,APC,https://id.biodiversity.org.au/name/apni/68475,nomenclatural synonym,NA,Melicope elleryana,https://id.biodiversity.org.au/node/apni/2913641,(F.Muell.) T.G.Hartley,Species,accepted,Rutaceae,"WA, NT, Qld, NSW",native,Melicope elleryana (F.Muell.) T.G.Hartley,https://id.biodiversity.org.au/name/apni/118560 -Evodiella muelleri,APC,https://id.biodiversity.org.au/name/apni/87175,taxonomic synonym,NA,Melicope elleryana,https://id.biodiversity.org.au/node/apni/2913641,(F.Muell.) T.G.Hartley,Species,accepted,Rutaceae,"WA, NT, Qld, NSW",native,Melicope elleryana (F.Muell.) T.G.Hartley,https://id.biodiversity.org.au/name/apni/118560 -Glochidion hylandii,APC,https://id.biodiversity.org.au/name/apni/78303,accepted,NA,Glochidion hylandii,https://id.biodiversity.org.au/node/apni/2889113,Airy Shaw,Species,accepted,Phyllanthaceae,Qld,native,Glochidion hylandii Airy Shaw,https://id.biodiversity.org.au/name/apni/78303 -Melicope elleryana,APC,https://id.biodiversity.org.au/name/apni/118560,accepted,NA,Melicope elleryana,https://id.biodiversity.org.au/node/apni/2913641,(F.Muell.) T.G.Hartley,Species,accepted,Rutaceae,"WA, NT, Qld, NSW",native,Melicope elleryana (F.Muell.) T.G.Hartley,https://id.biodiversity.org.au/name/apni/118560 diff --git a/tests/testthat/config/taxon_list.csv b/tests/testthat/config/taxon_list.csv deleted file mode 100644 index cd2622d43..000000000 --- a/tests/testthat/config/taxon_list.csv +++ /dev/null @@ -1,8 +0,0 @@ -cleaned_name,taxonomic_reference,cleaned_scientific_name_id,cleaned_name_taxonomic_status,cleaned_name_alternative_taxonomic_status,taxon_name,taxon_id,scientific_name_authorship,taxon_rank,taxonomic_status,family,taxon_distribution,establishment_means,scientific_name,scientific_name_id -Acacia celsa,APC,https://id.biodiversity.org.au/name/apni/154988,accepted,NA,Acacia celsa,https://id.biodiversity.org.au/taxon/apni/51436506,Tindale,Species,accepted,Fabaceae,Qld,native,Acacia celsa Tindale,https://id.biodiversity.org.au/name/apni/154988 -Acronychia acidula,APC,https://id.biodiversity.org.au/name/apni/73794,accepted,NA,Acronychia acidula,https://id.biodiversity.org.au/node/apni/2913200,F.Muell.,Species,accepted,Rutaceae,Qld,native,Acronychia acidula F.Muell.,https://id.biodiversity.org.au/name/apni/73794 -Alphitonia petriei,APC,https://id.biodiversity.org.au/name/apni/82935,accepted,NA,Alphitonia petriei,https://id.biodiversity.org.au/node/apni/2887911,Braid & C.T.White,Species,accepted,Rhamnaceae,"Qld, NSW",native,Alphitonia petriei Braid & C.T.White,https://id.biodiversity.org.au/name/apni/82935 -Euodia elleryana,APC,https://id.biodiversity.org.au/name/apni/68475,nomenclatural synonym,NA,Melicope elleryana,https://id.biodiversity.org.au/node/apni/2913641,(F.Muell.) T.G.Hartley,Species,accepted,Rutaceae,"WA, NT, Qld, NSW",native,Melicope elleryana (F.Muell.) T.G.Hartley,https://id.biodiversity.org.au/name/apni/118560 -Evodiella muelleri,APC,https://id.biodiversity.org.au/name/apni/87175,taxonomic synonym,NA,Melicope elleryana,https://id.biodiversity.org.au/node/apni/2913641,(F.Muell.) T.G.Hartley,Species,accepted,Rutaceae,"WA, NT, Qld, NSW",native,Melicope elleryana (F.Muell.) T.G.Hartley,https://id.biodiversity.org.au/name/apni/118560 -Glochidion hylandii,APC,https://id.biodiversity.org.au/name/apni/78303,accepted,NA,Glochidion hylandii,https://id.biodiversity.org.au/node/apni/2889113,Airy Shaw,Species,accepted,Phyllanthaceae,Qld,native,Glochidion hylandii Airy Shaw,https://id.biodiversity.org.au/name/apni/78303 -Melicope elleryana,APC,https://id.biodiversity.org.au/name/apni/118560,accepted,NA,Melicope elleryana,https://id.biodiversity.org.au/node/apni/2913641,(F.Muell.) T.G.Hartley,Species,accepted,Rutaceae,"WA, NT, Qld, NSW",native,Melicope elleryana (F.Muell.) T.G.Hartley,https://id.biodiversity.org.au/name/apni/118560 diff --git a/tests/testthat/config/testgit.zip b/tests/testthat/config/testgit.zip deleted file mode 100644 index 66e3fbb337166831c1d026d4437b858e95923a5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5648 zcmd59ly_DsX5Rolg zDan>Z_9c?E{+?%;%uMq3=kNGDJZ8@K-tW2h+;i?1jiP6OKp@Nzh?EDjHSqS!7=bsX z!|s8~XuyRZ!pzJJ;iYk5BfDS;KCbSE&6=w@YGCa2Ri#=6hNE;>Ge`A;Ms>oxM3SAZ z^&B|P-*|S2n3xfHc%QPW*J6G$!e5m=D9s~1r_-$x)7nkn>z}jTt?cLLB7sYZ60)bi z3~s#c^ep7*_ZsNxLxmutKmGBpJEVYL0m^Q83@$*~ z8xs(S_h$u%RB#WtEe-&LR)z%r06X%><#rB zE@uR=1T*C>3e&?1DPN$bzG89QMkU!zGh(5=ulqy@9nwK_yW(r2jjq>T>omR0!kEgJ za^zt3p?yZ}7Q%Kx5wd3mIkT@vZ~xai-ZJZIUx%G?7jJ1*l<7xbH0!hR<7UKChH#Bf zJ7;lq{}7vReqY%A?q;XKL(!wwTsxg+zRuEv5l6pmX^#MC7Oq6RoM8Mk3C2ne#N7vn z4~F_e5`XF&Tj&9w(g6?DWfm!{wCy3*Wy0GK_@87@y+#5ALd*odUIaeihd{Xe)8&7R zEQR-ZT=D;R{BpU6mNxytR}ePWARjE46ah*WD_FZT?*+3vq?of_Zcwj{8xc|T^<@Uh z3Uk-J2?Bh4fd@=D;LjS{LqXP+u+HxA0C3X5a`yrJ@WEKGARJyXPK7lL#?5f-P~n-! ztz2CWOUzuz7UBc8#_%_qr~6>dGG3py<(%m*kAObZx>PWlgYemWZ}&neQ-RyI2g= z{W!@Xko>?5Pe{;ZeGKDCH3mNl2FFVejvFzK#eNlt7po{8 zDvCP0#;NpSD1}^VE@EMTmw6XrGtz=gXEJec8dTY=Q40vn8 zRpAI60tZt=Xd+Z_NQ|1Rx+)xrfx!_fa2GsW1?~#N;h;pwiJ!sHn+e9ObSm5str3Ca zLXkK%R75n>2T8NC2>Sav&#PzR;O4WoQ8`UL_e@zi-x=pJ4^{QYp=@OmS~p0iXTuID zU&QJN#x;w-M!#CLd22i&121>;kr(hOpGR|^_*i^=!`t2HM-gliex}vZSFRR!4jun7 z|D#Db<(6-4_iFM*0&x(5XEkkT>(y`Tf^?-=7h3P%)&=lZ#kk_}nyyHM zDh{WCL1Hyk5qLZX>EeRbz`$|9qQKShI8CT5W7n5pXvzT;p$Ea;fB)nYs~9K?nw`H- z%d1en-Dxtv0aK{ONHlRMY6(B@nB?!ceeTUs34TRn>{;RP1u0}Ap;Cl1wZ!gm)SHuE z7gApfe9NwQrT95NM^|z&bQpCwuRv=XQ|_%#O)oerFNXI0LvMZHTAsIrc;02fsH4Yn zD7Fce4pDA^~5EKzA^Do zp1p@y|Gn2I;bGfaO0|DloG3OMQwWP5GUAQoN({N+sNa&^s&mWp(wVpET^B`5vvzt~ z3Z@Sae9F)MzQgQ2Cy)CAedzYV-H&^>An)RllPUA|Hcm4|0UkF3^lR*kkCyG7lhMOe zZz)SMv6PI5qjD|psa@7;b=7io@;(t5Dw;P!#H9aQ)TF@M^Rg2miEg#s!XXhisFicu z_L)MTb*?2l)}y`Yq-RPxoK^ z3Y7`#+O!QTE)yKDKfpm}#f6DJm*nSEQG1^Ftm4Dlev~bHV~SqB;8cM#x3D?uiygyv za9(XNRg-3e`ZH=dQA=rpR}3*e;~~ze1-|TeP!0FB=|9^Ihp^YpKJ@N*9eacOd4M$g zv(6Z)Yn;!cU&SPw>k;=W5wy7?{7eRf5RJj{m_7JZXJIMd>0METc%3|x()7NDqnuOo zGV|R_$^N)eYkRpnGIlpj805c{bc{90j|3aq@UtiyNHEQe)%7O0pthb2L3dgSS=S2a z4KwdYE4FWDkxOYPpLg*Wxb3gfX+5^^?2s+@2&(_!g&1o&`}!ZIAepZs-`YZo|f?H3Wns%fBOHQ6#}^Be+)1u&9PLZxw< zMxO^S%}YJxrRS3OSoir0W&vT`n*xcmW zom%_mD&~6pZ&zgKcIVDoOW@~oK6bx|?B-AHc>g{I%hb1HY0$=@!t(Lv$&1dfUDz^v z&W(2paPw3JJ1=lb#J_O~IbT`L(P4inqrEJ;Fw50j!%ESyR6o~P`NZBf_DVNNJEFIF z7V7!sXa^P>C*CLr<<^kub5Ng>{X9l0234Zn@qNkH{B^&g_Z1Q6>o(2UNF1vRFU_&Uo!o5~anwB@R?@S!ZsbDt!kc2BEF)^ziu$-nhYJ=K75imxL_BKcSc$ zg4(-GJ>6PdC-j62+;w+WcqG)^sOF>h6Yja|S9L#I04jMUQKr-R%<|OOx zk$R5F*)aO!ccqOZ*phCw=iO}C`t-x(Sqa!125aa8ZI^-B2cF^G4C>R;W>`AA~^E?u+WYN&B5;l36!F-?2uE4O2u-e=kCRs`iGYovE z-+er?m=@~z#eG8U^cE$;xa(mXd};kQDWQX#C*Cn7eQHo$O1xp{ckcMPMFGx@HF{Ce zX|gIO-ibyP-@mh!f9uc?abn|G)dcI7Q&=yzR2>VU`p4&+#dcrxRov{474*wFRl@T1 zuI?Vw4b#oFGW;>l9q%SjP8Dv51*^BYx2(=~K+wnn&uaCi?Nh&1Z>$DI^``ayt$G9A zICXWr3IgehN2sd6G%y%-EXEawQ-fo1ni@zP9)`r>aGE$M0#XljH3c~nGiz80&;nsF zxXS*$3N0w5#^yGKPBxbdcNS)r+HO6x3yA%4u%-Vj-m^{o=tf9F79Sc6r@gQEm=@58 z5LC^GRxa=Y-;(Z`lWtS4y!fPvP#@BYVK>esSTXrDh{qXfyUDZH0& zP*6EY=T8mn-`yNYvdVSqVzm-5o*eM}IqqK;!1ZXa;y~Ie!0xT!NMekdHKiH?&y6Eo~W~p7tXdz9OJj zrv-78LIspiWXmLq1DcXV_m`krZ%!~{mkkWHoeH~h7{Q4Fmo@J0ptM;w5d8gjFj?sQ znL8+T$d*Zj0Y!C{`)|i~y+A<8v1}lh59EQ!1#3O%>d^q9;u}^tkf9_&LLC9+6&@_! zWXmL)tbzW!GDFFb_IgjvP>qR(AxRpnG6d0-ZHk(q%NppvlM0j!X>*sF;T$^+LsI)& zWeB1vI}bHODPS*2SwP-_zix+=4A<&O%licGay9K7D;*8w2zaeg%fKGEY@`IE#jkX@ zKjW!S_a@-bl4AVNLq@%_##Feq&lhE{0(&6YGKojmKreU1^;V9$MvPI7vC`uhfwYG} N#DJe6;7yQ(_#e*#jko{+ diff --git a/tests/testthat/config/traits.yml b/tests/testthat/config/traits.yml deleted file mode 100644 index 8e500a064..000000000 --- a/tests/testthat/config/traits.yml +++ /dev/null @@ -1,77 +0,0 @@ -traits: - description: Names and details of plant traits included in the AusTraits compilation - type: list - elements: - branch_mass_fraction: - description: Fraction of plant dry mass comprised of branch material - type: numeric - units: mg/mg - label: Fraction of plant dry mass comprised of branch material - allowed_values_min: 0.00 - allowed_values_max: 1.0 - huber_value: - description: Sapwood area to leaf area ratio - type: numeric - units: mm2{sapwood}/mm2{leaf} - label: Huber value - allowed_values_min: 0.00001 - allowed_values_max: 0.2 - leaf_area: - description: Area of the leaf surface - type: numeric - units: mm2 - label: Leaf area - allowed_values_min: 0.1 - allowed_values_max: 1.0e+07 - leaf_N_per_dry_mass: - description: Leaf nitrogen (N) content per unit leaf dry mass - type: numeric - units: mg/g - label: Leaf nitrogen (N) content per unit leaf dry mass - allowed_values_min: 0.5 - allowed_values_max: 100.0 - seed_dry_mass: - description: Dry mass of a mature seed, including both oven dried and air-dried samples. (Notes, Standard methods people will have used for dried seeds include, 'fresh' (at dispersal, mature); 'air dried' (at local ambient conditions); 'seed bank air dried' (to 15% relative humidity); 'oven dried' (>100 deg C for a set number of hours; e.g. seed bank standard is 103 deg C for 17 hours) - type: numeric - units: mg - label: Seed dry mass - allowed_values_min: 0.0001 - allowed_values_max: 1000000.0 - leaf_mass_per_area: - description: Leaf area per unit leaf dry mass; SLA - type: numeric - units: mm2/mg - label: Leaf area per unit leaf dry mass (specific leaf area, SLA) - allowed_values_min: 0.1 - allowed_values_max: 500 - wood_density: - description: Stem dry mass per unit stem fresh volume (stem specific density or SSD or wood density) - type: numeric - units: mg/mm3 - label: Stem dry mass per unit fresh stem volume - allowed_values_min: 0.05 - allowed_values_max: 1.4 - leaf_photosynthesis_Vcmax_per_area: - description: Maximum carboxylase activity of ribulose 1,5-bisphosphate carboxylase/oxygenase (Rubisco), calculated from an A-Ci response curve, on an area basis - type: numeric - units: umol/m2/s - label: Maximum carboxylase activity of ribulose 1,5-bisphosphate carboxylase/oxygenase (Rubisco), measured through chlorophyll fluorescence, on a per mass basis - allowed_values_min: 10 - allowed_values_max: 500 - fruit_colour: - description: Human visible dominant colour of a fresh fruit's exocarp (outermost layer) at maturity. If a fruit is multiple colors, they are listed as a space-delimited string. - type: categorical - label: Fruit colour - allowed_values_levels: - pink: pink - red: red - orange: orange - yellow: yellow - green: green - blue: blue - purple: purple - white: white - cream: cream - brown: brown - black: black - grey: grey diff --git a/tests/testthat/config/unit_conversions.csv b/tests/testthat/config/unit_conversions.csv deleted file mode 100644 index f49a88177..000000000 --- a/tests/testthat/config/unit_conversions.csv +++ /dev/null @@ -1,149 +0,0 @@ -unit_from,unit_to,function -%,mg/g,x*10 -%,g/g,x*0.01 -%,mg/mg,x*0.01 -%,mg/kg,x*10000 -%,{dimensionless},x*.01 -%,{count}/{count},x*.01 -{dimensionless},{count}/{count},x*1 -a,mo,x*12 -{count}/m2,{count}/mm2,x*1/1000000 -cm,m,x*0.01 -cm,mm,x*10 -um,mm,x*0.001 -mm,um,x*1000 -m,mm,x*1000 -cm2,mm2,x*100 -m2,mm2,x*1000000 -mm,m,x*0.001 -g,mg,x*1000 -um/2,um,x*2 -mm2/mm2,um2/um2,x*1 -%,um2/um2,x*.01 -{dimensionless},um2/um2,x*1 -mg/mg,mg/g,x*1000 -g/g,mg/mg,x*1 -mg/mg,g/g,x*1 -mg/g,g/g,x*0.001 -ppm,mg/g,x*1/1000 -ug/mg,mg/g,x*1 -g/g,mg/g,x*1000 -g/kg,mg/g,x*1 -mg/kg,mg/g,x*.001 -ug/g,mg/g,x*0.001 -mmolN/g,mg/g,x*14.0067 -ug/mg,mg/kg,x*1000 -ug/g,mg/kg,x*1 -ppm,mg/kg,x*1 -mg/g,mg/kg,x*1000 -g/kg,mg/kg,x*1000 -mg/kg,ppm,x*1 -m/g,cm/mg,x*0.1 -cm/mg,m/g,x*10 -cm/g,m/g,x*1/100 -mm/g,m/g,x*1/1000 -mg{shoot}/mg{root},mg{root}/mg{shoot},1/x -kg/m2,mm2/mg,1/x -g/m2,mm2/mg,1/x*1000 -mg/cm2,mm2/mg,1/x*100 -mg/mm2,mm2/mg,1/x -ug/mm2,mm2/mg,1/x*1000 -g/dm2,mm2/mg,1/x*10 -cm2/g,mm2/mg,x*0.1 -cm2/mg,mm2/mg,x*100 -m2/g,mm2/mg,x*1000 -m2/kg,mm2/mg,x*1 -mm2/g,mm2/mg,x*0.001 -mm2/kg,mm2/mg,x*0.000001 -m2/g,g/m2,1/x -m2/kg,g/m2,1000/x -cm2/g,g/m2,10000/x -cm2/mg,g/m2,10/x -mm2/g,g/m2,1000000/x -mm2/mg,g/m2,1000/x -kg/m2,g/m2,x*1000 -mg/cm2,g/m2,x*10 -mg/m2,g/m2,x*0.001 -g/cm2,g/m2,x*10000 -g/dm2,g/m2,x*100 -mg/mm2,g/m2,x*1000 -mol{H2O}/m2,g/m2,x*18 -mmol{N}/m2,g/m2,x*14.0067/1000 -mmol{P}/m2,g/m2,x*30.973761/1000 -kg/m3,mg/mm3,x*0.001 -g/cm3,mg/mm3,x*1 -ug/mm3,mg/mm3,x*1/1000 -mg/ml,mg/mm3,x*1 -ppm,umol/mol,x*1 -%,umol/umol,x*1/100 -mol/mol,umol/umol,x*1 -umol/g,mmol/kg,x*1 -mmol/g,mmol/kg,x*1/1000 -mol/kg,umol/g,x*1000 -nmol/g/s,umol/g/s,x*0.001 -mol/m2/s,mmol/m2/s,x*1000 -mmol/m2/MPa/s,mmol/m2/MPa/s,x*1 -kg/m2/MPa/s,mmol/m2/MPa/s,x*18015200 -umol{CO2}/mol{H2O}/m2/s,mmol{CO2}/mol{H2O}/m2/s,x*1/1000 -ppm,umol{CO2}/mol,x*1 -ppm,umol/mol,x*1 -umol{CO2}/kg/s,umol{CO2}/g/s,x*0.001 -mmol{CO2}/g/s,umol{CO2}/g/s,x*1000 -nmol{CO2}/g/s,umol{CO2}/g/s,x*0.001 -neg_umol{CO2}/g/s,umol{CO2}/g/s,x*-1 -mmol{CO2}/m2/s,umol{CO2}/m2/s,x*1000 -mmol{CO2}/m2/s,umol{CO2}/m2/s,x*1000 -nmol{CO2}/m2/s,umol{CO2}/m2/s,x*1/1000 -neg_umol{CO2}/m2/s,umol{CO2}/m2/s,x*-1 -mol{CO2}/m2/d,umol{CO2}/m2/s,x*11.57407 -umol{CO2}/umol{H2O},umol{CO2}/mmol{H2O},x*1/1000 -mmol{CO2}/mol{H2O},umol{CO2}/mmol{H2O},x*1 -umol{CO2}/mol{H2O},umol{CO2}/mmol{H2O},x*1/1000 -umol{CO2}/nmol{H2O},umol{CO2}/umol{H2O},x*1/1000 -umol{CO2}/mmol{H2O},umol{CO2}/umol{H2O},x*1/1000 -umol{CO2}/umol{H2O},umol{CO2}/nmol{H2O},x*1000 -umol{CO2}/g{N}/s,umol{CO2}/mol{N}/s,x*14.0067 -umol{CO2}/g{P}/s,umol{CO2}/mol{P}/s,x*30.973761 -mmol{CO2}/mol{P}/s,umol{CO2}/mol{P}/s,x*1000 -umol{H2O}/m2/s,mmol{H2O}/m2/s,x*0.001 -mol{H2O}/m2/s,mmol{H2O}/m2/s,x*1000 -mol{H2O}/m2/d,mmol{H2O}/m2/s,x*0.011574 -mol{H2O}/m2/s,mmol{H2O}/m2/s,x*1000 -mol{H2O}/m2/s,umol{H2O}/m2/s,x*1000000 -mmol/m2/s,umol{H2O}/m2/s,x*1000 -mmol{H2O}/m2/s,umol{H2O}/m2/s,x*1000 -nmol{H2O}/m2/s,umol{H2O}/m2/s,x*1/1000 -cm2{leaf}/cm2{sapwood},mm2{sapwood}/mm2{leaf},1/x -mm2{leaf}/mm2{sapwood},mm2{sapwood}/mm2{leaf},1/x -cm2{leaf}/mm2{sapwood},mm2{sapwood}/mm2{leaf},x*1/100 -cm2{sapwood}/m2{leaf},mm2{sapwood}/mm2{leaf},x*1/10000 -10^4.mm2{sapwood}/mm2{leaf},mm2{sapwood}/mm2{leaf},x*1/10000 -MPa,Pa,x*1000 -neg_MPa,MPa,x*-1 -MN/m2,MPa,x*1 -N/m2,MPa,x*1/1000 -mJ/m,N,x*1/1000 -J/m,N,x*1 -kJ/m2,N/m,x*1000 -J/m2,N/m,x*1 -100xJ/m2,N/m,x*100 -kN/m,N/m,x*1000 -10^1.kN/m,N/m,x*100 -10^1.MN/m2,N/m2,x*100000 -MJ/m2/m,N/m2,x*1000000 -MN/m2,N/m2,x*1000000 -mg/m/MPa/s,10^4.kg/m/MPa/s,x*1/100 -kg/m/MPa/s,10^4.kg/m/MPa/s,x*10000 -10^4.ml/cm/MPa/s,10^4.kg/m/MPa/s,x*0.1 -10^3.kg/m/MPa/s,10^4.kg/m/MPa/s,x*10 -ml/cm/MPa/s,10^4.kg/m/MPa/s,x*100 -kg/m/Pa/s,kg/m/MPa/s,x*1/1000 -10^6.kg/m/MPa/s,kg/m/MPa/s,x*1/1000000 -10^4.kg/m/MPa/s,kg/m/MPa/s,x*1/10000 -10^1.kg/m/MPa/s,kg/m/MPa/s,x*0.1 -ml/cm/MPa/s,kg/m/MPa/s,x*0.1 -ml.cm/MPa/s,10^6.kg.m/MPa/s,x*100 -mg.cm/MPa/s,10^6.kg.m/MPa/s,x*1/100 -kg.m/MPa/s,10^6.kg.m/MPa/s,x*1000000 -10^4.kg.m/MPa/s,10^6.kg.m/MPa/s,x*100 -10^7.kg.m/MPa/s,10^6.kg.m/MPa/s,x*1/10 diff --git a/tests/testthat/data/Test_2022/.gitignore b/tests/testthat/data/Test_2022/.gitignore deleted file mode 100644 index 5903406eb..000000000 --- a/tests/testthat/data/Test_2022/.gitignore +++ /dev/null @@ -1 +0,0 @@ -metadata.yml diff --git a/tests/testthat/data/Test_2022/data.csv b/tests/testthat/data/Test_2022/data.csv deleted file mode 100644 index 6cfcbcb79..000000000 --- a/tests/testthat/data/Test_2022/data.csv +++ /dev/null @@ -1,46 +0,0 @@ -Species,species_abb,site,LMA (mg mm-2),Leaf nitrogen (mg mg-1),leaf size (mm2),wood density (mg mm-3),branch mass fraction,Seed mass (mg),LASA10,LASA250,LASA50,LASA1000 -Acacia celsa,acacel,Atherton,0.145,0.0214,2786,0.498,0.67,10.3,2977,7260,3722,6824 -Acronychia acidula,acraci,Atherton,0.085,0.0243,14302,0.525,0.48,,,7560,5541,9480 -Alphitonia petriei,alppet,Atherton,0.149,0.0163,6820,0.413,0.42,27.2,,4340,3313,4335 -Glochidion hylandii,glohyl,Atherton,0.106,0.0137,3209,0.566,0.41,10.41,1993,5075,5455,8664 -Homalanthus novoguineensis,omanov,Atherton,0.082,0.022,10682,0.319,0.47,7,,2136,2158,3307 -Melicope elleryana,melell,Atherton,0.075,0.0268,6955,0.346,0.58,1.61,,4201,2860,6119 -Neolitsea dealbata,neodea,Atherton,0.093,0.0164,5228,0.352,0.58,176.1,1686,2747,3049,7504 -Polyscias australiana,polaus,Atherton,0.079,0.0154,6806,0.397,0.42,8.35,,6008,,6700 -Psychotria sp Utchee Creek,psyspp,Atherton,0.108,0.0179,11157,0.582,0,23.09,,4977,2302,2037 -Rhodomyrtus trineura,rhotri,Atherton,0.129,0.0111,3401,0.763,0.34,,4321,3803,6088,6877 -Acmena graveolens,acmgra,Cape Tribulation,0.151,0.0155,5246,0.599,0.67,,,3057,2667,7156 -Aleurites rockinghamensis,aleroc,Cape Tribulation,0.113,0.0184,73984,0.28,0.02,7077,,4194,,6209 -Alstonia scholaris,alssch,Cape Tribulation,0.107,0.0223,6182,0.361,0.46,1.53,,1854,1682,3932 -Argyrodendron peralatum,argper,Cape Tribulation,0.244,0.0119,3201,0.726,0.71,433,,3832,1689,6718 -Atractocarpus hirtus,atrhir,Cape Tribulation,0.072,0.0157,11374,0.804,0.28,,,7143,6727,6103 -Brombya platynema,bropla,Cape Tribulation,0.106,0.0188,8218,0.603,0.33,,,4261,3531,5377 -Cardwellia sublimis,carsub,Cape Tribulation,0.127,0.0128,4352,0.603,0.56,582.3,,6315,4880,8282 -Castanospermum australe,casaus,Cape Tribulation,0.117,0.0237,2765,0.587,0.37,14851,,7329,,8869 -Cleistanthus myrianthus,clemyr,Cape Tribulation,0.078,0.0228,4828,0.588,0.56,,3720,6084,5233,8559 -Cryptocarya laevigata,crylae,Cape Tribulation,0.087,0.0156,2682,0.64,0.65,1281,1391,3297,4680,7588 -Cryptocarya mackinnoniana,crymac,Cape Tribulation,0.204,0.0152,10458,0.655,0.61,204,,3277,2325,8657 -Cryptocarya murrayi,crymur,Cape Tribulation,0.155,0.0167,9960,0.674,0.39,,2693,5543,4298,5451 -Dendrocnide moroides,denmor,Cape Tribulation,0.052,0.0312,26454,0.23,0.46,0.71,,2372,,2090 -Elaeocarpus grandis,elaang,Cape Tribulation,0.122,0.0187,2762,0.499,0.47,3699,,2598,1748,4635 -Endiandra leptodendron,endlep,Cape Tribulation,0.106,0.018,3987,0.611,0.68,,1492,2412,2783,7477 -Endiandra microneura,endmic,Cape Tribulation,0.151,0.0177,3377,0.623,0.61,,3573,6344,3354,6235 -Gillbeea adenopetala,gilade,Cape Tribulation,0.126,0.0096,3678,0.43,0.46,15,,2863,3160,6549 -Haplostichanthus sp Coop. Ck,hapspp,Cape Tribulation,0.072,0.022,4685,0.668,0.36,,2430,12304,3282,2992 -Harpullia rhyticarpa,harrhy,Cape Tribulation,0.076,0.0174,40876,0.621,0.01,,,8971,5922,4669 -Hernandia albiflora,heralb,Cape Tribulation,0.069,0.0195,3806,0.447,0.33,,3123,4145,4643,6086 -Ixora biflora,ixobif,Cape Tribulation,0.081,0.01,2760,0.843,0.55,41.5,5244,3892,1969,8094 -Lasianthus strigosus,lasstr,Cape Tribulation,0.055,0.0158,3313,0.684,0.15,7,1841,5100,2379,2731 -Litsea leefeana,litlee,Cape Tribulation,0.13,0.0144,3917,0.549,0.68,263.4,3984,4141,3816,9645 -Macaranga tanarius,mactan,Cape Tribulation,0.104,0.0205,46676,0.344,0,,,3377,,3901 -Mallotus mollissimus,malmol,Cape Tribulation,0.063,0.0352,16716,0.373,0.32,31.25,1788,5580,5163,7944 -Medicosma sessiliflora,medses,Cape Tribulation,0.106,0.0153,8164,0.69,0.65,,2844,9332,6514,10298 -Melastoma cyanoides,melaff,Cape Tribulation,0.046,0.0208,4009,0.381,0.6,0.07,2960,4057,4661,6637 -Myristica insipida,myrins,Cape Tribulation,0.106,0.0185,8379,0.433,0.51,1612,,6929,4852,9273 -Pittosporum rubiginosum,pitrub,Cape Tribulation,0.065,0.0143,9931,0.728,0.28,27.94,7428,7459,5265,6548 -Psychotria dallachiana,psydal,Cape Tribulation,0.079,0.0177,2495,0.612,0.33,,4290,5666,4916,4761 -Quassia baileyana,quabai,Cape Tribulation,0.086,0.023,9624,0.501,0.42,,,5867,3216,5719 -Rockinghamia angustifolia,rocang,Cape Tribulation,0.108,0.0158,10636,0.455,0.39,19.38,,5862,4611,6098 -Syzygium gustavioides,syzgus,Cape Tribulation,0.167,0.0129,3590,0.521,0.59,48000,2833,3121,3047,6584 -Syzygium sayeri,syzsay,Cape Tribulation,0.131,0.0137,2645,0.485,0.65,841,3929,5767,4939,9836 -Trema aspera,treasp,Cape Tribulation,0.053,0.0299,2071,0.357,0.53,5.12,3578,5291,5440,6695 diff --git a/tests/testthat/data/Test_2022/test-metadata.yml b/tests/testthat/data/Test_2022/test-metadata.yml deleted file mode 100644 index 74cf9425e..000000000 --- a/tests/testthat/data/Test_2022/test-metadata.yml +++ /dev/null @@ -1,319 +0,0 @@ -source: - primary: - key: Falster_2005_1 - bibtype: Article - author: Daniel S. Falster, Mark Westoby - year: 2005 - title: Alternative height strategies among 45 dicot rain forest species from tropical - Queensland, Australia - journal: Journal of Ecology - volume: 93 - pages: 521--535 - publisher: Wiley-Blackwell - doi: 10.1111/j.0022-0477.2005.00992.x -contributors: - data_collectors: - - last_name: Falster - given_name: Daniel - ORCID: 0000-0002-9814-092X - affiliation: Evolution & Ecology Research Centre, School of Biological, Earth, - and Environmental Sciences, UNSW Sydney, Australia - additional_role: contact - - last_name: Westoby - given_name: Mark - ORCID: 0000-0001-7690-4530 - affiliation: Department of Biological Sciences, Macquarie University, Australia - dataset_curators: Elizabeth Wenk -dataset: - data_is_long_format: no - custom_R_code: data %>% mutate(Test_col = NA) - collection_date: 2004/2004 - taxon_name: Species - location_name: site - description: Investigation into trait values correlated with plant height along - light availability and successional gradients for far north Queensland species. - basis_of_record: field - life_stage: adult - sampling_strategy: Nineteen species, ranging from early to late successional status, - were selected using published sources (Hopkins & Graham 1987; Osunkoya 1996; Hyland - et al. 1999). Species selected to represent the light gradient establish and mature - in closed forest, where successional species are assumed absent. For inclusion - in this set we required that a species was known to establish and persist at low - light levels, as indicated either by published sources (Hyland et al. 1999; Osunkoya - 1996) or by scientists familiar with the vegetation (A Graham, J Wells, CSIRO - Atherton; R Jensen). Twenty-six species, experiencing a range of light levels - at maturity, from high (canopy trees) to low light (understorey shrubs), were - included. - original_file: Falster & Westoby 2005 J Ecol appendix.doc - notes: none -locations: - Atherton: - description: Tropical rain forest vegetation. - elevation (m): 800 - latitude (deg): -17.1166667 - longitude (deg): 145.65 - rainfall (mm): 2000 - Cape Tribulation: - description: Complex mesophyll vine forest in tropical rain forest. - elevation (m): 25 - latitude (deg): -16.1 - longitude (deg): 145.45 - rainfall (mm): 3500 -contexts: .na -traits: -- var_in: LMA (mg mm-2) - unit_in: mg/mm2 - trait_name: leaf_mass_per_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: LMA was calculated as the leaf dry mass (oven-dried for 48 hours at 65 - deg C) divided by leaf size. It was measured on the first five fully expanded - leaves at the tip of each individual. -- var_in: Leaf nitrogen (mg mg-1) - unit_in: mg/mg - trait_name: leaf_N_per_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaves from all individuals per species were pooled and finely ground for - nitrogen analysis. Total nitrogen concentration (%) was measured using complete - combustion gas chromatography by Waite Analytical Services, Adelaide. The first - five fully expanded leaves at the tip of each individual were used for the analysis. -- var_in: leaf size (mm2) - unit_in: mm2 - trait_name: leaf_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaf size was calculated as the one-sided leaf area (flat bed scanner). - It was measured on the first five fully expanded leaves at the tip of each individual. -- var_in: wood density (mg mm-3) - unit_in: mg/mm3 - trait_name: wood_density - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Wood density was calculated using 40-60 mm stem segments taken 250 mm and - 1000 mm back along a branch from the branch tip. Fresh samples were refrigerated - before processing. After removing bark material, the volume of each wood sample - was determined using Archimedes' principle (Hacke et al. 2000). Samples were submerged - in a water-filled container on a balance. The weight change (mg) recorded during - submersion corresponds to the mass of water displaced, which can be converted - to a volume using the formula, displacement weight (mg)/0.998 (mg/mm3), where - 0.998 mg/mm3 is the density of water at 20 deg C. Samples were then dried for - 4 days at 60 deg C before weighing. -- var_in: branch mass fraction - unit_in: mg/mg - trait_name: branch_mass_fraction - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Branch mass fraction was calculated as the mass side branches/total mass, - on a carbon dry mass basis. The zero values are correct - these are plants with - no branches. -- var_in: Seed mass (mg) - unit_in: mg - trait_name: seed_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: unknown - methods: Mean oven-dried seed mass (including seed coat but excluding seed accessories) - was estimated for all species with available field material. In total, collections - for 17 of 47 species were made. Data for an additional 12 species were drawn from - published (Osunkoya et al. 1994; Grubb et al. 1998) and unpublished (P. Juniper, - CSIRO Atherton) sources. -- var_in: LASA10 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a shoot whose sapwood had a cross sectional - area of 10 mm2. In detail from Wright_2006, which used this data, No single best - point exists to compare traits such as LM/ SM, LA/SM and LA/SA when considering - a set of species that varies widely in canopy architecture and typical maximum - height (here, approximately 20 cm to 85 m). We have used several approaches (Table - 1). In one study, we made measurements on the terminal twigs of each species, - i.e. on a relatively standard developmental unit (Westoby and Wright 2003). For - species at Ash, GLP, Myall and TRF, traits were measured at each of several different - distances back down the stem from the branch tip (Falster and Westoby 2005a, 2005b - and unpublished, Pickup et al. 2005). At GHP, RHM and RHW, traits were measured - at a standard sapwood cross-sectional area (10 mm2; Pickup et al. 2005). For the - present re-analysis, we took the raw data from the previous studies and, for every - species possible, calculated patterns of leaf and stem deployment at two standard - points: at 250 mm distance from the branch tip (Ash, GLP, Myall and TRF) and at - 10 mm2 stem (Ash, Myall, TRF) or sapwood (GHP, GLP, RHM, RHW) crosssectional area - (250 mm or 10 mm2 formulation denoted as subscript in trait abbreviations). This - was done as follows. For each individual plant, total leaf and stem dry mass at - 250 mm distance was estimated by straightline interpolation from values measured - at the nearest sampling points on either side of this distance. As the dry mass - data tended to display non-linear (power) relationships with distance from the - branch tip, the interpolated values were calculated from log10-log10- transformed - data, then back-transformed to the original scale. The same approach was used - for interpolating data to the standard stem (or sapwood) cross-sectional area. - For individuals where measurements had not been made on either side of the desired - point but the nearest measurement had been made within 25 mm of 250 mm or 1 mm2 - of 10 mm2 cross-section (i.e. within 10% of the desired point), we extrapolated - (rather than interpolated) the measured data to the standard point. This allowed - us to include a number of individuals and species for which interpolation was - not possible. Still, several large-leaved, large-stemmed species from the TRF - site could not be included in the 10-mm2 crosssection dataset. No unusual tendencies - in analyses, including the extrapolated data, were seen in comparison to analyses - including interpolated data only (details not shown). To illustrate how species'' - morphology varied at the two standard sampling points, species-mean stem cross-sectional - area varied between 1.2 and 258 mm2 at 250 mm distance from the branch tip, while - the distance from the branch tip at which stem cross-sectional area reached 10 - mm2 varied from 64 to 995 mm.' -- var_in: LASA250 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 250 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA50 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 50 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA1000 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 1000 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -substitutions: .na -taxonomic_updates: -- find: Homalanthus novoguineensis - replace: Homalanthus novo-guineensis - reason: Change spelling to align with known name in APC (Daniel Falster, 2020.05.22) - taxonomic_resolution: Species -- find: Haplostichanthus sp Coop. Ck - replace: Haplostichanthus submontanus - reason: Align previous phrase name with current APC name (E. Wenk, 2020-05-25) - taxonomic_resolution: Species -- find: Psychotria sp Utchee Creek - replace: Psychotria sp. Utchee Creek (H.Flecker NQNC5313) - reason: Align to name in APC (D Falster, 2020.05.23) - taxonomic_resolution: Species -exclude_observations: .na -questions: .na diff --git a/tests/testthat/data/metadata.yml b/tests/testthat/data/metadata.yml deleted file mode 100644 index 4eb163b34..000000000 --- a/tests/testthat/data/metadata.yml +++ /dev/null @@ -1,39 +0,0 @@ -source: - primary: - key: Test_2022 - bibtype: Article - year: unknown - author: unknown - title: unknown - journal: unknown - volume: unknown - number: unknown - pages: unknown - doi: unknown -contributors: - data_collectors: - - last_name: unknown - given_name: unknown - ORCID: unknown - affiliation: unknown - assistants: unknown - dataset_curators: unknown -dataset: - data_is_long_format: unknown - custom_R_code: .na - collection_date: unknown - taxon_name: unknown - location_name: unknown - description: unknown - basis_of_record: unknown - life_stage: unknown - sampling_strategy: unknown - original_file: unknown - notes: unknown -locations: .na -contexts: .na -traits: .na -substitutions: .na -taxonomic_updates: .na -exclude_observations: .na -questions: .na diff --git a/tests/testthat/data/test.bib b/tests/testthat/data/test.bib deleted file mode 100644 index b84078b24..000000000 --- a/tests/testthat/data/test.bib +++ /dev/null @@ -1,11 +0,0 @@ -@article{Truong_2021, - doi = {10.3389/fmars.2021.671145}, - url = {https://doi.org/10.3389%2Ffmars.2021.671145}, - year = 2021, - month = {sep}, - publisher = {Frontiers Media {SA}}, - volume = {8}, - author = {Gary Truong and Tracey L. Rogers}, - title = {Seasonal Occurrence of Sympatric Blue Whale Subspecies: the Chilean and Southeast Indian Ocean Pygmy Blue Whales With the Antarctic Blue Whale}, - journal = {Frontiers in Marine Science} -} diff --git a/tests/testthat/data/test2.bib b/tests/testthat/data/test2.bib deleted file mode 100644 index 7ece12b75..000000000 --- a/tests/testthat/data/test2.bib +++ /dev/null @@ -1,13 +0,0 @@ -@article{FALSTER_2005, - doi = {10.1111/j.0022-0477.2005.00992.x}, - url = {https://doi.org/10.1111%2Fj.0022-0477.2005.00992.x}, - year = 2005, - month = {jun}, - publisher = {Wiley}, - volume = {93}, - number = {3}, - pages = {521--535}, - author = {DANIEL S. FALSTER and MARK WESTOBY}, - title = {Alternative height strategies among 45 dicot rain forest species from tropical Queensland, Australia}, - journal = {Journal of Ecology} -} diff --git a/tests/testthat/examples/test1-data.csv b/tests/testthat/examples/test1-data.csv deleted file mode 100644 index 6cfcbcb79..000000000 --- a/tests/testthat/examples/test1-data.csv +++ /dev/null @@ -1,46 +0,0 @@ -Species,species_abb,site,LMA (mg mm-2),Leaf nitrogen (mg mg-1),leaf size (mm2),wood density (mg mm-3),branch mass fraction,Seed mass (mg),LASA10,LASA250,LASA50,LASA1000 -Acacia celsa,acacel,Atherton,0.145,0.0214,2786,0.498,0.67,10.3,2977,7260,3722,6824 -Acronychia acidula,acraci,Atherton,0.085,0.0243,14302,0.525,0.48,,,7560,5541,9480 -Alphitonia petriei,alppet,Atherton,0.149,0.0163,6820,0.413,0.42,27.2,,4340,3313,4335 -Glochidion hylandii,glohyl,Atherton,0.106,0.0137,3209,0.566,0.41,10.41,1993,5075,5455,8664 -Homalanthus novoguineensis,omanov,Atherton,0.082,0.022,10682,0.319,0.47,7,,2136,2158,3307 -Melicope elleryana,melell,Atherton,0.075,0.0268,6955,0.346,0.58,1.61,,4201,2860,6119 -Neolitsea dealbata,neodea,Atherton,0.093,0.0164,5228,0.352,0.58,176.1,1686,2747,3049,7504 -Polyscias australiana,polaus,Atherton,0.079,0.0154,6806,0.397,0.42,8.35,,6008,,6700 -Psychotria sp Utchee Creek,psyspp,Atherton,0.108,0.0179,11157,0.582,0,23.09,,4977,2302,2037 -Rhodomyrtus trineura,rhotri,Atherton,0.129,0.0111,3401,0.763,0.34,,4321,3803,6088,6877 -Acmena graveolens,acmgra,Cape Tribulation,0.151,0.0155,5246,0.599,0.67,,,3057,2667,7156 -Aleurites rockinghamensis,aleroc,Cape Tribulation,0.113,0.0184,73984,0.28,0.02,7077,,4194,,6209 -Alstonia scholaris,alssch,Cape Tribulation,0.107,0.0223,6182,0.361,0.46,1.53,,1854,1682,3932 -Argyrodendron peralatum,argper,Cape Tribulation,0.244,0.0119,3201,0.726,0.71,433,,3832,1689,6718 -Atractocarpus hirtus,atrhir,Cape Tribulation,0.072,0.0157,11374,0.804,0.28,,,7143,6727,6103 -Brombya platynema,bropla,Cape Tribulation,0.106,0.0188,8218,0.603,0.33,,,4261,3531,5377 -Cardwellia sublimis,carsub,Cape Tribulation,0.127,0.0128,4352,0.603,0.56,582.3,,6315,4880,8282 -Castanospermum australe,casaus,Cape Tribulation,0.117,0.0237,2765,0.587,0.37,14851,,7329,,8869 -Cleistanthus myrianthus,clemyr,Cape Tribulation,0.078,0.0228,4828,0.588,0.56,,3720,6084,5233,8559 -Cryptocarya laevigata,crylae,Cape Tribulation,0.087,0.0156,2682,0.64,0.65,1281,1391,3297,4680,7588 -Cryptocarya mackinnoniana,crymac,Cape Tribulation,0.204,0.0152,10458,0.655,0.61,204,,3277,2325,8657 -Cryptocarya murrayi,crymur,Cape Tribulation,0.155,0.0167,9960,0.674,0.39,,2693,5543,4298,5451 -Dendrocnide moroides,denmor,Cape Tribulation,0.052,0.0312,26454,0.23,0.46,0.71,,2372,,2090 -Elaeocarpus grandis,elaang,Cape Tribulation,0.122,0.0187,2762,0.499,0.47,3699,,2598,1748,4635 -Endiandra leptodendron,endlep,Cape Tribulation,0.106,0.018,3987,0.611,0.68,,1492,2412,2783,7477 -Endiandra microneura,endmic,Cape Tribulation,0.151,0.0177,3377,0.623,0.61,,3573,6344,3354,6235 -Gillbeea adenopetala,gilade,Cape Tribulation,0.126,0.0096,3678,0.43,0.46,15,,2863,3160,6549 -Haplostichanthus sp Coop. Ck,hapspp,Cape Tribulation,0.072,0.022,4685,0.668,0.36,,2430,12304,3282,2992 -Harpullia rhyticarpa,harrhy,Cape Tribulation,0.076,0.0174,40876,0.621,0.01,,,8971,5922,4669 -Hernandia albiflora,heralb,Cape Tribulation,0.069,0.0195,3806,0.447,0.33,,3123,4145,4643,6086 -Ixora biflora,ixobif,Cape Tribulation,0.081,0.01,2760,0.843,0.55,41.5,5244,3892,1969,8094 -Lasianthus strigosus,lasstr,Cape Tribulation,0.055,0.0158,3313,0.684,0.15,7,1841,5100,2379,2731 -Litsea leefeana,litlee,Cape Tribulation,0.13,0.0144,3917,0.549,0.68,263.4,3984,4141,3816,9645 -Macaranga tanarius,mactan,Cape Tribulation,0.104,0.0205,46676,0.344,0,,,3377,,3901 -Mallotus mollissimus,malmol,Cape Tribulation,0.063,0.0352,16716,0.373,0.32,31.25,1788,5580,5163,7944 -Medicosma sessiliflora,medses,Cape Tribulation,0.106,0.0153,8164,0.69,0.65,,2844,9332,6514,10298 -Melastoma cyanoides,melaff,Cape Tribulation,0.046,0.0208,4009,0.381,0.6,0.07,2960,4057,4661,6637 -Myristica insipida,myrins,Cape Tribulation,0.106,0.0185,8379,0.433,0.51,1612,,6929,4852,9273 -Pittosporum rubiginosum,pitrub,Cape Tribulation,0.065,0.0143,9931,0.728,0.28,27.94,7428,7459,5265,6548 -Psychotria dallachiana,psydal,Cape Tribulation,0.079,0.0177,2495,0.612,0.33,,4290,5666,4916,4761 -Quassia baileyana,quabai,Cape Tribulation,0.086,0.023,9624,0.501,0.42,,,5867,3216,5719 -Rockinghamia angustifolia,rocang,Cape Tribulation,0.108,0.0158,10636,0.455,0.39,19.38,,5862,4611,6098 -Syzygium gustavioides,syzgus,Cape Tribulation,0.167,0.0129,3590,0.521,0.59,48000,2833,3121,3047,6584 -Syzygium sayeri,syzsay,Cape Tribulation,0.131,0.0137,2645,0.485,0.65,841,3929,5767,4939,9836 -Trema aspera,treasp,Cape Tribulation,0.053,0.0299,2071,0.357,0.53,5.12,3578,5291,5440,6695 diff --git a/tests/testthat/examples/test1-metadata.yml b/tests/testthat/examples/test1-metadata.yml deleted file mode 100644 index dbce2dff0..000000000 --- a/tests/testthat/examples/test1-metadata.yml +++ /dev/null @@ -1,316 +0,0 @@ -source: - primary: - key: Falster_2005_1 - bibtype: Article - author: Daniel S. Falster, Mark Westoby - year: 2005 - title: Alternative height strategies among 45 dicot rain forest species from tropical - Queensland, Australia - journal: Journal of Ecology - volume: 93 - pages: 521--535 - publisher: Wiley-Blackwell - doi: 10.1111/j.0022-0477.2005.00992.x -contributors: - data_collectors: - - last_name: Falster - given_name: Daniel - ORCID: 0000-0002-9814-092X - affiliation: Evolution & Ecology Research Centre, School of Biological, Earth, - and Environmental Sciences, UNSW Sydney, Australia - additional_role: contact - - last_name: Westoby - given_name: Mark - ORCID: 0000-0001-7690-4530 - affiliation: Department of Biological Sciences, Macquarie University, Australia - dataset_curators: Elizabeth Wenk -dataset: - data_is_long_format: no - custom_R_code: .na - collection_date: 2004/2004 - taxon_name: Species - location_name: site - description: Investigation into trait values correlated with plant height along - light availability and successional gradients for far north Queensland species. - basis_of_record: field - life_stage: adult - sampling_strategy: Nineteen species, ranging from early to late successional status, - were selected using published sources (Hopkins & Graham 1987; Osunkoya 1996; Hyland - et al. 1999). Species selected to represent the light gradient establish and mature - in closed forest, where successional species are assumed absent. For inclusion - in this set we required that a species was known to establish and persist at low - light levels, as indicated either by published sources (Hyland et al. 1999; Osunkoya - 1996) or by scientists familiar with the vegetation (A Graham, J Wells, CSIRO - Atherton; R Jensen). Twenty-six species, experiencing a range of light levels - at maturity, from high (canopy trees) to low light (understorey shrubs), were - included. - original_file: Falster & Westoby 2005 J Ecol appendix.doc - notes: none -locations: - Atherton: - description: Tropical rain forest vegetation. - elevation (m): 800 - latitude (deg): -17.1166667 - longitude (deg): 145.65 - rainfall (mm): 2000 - Cape Tribulation: - description: Complex mesophyll vine forest in tropical rain forest. - elevation (m): 25 - latitude (deg): -16.1 - longitude (deg): 145.45 - rainfall (mm): 3500 -contexts: .na -traits: -- var_in: LMA (mg mm-2) - unit_in: mg/mm2 - trait_name: leaf_mass_per_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: LMA was calculated as the leaf dry mass (oven-dried for 48 hours at 65 - deg C) divided by leaf size. It was measured on the first five fully expanded - leaves at the tip of each individual. -- var_in: Leaf nitrogen (mg mg-1) - unit_in: mg/mg - trait_name: leaf_N_per_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaves from all individuals per species were pooled and finely ground for - nitrogen analysis. Total nitrogen concentration (%) was measured using complete - combustion gas chromatography by Waite Analytical Services, Adelaide. The first - five fully expanded leaves at the tip of each individual were used for the analysis. -- var_in: leaf size (mm2) - unit_in: mm2 - trait_name: leaf_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaf size was calculated as the one-sided leaf area (flat bed scanner). - It was measured on the first five fully expanded leaves at the tip of each individual. -- var_in: wood density (mg mm-3) - unit_in: mg/mm3 - trait_name: wood_density - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Wood density was calculated using 40-60 mm stem segments taken 250 mm and - 1000 mm back along a branch from the branch tip. Fresh samples were refrigerated - before processing. After removing bark material, the volume of each wood sample - was determined using Archimedes' principle (Hacke et al. 2000). Samples were submerged - in a water-filled container on a balance. The weight change (mg) recorded during - submersion corresponds to the mass of water displaced, which can be converted - to a volume using the formula, displacement weight (mg)/0.998 (mg/mm3), where - 0.998 mg/mm3 is the density of water at 20 deg C. Samples were then dried for - 4 days at 60 deg C before weighing. -- var_in: branch mass fraction - unit_in: mg/mg - trait_name: branch_mass_fraction - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Branch mass fraction was calculated as the mass side branches/total mass, - on a carbon dry mass basis. The zero values are correct - these are plants with - no branches. -- var_in: Seed mass (mg) - unit_in: mg - trait_name: seed_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: unknown - methods: Mean oven-dried seed mass (including seed coat but excluding seed accessories) - was estimated for all species with available field material. In total, collections - for 17 of 47 species were made. Data for an additional 12 species were drawn from - published (Osunkoya et al. 1994; Grubb et al. 1998) and unpublished (P. Juniper, - CSIRO Atherton) sources. -- var_in: LASA10 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a shoot whose sapwood had a cross sectional - area of 10 mm2. In detail from Wright_2006, which used this data, No single best - point exists to compare traits such as LM/ SM, LA/SM and LA/SA when considering - a set of species that varies widely in canopy architecture and typical maximum - height (here, approximately 20 cm to 85 m). We have used several approaches (Table - 1). In one study, we made measurements on the terminal twigs of each species, - i.e. on a relatively standard developmental unit (Westoby and Wright 2003). For - species at Ash, GLP, Myall and TRF, traits were measured at each of several different - distances back down the stem from the branch tip (Falster and Westoby 2005a, 2005b - and unpublished, Pickup et al. 2005). At GHP, RHM and RHW, traits were measured - at a standard sapwood cross-sectional area (10 mm2; Pickup et al. 2005). For the - present re-analysis, we took the raw data from the previous studies and, for every - species possible, calculated patterns of leaf and stem deployment at two standard - points: at 250 mm distance from the branch tip (Ash, GLP, Myall and TRF) and at - 10 mm2 stem (Ash, Myall, TRF) or sapwood (GHP, GLP, RHM, RHW) crosssectional area - (250 mm or 10 mm2 formulation denoted as subscript in trait abbreviations). This - was done as follows. For each individual plant, total leaf and stem dry mass at - 250 mm distance was estimated by straightline interpolation from values measured - at the nearest sampling points on either side of this distance. As the dry mass - data tended to display non-linear (power) relationships with distance from the - branch tip, the interpolated values were calculated from log10-log10- transformed - data, then back-transformed to the original scale. The same approach was used - for interpolating data to the standard stem (or sapwood) cross-sectional area. - For individuals where measurements had not been made on either side of the desired - point but the nearest measurement had been made within 25 mm of 250 mm or 1 mm2 - of 10 mm2 cross-section (i.e. within 10% of the desired point), we extrapolated - (rather than interpolated) the measured data to the standard point. This allowed - us to include a number of individuals and species for which interpolation was - not possible. Still, several large-leaved, large-stemmed species from the TRF - site could not be included in the 10-mm2 crosssection dataset. No unusual tendencies - in analyses, including the extrapolated data, were seen in comparison to analyses - including interpolated data only (details not shown). To illustrate how species'' - morphology varied at the two standard sampling points, species-mean stem cross-sectional - area varied between 1.2 and 258 mm2 at 250 mm distance from the branch tip, while - the distance from the branch tip at which stem cross-sectional area reached 10 - mm2 varied from 64 to 995 mm.' -- var_in: LASA250 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 250 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA50 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 50 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA1000 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 1000 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -substitutions: .na -taxonomic_updates: -- find: Homalanthus novoguineensis - replace: Homalanthus novo-guineensis - reason: Change spelling to align with known name in APC (Daniel Falster, 2020.05.22) -- find: Haplostichanthus sp Coop. Ck - replace: Haplostichanthus submontanus - reason: Align previous phrase name with current APC name (E. Wenk, 2020-05-25) -- find: Psychotria sp Utchee Creek - replace: Psychotria sp. Utchee Creek (H.Flecker NQNC5313) - reason: Align to name in APC (D Falster, 2020.05.23) -exclude_observations: .na -questions: .na diff --git a/tests/testthat/examples/test2-data.csv b/tests/testthat/examples/test2-data.csv deleted file mode 100644 index d9e9f1a30..000000000 --- a/tests/testthat/examples/test2-data.csv +++ /dev/null @@ -1,46 +0,0 @@ -Species,species_abb,site,LMA (mg mm-2),Leaf nitrogen (mg mg-1),leaf size (mm2),wood density (mg mm-3),branch mass fraction,Seed mass (mg),LASA10,LASA250,LASA50,LASA1000,basis_of_record,life_stage -Acacia celsa,acacel,Atherton,0.145,0.0214,2786,0.498,0.67,10.3,2977,7260,3722,6824,wild,seedling -Acronychia acidula,acraci,Atherton,0.085,0.0243,14302,0.525,0.48,,,7560,5541,9480,wild,seedling -Alphitonia petriei,alppet,Atherton,0.149,0.0163,6820,0.413,0.42,27.2,,4340,3313,4335,wild,seedling -Glochidion hylandii,glohyl,Atherton,0.106,0.0137,3209,0.566,0.41,10.41,1993,5075,5455,8664,wild,seedling -Homalanthus novoguineensis,omanov,Atherton,0.082,0.022,10682,0.319,0.47,7,,2136,2158,3307,wild,seedling -Melicope elleryana,melell,Atherton,0.075,0.0268,6955,0.346,0.58,1.61,,4201,2860,6119,wild,seedling -Neolitsea dealbata,neodea,Atherton,0.093,0.0164,5228,0.352,0.58,176.1,1686,2747,3049,7504,wild,seedling -Polyscias australiana,polaus,Atherton,0.079,0.0154,6806,0.397,0.42,8.35,,6008,,6700,wild,seedling -Psychotria sp Utchee Creek,psyspp,Atherton,0.108,0.0179,11157,0.582,0,23.09,,4977,2302,2037,wild,seedling -Rhodomyrtus trineura,rhotri,Atherton,0.129,0.0111,3401,0.763,0.34,,4321,3803,6088,6877,wild,seedling -Acmena graveolens,acmgra,Cape Tribulation,0.151,0.0155,5246,0.599,0.67,,,3057,2667,7156,wild,seedling -Aleurites rockinghamensis,aleroc,Cape Tribulation,0.113,0.0184,73984,0.28,0.02,7077,,4194,,6209,wild,seedling -Alstonia scholaris,alssch,Cape Tribulation,0.107,0.0223,6182,0.361,0.46,1.53,,1854,1682,3932,wild,seedling -Argyrodendron peralatum,argper,Cape Tribulation,0.244,0.0119,3201,0.726,0.71,433,,3832,1689,6718,wild,seedling -Atractocarpus hirtus,atrhir,Cape Tribulation,0.072,0.0157,11374,0.804,0.28,,,7143,6727,6103,wild,seedling -Brombya platynema,bropla,Cape Tribulation,0.106,0.0188,8218,0.603,0.33,,,4261,3531,5377,wild,seedling -Cardwellia sublimis,carsub,Cape Tribulation,0.127,0.0128,4352,0.603,0.56,582.3,,6315,4880,8282,wild,seedling -Castanospermum australe,casaus,Cape Tribulation,0.117,0.0237,2765,0.587,0.37,14851,,7329,,8869,wild,seedling -Cleistanthus myrianthus,clemyr,Cape Tribulation,0.078,0.0228,4828,0.588,0.56,,3720,6084,5233,8559,wild,seedling -Cryptocarya laevigata,crylae,Cape Tribulation,0.087,0.0156,2682,0.64,0.65,1281,1391,3297,4680,7588,wild,seedling -Cryptocarya mackinnoniana,crymac,Cape Tribulation,0.204,0.0152,10458,0.655,0.61,204,,3277,2325,8657,wild,seedling -Cryptocarya murrayi,crymur,Cape Tribulation,0.155,0.0167,9960,0.674,0.39,,2693,5543,4298,5451,wild,seedling -Dendrocnide moroides,denmor,Cape Tribulation,0.052,0.0312,26454,0.23,0.46,0.71,,2372,,2090,wild,seedling -Elaeocarpus grandis,elaang,Cape Tribulation,0.122,0.0187,2762,0.499,0.47,3699,,2598,1748,4635,wild,seedling -Endiandra leptodendron,endlep,Cape Tribulation,0.106,0.018,3987,0.611,0.68,,1492,2412,2783,7477,wild,seedling -Endiandra microneura,endmic,Cape Tribulation,0.151,0.0177,3377,0.623,0.61,,3573,6344,3354,6235,wild,seedling -Gillbeea adenopetala,gilade,Cape Tribulation,0.126,0.0096,3678,0.43,0.46,15,,2863,3160,6549,wild,seedling -Haplostichanthus sp Coop. Ck,hapspp,Cape Tribulation,0.072,0.022,4685,0.668,0.36,,2430,12304,3282,2992,wild,seedling -Harpullia rhyticarpa,harrhy,Cape Tribulation,0.076,0.0174,40876,0.621,0.01,,,8971,5922,4669,wild,seedling -Hernandia albiflora,heralb,Cape Tribulation,0.069,0.0195,3806,0.447,0.33,,3123,4145,4643,6086,wild,seedling -Ixora biflora,ixobif,Cape Tribulation,0.081,0.01,2760,0.843,0.55,41.5,5244,3892,1969,8094,wild,seedling -Lasianthus strigosus,lasstr,Cape Tribulation,0.055,0.0158,3313,0.684,0.15,7,1841,5100,2379,2731,wild,seedling -Litsea leefeana,litlee,Cape Tribulation,0.13,0.0144,3917,0.549,0.68,263.4,3984,4141,3816,9645,wild,seedling -Macaranga tanarius,mactan,Cape Tribulation,0.104,0.0205,46676,0.344,0,,,3377,,3901,wild,seedling -Mallotus mollissimus,malmol,Cape Tribulation,0.063,0.0352,16716,0.373,0.32,31.25,1788,5580,5163,7944,wild,seedling -Medicosma sessiliflora,medses,Cape Tribulation,0.106,0.0153,8164,0.69,0.65,,2844,9332,6514,10298,wild,seedling -Melastoma cyanoides,melaff,Cape Tribulation,0.046,0.0208,4009,0.381,0.6,0.07,2960,4057,4661,6637,wild,seedling -Myristica insipida,myrins,Cape Tribulation,0.106,0.0185,8379,0.433,0.51,1612,,6929,4852,9273,wild,seedling -Pittosporum rubiginosum,pitrub,Cape Tribulation,0.065,0.0143,9931,0.728,0.28,27.94,7428,7459,5265,6548,wild,seedling -Psychotria dallachiana,psydal,Cape Tribulation,0.079,0.0177,2495,0.612,0.33,,4290,5666,4916,4761,wild,seedling -Quassia baileyana,quabai,Cape Tribulation,0.086,0.023,9624,0.501,0.42,,,5867,3216,5719,wild,seedling -Rockinghamia angustifolia,rocang,Cape Tribulation,0.108,0.0158,10636,0.455,0.39,19.38,,5862,4611,6098,wild,seedling -Syzygium gustavioides,syzgus,Cape Tribulation,0.167,0.0129,3590,0.521,0.59,48000,2833,3121,3047,6584,wild,seedling -Syzygium sayeri,syzsay,Cape Tribulation,0.131,0.0137,2645,0.485,0.65,841,3929,5767,4939,9836,wild,seedling -Trema aspera,treasp,Cape Tribulation,0.053,0.0299,2071,0.357,0.53,5.12,3578,5291,5440,6695,wild,seedling diff --git a/tests/testthat/examples/test2-metadata.yml b/tests/testthat/examples/test2-metadata.yml deleted file mode 100644 index c89a96d66..000000000 --- a/tests/testthat/examples/test2-metadata.yml +++ /dev/null @@ -1,317 +0,0 @@ -source: - primary: - key: Falster_2005_1 - bibtype: Article - author: Daniel S. Falster, Mark Westoby - year: 2005 - title: Alternative height strategies among 45 dicot rain forest species from tropical - Queensland, Australia - journal: Journal of Ecology - volume: 93 - pages: 521--535 - publisher: Wiley-Blackwell - doi: 10.1111/j.0022-0477.2005.00992.x -contributors: - data_collectors: - - last_name: Falster - given_name: Daniel - ORCID: 0000-0002-9814-092X - affiliation: Evolution & Ecology Research Centre, School of Biological, Earth, - and Environmental Sciences, UNSW Sydney, Australia - additional_role: contact - - last_name: Westoby - given_name: Mark - ORCID: 0000-0001-7690-4530 - affiliation: Department of Biological Sciences, Macquarie University, Australia - dataset_curators: Elizabeth Wenk -dataset: - data_is_long_format: no - custom_R_code: .na - collection_date: 2004/2004 - taxon_name: Species - location_name: site - description: Investigation into trait values correlated with plant height along - light availability and successional gradients for far north Queensland species. - basis_of_record: field - life_stage: adult - sampling_strategy: Nineteen species, ranging from early to late successional status, - were selected using published sources (Hopkins & Graham 1987; Osunkoya 1996; Hyland - et al. 1999). Species selected to represent the light gradient establish and mature - in closed forest, where successional species are assumed absent. For inclusion - in this set we required that a species was known to establish and persist at low - light levels, as indicated either by published sources (Hyland et al. 1999; Osunkoya - 1996) or by scientists familiar with the vegetation (A Graham, J Wells, CSIRO - Atherton; R Jensen). Twenty-six species, experiencing a range of light levels - at maturity, from high (canopy trees) to low light (understorey shrubs), were - included. - original_file: Falster & Westoby 2005 J Ecol appendix.doc - notes: none -locations: - Atherton: - description: Tropical rain forest vegetation. - elevation (m): 800 - latitude (deg): -17.1166667 - longitude (deg): 145.65 - rainfall (mm): 2000 - Cape Tribulation: - description: Complex mesophyll vine forest in tropical rain forest. - elevation (m): 25 - latitude (deg): -16.1 - longitude (deg): 145.45 - rainfall (mm): 3500 -contexts: .na -traits: -- var_in: LMA (mg mm-2) - unit_in: mg/mm2 - trait_name: leaf_mass_per_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: LMA was calculated as the leaf dry mass (oven-dried for 48 hours at 65 - deg C) divided by leaf size. It was measured on the first five fully expanded - leaves at the tip of each individual. -- var_in: Leaf nitrogen (mg mg-1) - unit_in: mg/mg - trait_name: leaf_N_per_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - basis_of_record: lab - methods: Leaves from all individuals per species were pooled and finely ground for - nitrogen analysis. Total nitrogen concentration (%) was measured using complete - combustion gas chromatography by Waite Analytical Services, Adelaide. The first - five fully expanded leaves at the tip of each individual were used for the analysis. -- var_in: leaf size (mm2) - unit_in: mm2 - trait_name: leaf_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaf size was calculated as the one-sided leaf area (flat bed scanner). - It was measured on the first five fully expanded leaves at the tip of each individual. -- var_in: wood density (mg mm-3) - unit_in: mg/mm3 - trait_name: wood_density - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Wood density was calculated using 40-60 mm stem segments taken 250 mm and - 1000 mm back along a branch from the branch tip. Fresh samples were refrigerated - before processing. After removing bark material, the volume of each wood sample - was determined using Archimedes' principle (Hacke et al. 2000). Samples were submerged - in a water-filled container on a balance. The weight change (mg) recorded during - submersion corresponds to the mass of water displaced, which can be converted - to a volume using the formula, displacement weight (mg)/0.998 (mg/mm3), where - 0.998 mg/mm3 is the density of water at 20 deg C. Samples were then dried for - 4 days at 60 deg C before weighing. -- var_in: branch mass fraction - unit_in: mg/mg - trait_name: branch_mass_fraction - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Branch mass fraction was calculated as the mass side branches/total mass, - on a carbon dry mass basis. The zero values are correct - these are plants with - no branches. -- var_in: Seed mass (mg) - unit_in: mg - trait_name: seed_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: unknown - methods: Mean oven-dried seed mass (including seed coat but excluding seed accessories) - was estimated for all species with available field material. In total, collections - for 17 of 47 species were made. Data for an additional 12 species were drawn from - published (Osunkoya et al. 1994; Grubb et al. 1998) and unpublished (P. Juniper, - CSIRO Atherton) sources. -- var_in: LASA10 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a shoot whose sapwood had a cross sectional - area of 10 mm2. In detail from Wright_2006, which used this data, No single best - point exists to compare traits such as LM/ SM, LA/SM and LA/SA when considering - a set of species that varies widely in canopy architecture and typical maximum - height (here, approximately 20 cm to 85 m). We have used several approaches (Table - 1). In one study, we made measurements on the terminal twigs of each species, - i.e. on a relatively standard developmental unit (Westoby and Wright 2003). For - species at Ash, GLP, Myall and TRF, traits were measured at each of several different - distances back down the stem from the branch tip (Falster and Westoby 2005a, 2005b - and unpublished, Pickup et al. 2005). At GHP, RHM and RHW, traits were measured - at a standard sapwood cross-sectional area (10 mm2; Pickup et al. 2005). For the - present re-analysis, we took the raw data from the previous studies and, for every - species possible, calculated patterns of leaf and stem deployment at two standard - points: at 250 mm distance from the branch tip (Ash, GLP, Myall and TRF) and at - 10 mm2 stem (Ash, Myall, TRF) or sapwood (GHP, GLP, RHM, RHW) crosssectional area - (250 mm or 10 mm2 formulation denoted as subscript in trait abbreviations). This - was done as follows. For each individual plant, total leaf and stem dry mass at - 250 mm distance was estimated by straightline interpolation from values measured - at the nearest sampling points on either side of this distance. As the dry mass - data tended to display non-linear (power) relationships with distance from the - branch tip, the interpolated values were calculated from log10-log10- transformed - data, then back-transformed to the original scale. The same approach was used - for interpolating data to the standard stem (or sapwood) cross-sectional area. - For individuals where measurements had not been made on either side of the desired - point but the nearest measurement had been made within 25 mm of 250 mm or 1 mm2 - of 10 mm2 cross-section (i.e. within 10% of the desired point), we extrapolated - (rather than interpolated) the measured data to the standard point. This allowed - us to include a number of individuals and species for which interpolation was - not possible. Still, several large-leaved, large-stemmed species from the TRF - site could not be included in the 10-mm2 crosssection dataset. No unusual tendencies - in analyses, including the extrapolated data, were seen in comparison to analyses - including interpolated data only (details not shown). To illustrate how species'' - morphology varied at the two standard sampling points, species-mean stem cross-sectional - area varied between 1.2 and 258 mm2 at 250 mm distance from the branch tip, while - the distance from the branch tip at which stem cross-sectional area reached 10 - mm2 varied from 64 to 995 mm.' -- var_in: LASA250 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 250 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA50 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 50 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA1000 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 1000 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -substitutions: .na -taxonomic_updates: -- find: Homalanthus novoguineensis - replace: Homalanthus novo-guineensis - reason: Change spelling to align with known name in APC (Daniel Falster, 2020.05.22) -- find: Haplostichanthus sp Coop. Ck - replace: Haplostichanthus submontanus - reason: Align previous phrase name with current APC name (E. Wenk, 2020-05-25) -- find: Psychotria sp Utchee Creek - replace: Psychotria sp. Utchee Creek (H.Flecker NQNC5313) - reason: Align to name in APC (D Falster, 2020.05.23) -exclude_observations: .na -questions: .na diff --git a/tests/testthat/examples/test2.1-metadata.yml b/tests/testthat/examples/test2.1-metadata.yml deleted file mode 100644 index b8fdc9eba..000000000 --- a/tests/testthat/examples/test2.1-metadata.yml +++ /dev/null @@ -1,317 +0,0 @@ -source: - primary: - key: Falster_2005_1 - bibtype: Article - author: Daniel S. Falster, Mark Westoby - year: 2005 - title: Alternative height strategies among 45 dicot rain forest species from tropical - Queensland, Australia - journal: Journal of Ecology - volume: 93 - pages: 521--535 - publisher: Wiley-Blackwell - doi: 10.1111/j.0022-0477.2005.00992.x -contributors: - data_collectors: - - last_name: Falster - given_name: Daniel - ORCID: 0000-0002-9814-092X - affiliation: Evolution & Ecology Research Centre, School of Biological, Earth, - and Environmental Sciences, UNSW Sydney, Australia - additional_role: contact - - last_name: Westoby - given_name: Mark - ORCID: 0000-0001-7690-4530 - affiliation: Department of Biological Sciences, Macquarie University, Australia - dataset_curators: Elizabeth Wenk -dataset: - data_is_long_format: no - custom_R_code: .na - collection_date: 2004/2004 - taxon_name: Species - location_name: site - description: Investigation into trait values correlated with plant height along - light availability and successional gradients for far north Queensland species. - basis_of_record: basis_of_record - life_stage: life_stage - sampling_strategy: Nineteen species, ranging from early to late successional status, - were selected using published sources (Hopkins & Graham 1987; Osunkoya 1996; Hyland - et al. 1999). Species selected to represent the light gradient establish and mature - in closed forest, where successional species are assumed absent. For inclusion - in this set we required that a species was known to establish and persist at low - light levels, as indicated either by published sources (Hyland et al. 1999; Osunkoya - 1996) or by scientists familiar with the vegetation (A Graham, J Wells, CSIRO - Atherton; R Jensen). Twenty-six species, experiencing a range of light levels - at maturity, from high (canopy trees) to low light (understorey shrubs), were - included. - original_file: Falster & Westoby 2005 J Ecol appendix.doc - notes: none -locations: - Atherton: - description: Tropical rain forest vegetation. - elevation (m): 800 - latitude (deg): -17.1166667 - longitude (deg): 145.65 - rainfall (mm): 2000 - Cape Tribulation: - description: Complex mesophyll vine forest in tropical rain forest. - elevation (m): 25 - latitude (deg): -16.1 - longitude (deg): 145.45 - rainfall (mm): 3500 -contexts: .na -traits: -- var_in: LMA (mg mm-2) - unit_in: mg/mm2 - trait_name: leaf_mass_per_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: LMA was calculated as the leaf dry mass (oven-dried for 48 hours at 65 - deg C) divided by leaf size. It was measured on the first five fully expanded - leaves at the tip of each individual. -- var_in: Leaf nitrogen (mg mg-1) - unit_in: mg/mg - trait_name: leaf_N_per_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - basis_of_record: lab - methods: Leaves from all individuals per species were pooled and finely ground for - nitrogen analysis. Total nitrogen concentration (%) was measured using complete - combustion gas chromatography by Waite Analytical Services, Adelaide. The first - five fully expanded leaves at the tip of each individual were used for the analysis. -- var_in: leaf size (mm2) - unit_in: mm2 - trait_name: leaf_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaf size was calculated as the one-sided leaf area (flat bed scanner). - It was measured on the first five fully expanded leaves at the tip of each individual. -- var_in: wood density (mg mm-3) - unit_in: mg/mm3 - trait_name: wood_density - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Wood density was calculated using 40-60 mm stem segments taken 250 mm and - 1000 mm back along a branch from the branch tip. Fresh samples were refrigerated - before processing. After removing bark material, the volume of each wood sample - was determined using Archimedes' principle (Hacke et al. 2000). Samples were submerged - in a water-filled container on a balance. The weight change (mg) recorded during - submersion corresponds to the mass of water displaced, which can be converted - to a volume using the formula, displacement weight (mg)/0.998 (mg/mm3), where - 0.998 mg/mm3 is the density of water at 20 deg C. Samples were then dried for - 4 days at 60 deg C before weighing. -- var_in: branch mass fraction - unit_in: mg/mg - trait_name: branch_mass_fraction - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Branch mass fraction was calculated as the mass side branches/total mass, - on a carbon dry mass basis. The zero values are correct - these are plants with - no branches. -- var_in: Seed mass (mg) - unit_in: mg - trait_name: seed_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: unknown - methods: Mean oven-dried seed mass (including seed coat but excluding seed accessories) - was estimated for all species with available field material. In total, collections - for 17 of 47 species were made. Data for an additional 12 species were drawn from - published (Osunkoya et al. 1994; Grubb et al. 1998) and unpublished (P. Juniper, - CSIRO Atherton) sources. -- var_in: LASA10 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a shoot whose sapwood had a cross sectional - area of 10 mm2. In detail from Wright_2006, which used this data, No single best - point exists to compare traits such as LM/ SM, LA/SM and LA/SA when considering - a set of species that varies widely in canopy architecture and typical maximum - height (here, approximately 20 cm to 85 m). We have used several approaches (Table - 1). In one study, we made measurements on the terminal twigs of each species, - i.e. on a relatively standard developmental unit (Westoby and Wright 2003). For - species at Ash, GLP, Myall and TRF, traits were measured at each of several different - distances back down the stem from the branch tip (Falster and Westoby 2005a, 2005b - and unpublished, Pickup et al. 2005). At GHP, RHM and RHW, traits were measured - at a standard sapwood cross-sectional area (10 mm2; Pickup et al. 2005). For the - present re-analysis, we took the raw data from the previous studies and, for every - species possible, calculated patterns of leaf and stem deployment at two standard - points: at 250 mm distance from the branch tip (Ash, GLP, Myall and TRF) and at - 10 mm2 stem (Ash, Myall, TRF) or sapwood (GHP, GLP, RHM, RHW) crosssectional area - (250 mm or 10 mm2 formulation denoted as subscript in trait abbreviations). This - was done as follows. For each individual plant, total leaf and stem dry mass at - 250 mm distance was estimated by straightline interpolation from values measured - at the nearest sampling points on either side of this distance. As the dry mass - data tended to display non-linear (power) relationships with distance from the - branch tip, the interpolated values were calculated from log10-log10- transformed - data, then back-transformed to the original scale. The same approach was used - for interpolating data to the standard stem (or sapwood) cross-sectional area. - For individuals where measurements had not been made on either side of the desired - point but the nearest measurement had been made within 25 mm of 250 mm or 1 mm2 - of 10 mm2 cross-section (i.e. within 10% of the desired point), we extrapolated - (rather than interpolated) the measured data to the standard point. This allowed - us to include a number of individuals and species for which interpolation was - not possible. Still, several large-leaved, large-stemmed species from the TRF - site could not be included in the 10-mm2 crosssection dataset. No unusual tendencies - in analyses, including the extrapolated data, were seen in comparison to analyses - including interpolated data only (details not shown). To illustrate how species'' - morphology varied at the two standard sampling points, species-mean stem cross-sectional - area varied between 1.2 and 258 mm2 at 250 mm distance from the branch tip, while - the distance from the branch tip at which stem cross-sectional area reached 10 - mm2 varied from 64 to 995 mm.' -- var_in: LASA250 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 250 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA50 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 50 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA1000 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 1000 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -substitutions: .na -taxonomic_updates: -- find: Homalanthus novoguineensis - replace: Homalanthus novo-guineensis - reason: Change spelling to align with known name in APC (Daniel Falster, 2020.05.22) -- find: Haplostichanthus sp Coop. Ck - replace: Haplostichanthus submontanus - reason: Align previous phrase name with current APC name (E. Wenk, 2020-05-25) -- find: Psychotria sp Utchee Creek - replace: Psychotria sp. Utchee Creek (H.Flecker NQNC5313) - reason: Align to name in APC (D Falster, 2020.05.23) -exclude_observations: .na -questions: .na diff --git a/tests/testthat/examples/test3-data.csv b/tests/testthat/examples/test3-data.csv deleted file mode 100644 index caa06bf40..000000000 --- a/tests/testthat/examples/test3-data.csv +++ /dev/null @@ -1,46 +0,0 @@ -Species,species_abb,site,LMA (mg mm-2),Leaf nitrogen (mg mg-1),leaf size (mm2),wood density (mg mm-3),branch mass fraction,Seed mass (mg),LASA10,LASA250,LASA50,LASA1000,basis_of_record -Acacia celsa,acacel,Atherton,0.145,0.0214,2786,0.498,0.67,10.3,2977,7260,3722,6824, -Acronychia acidula,acraci,Atherton,0.085,0.0243,14302,0.525,0.48,,,7560,5541,9480, -Alphitonia petriei,alppet,Atherton,0.149,0.0163,6820,0.413,0.42,27.2,,4340,3313,4335, -Glochidion hylandii,glohyl,Atherton,0.106,0.0137,3209,0.566,0.41,10.41,1993,5075,5455,8664, -Homalanthus novoguineensis,omanov,Atherton,0.082,0.022,10682,0.319,0.47,7,,2136,2158,3307, -Melicope elleryana,melell,Atherton,0.075,0.0268,6955,0.346,0.58,1.61,,4201,2860,6119, -Neolitsea dealbata,neodea,Atherton,0.093,0.0164,5228,0.352,0.58,176.1,1686,2747,3049,7504, -Polyscias australiana,polaus,Atherton,0.079,0.0154,6806,0.397,0.42,8.35,,6008,,6700, -Psychotria sp Utchee Creek,psyspp,Atherton,0.108,0.0179,11157,0.582,0,23.09,,4977,2302,2037, -Rhodomyrtus trineura,rhotri,Atherton,0.129,0.0111,3401,0.763,0.34,,4321,3803,6088,6877, -Acmena graveolens,acmgra,Cape Tribulation,0.151,0.0155,5246,0.599,0.67,,,3057,2667,7156, -Aleurites rockinghamensis,aleroc,Cape Tribulation,0.113,0.0184,73984,0.28,0.02,7077,,4194,,6209, -Alstonia scholaris,alssch,Cape Tribulation,0.107,0.0223,6182,0.361,0.46,1.53,,1854,1682,3932, -Argyrodendron peralatum,argper,Cape Tribulation,0.244,0.0119,3201,0.726,0.71,433,,3832,1689,6718, -Atractocarpus hirtus,atrhir,Cape Tribulation,0.072,0.0157,11374,0.804,0.28,,,7143,6727,6103, -Brombya platynema,bropla,Cape Tribulation,0.106,0.0188,8218,0.603,0.33,,,4261,3531,5377, -Cardwellia sublimis,carsub,Cape Tribulation,0.127,0.0128,4352,0.603,0.56,582.3,,6315,4880,8282, -Castanospermum australe,casaus,Cape Tribulation,0.117,0.0237,2765,0.587,0.37,14851,,7329,,8869, -Cleistanthus myrianthus,clemyr,Cape Tribulation,0.078,0.0228,4828,0.588,0.56,,3720,6084,5233,8559, -Cryptocarya laevigata,crylae,Cape Tribulation,0.087,0.0156,2682,0.64,0.65,1281,1391,3297,4680,7588, -Cryptocarya mackinnoniana,crymac,Cape Tribulation,0.204,0.0152,10458,0.655,0.61,204,,3277,2325,8657, -Cryptocarya murrayi,crymur,Cape Tribulation,0.155,0.0167,9960,0.674,0.39,,2693,5543,4298,5451, -Dendrocnide moroides,denmor,Cape Tribulation,0.052,0.0312,26454,0.23,0.46,0.71,,2372,,2090, -Elaeocarpus grandis,elaang,Cape Tribulation,0.122,0.0187,2762,0.499,0.47,3699,,2598,1748,4635, -Endiandra leptodendron,endlep,Cape Tribulation,0.106,0.018,3987,0.611,0.68,,1492,2412,2783,7477, -Endiandra microneura,endmic,Cape Tribulation,0.151,0.0177,3377,0.623,0.61,,3573,6344,3354,6235, -Gillbeea adenopetala,gilade,Cape Tribulation,0.126,0.0096,3678,0.43,0.46,15,,2863,3160,6549, -Haplostichanthus sp Coop. Ck,hapspp,Cape Tribulation,0.072,0.022,4685,0.668,0.36,,2430,12304,3282,2992, -Harpullia rhyticarpa,harrhy,Cape Tribulation,0.076,0.0174,40876,0.621,0.01,,,8971,5922,4669, -Hernandia albiflora,heralb,Cape Tribulation,0.069,0.0195,3806,0.447,0.33,,3123,4145,4643,6086, -Ixora biflora,ixobif,Cape Tribulation,0.081,0.01,2760,0.843,0.55,41.5,5244,3892,1969,8094, -Lasianthus strigosus,lasstr,Cape Tribulation,0.055,0.0158,3313,0.684,0.15,7,1841,5100,2379,2731, -Litsea leefeana,litlee,Cape Tribulation,0.13,0.0144,3917,0.549,0.68,263.4,3984,4141,3816,9645, -Macaranga tanarius,mactan,Cape Tribulation,0.104,0.0205,46676,0.344,0,,,3377,,3901, -Mallotus mollissimus,malmol,Cape Tribulation,0.063,0.0352,16716,0.373,0.32,31.25,1788,5580,5163,7944, -Medicosma sessiliflora,medses,Cape Tribulation,0.106,0.0153,8164,0.69,0.65,,2844,9332,6514,10298, -Melastoma cyanoides,melaff,Cape Tribulation,0.046,0.0208,4009,0.381,0.6,0.07,2960,4057,4661,6637, -Myristica insipida,myrins,Cape Tribulation,0.106,0.0185,8379,0.433,0.51,1612,,6929,4852,9273, -Pittosporum rubiginosum,pitrub,Cape Tribulation,0.065,0.0143,9931,0.728,0.28,27.94,7428,7459,5265,6548, -Psychotria dallachiana,psydal,Cape Tribulation,0.079,0.0177,2495,0.612,0.33,,4290,5666,4916,4761, -Quassia baileyana,quabai,Cape Tribulation,0.086,0.023,9624,0.501,0.42,,,5867,3216,5719, -Rockinghamia angustifolia,rocang,Cape Tribulation,0.108,0.0158,10636,0.455,0.39,19.38,,5862,4611,6098, -Syzygium gustavioides,syzgus,Cape Tribulation,0.167,0.0129,3590,0.521,0.59,48000,2833,3121,3047,6584, -Syzygium sayeri,syzsay,Cape Tribulation,0.131,0.0137,2645,0.485,0.65,841,3929,5767,4939,9836, -Trema aspera,treasp,Cape Tribulation,0.053,0.0299,2071,0.357,0.53,5.12,3578,5291,5440,6695,wild diff --git a/tests/testthat/examples/test3-metadata.yml b/tests/testthat/examples/test3-metadata.yml deleted file mode 100644 index d6f4dde85..000000000 --- a/tests/testthat/examples/test3-metadata.yml +++ /dev/null @@ -1,318 +0,0 @@ -source: - primary: - key: Falster_2005_1 - bibtype: Article - author: Daniel S. Falster, Mark Westoby - year: 2005 - title: Alternative height strategies among 45 dicot rain forest species from tropical - Queensland, Australia - journal: Journal of Ecology - volume: 93 - pages: 521--535 - publisher: Wiley-Blackwell - doi: 10.1111/j.0022-0477.2005.00992.x -contributors: - data_collectors: - - last_name: Falster - given_name: Daniel - ORCID: 0000-0002-9814-092X - affiliation: Evolution & Ecology Research Centre, School of Biological, Earth, - and Environmental Sciences, UNSW Sydney, Australia - additional_role: contact - - last_name: Westoby - given_name: Mark - ORCID: 0000-0001-7690-4530 - affiliation: Department of Biological Sciences, Macquarie University, Australia - dataset_curators: Elizabeth Wenk -dataset: - data_is_long_format: no - custom_R_code: .na - collection_date: 2004/2004 - taxon_name: Species - location_name: site - description: Investigation into trait values correlated with plant height along - light availability and successional gradients for far north Queensland species. - basis_of_record: basis_of_record - life_stage: life_stage - sampling_strategy: Nineteen species, ranging from early to late successional status, - were selected using published sources (Hopkins & Graham 1987; Osunkoya 1996; Hyland - et al. 1999). Species selected to represent the light gradient establish and mature - in closed forest, where successional species are assumed absent. For inclusion - in this set we required that a species was known to establish and persist at low - light levels, as indicated either by published sources (Hyland et al. 1999; Osunkoya - 1996) or by scientists familiar with the vegetation (A Graham, J Wells, CSIRO - Atherton; R Jensen). Twenty-six species, experiencing a range of light levels - at maturity, from high (canopy trees) to low light (understorey shrubs), were - included. - original_file: Falster & Westoby 2005 J Ecol appendix.doc - notes: none -locations: - Atherton: - description: Tropical rain forest vegetation. - elevation (m): 800 - latitude (deg): -17.1166667 - longitude (deg): 145.65 - rainfall (mm): 2000 - Cape Tribulation: - description: Complex mesophyll vine forest in tropical rain forest. - elevation (m): 25 - latitude (deg): -16.1 - longitude (deg): 145.45 - rainfall (mm): 3500 - basis_of_record: Cape_Tribulation -contexts: .na -traits: -- var_in: LMA (mg mm-2) - unit_in: mg/mm2 - trait_name: leaf_mass_per_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: LMA was calculated as the leaf dry mass (oven-dried for 48 hours at 65 - deg C) divided by leaf size. It was measured on the first five fully expanded - leaves at the tip of each individual. -- var_in: Leaf nitrogen (mg mg-1) - unit_in: mg/mg - trait_name: leaf_N_per_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - basis_of_record: lab - methods: Leaves from all individuals per species were pooled and finely ground for - nitrogen analysis. Total nitrogen concentration (%) was measured using complete - combustion gas chromatography by Waite Analytical Services, Adelaide. The first - five fully expanded leaves at the tip of each individual were used for the analysis. -- var_in: leaf size (mm2) - unit_in: mm2 - trait_name: leaf_area - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Leaf size was calculated as the one-sided leaf area (flat bed scanner). - It was measured on the first five fully expanded leaves at the tip of each individual. -- var_in: wood density (mg mm-3) - unit_in: mg/mm3 - trait_name: wood_density - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Wood density was calculated using 40-60 mm stem segments taken 250 mm and - 1000 mm back along a branch from the branch tip. Fresh samples were refrigerated - before processing. After removing bark material, the volume of each wood sample - was determined using Archimedes' principle (Hacke et al. 2000). Samples were submerged - in a water-filled container on a balance. The weight change (mg) recorded during - submersion corresponds to the mass of water displaced, which can be converted - to a volume using the formula, displacement weight (mg)/0.998 (mg/mm3), where - 0.998 mg/mm3 is the density of water at 20 deg C. Samples were then dried for - 4 days at 60 deg C before weighing. -- var_in: branch mass fraction - unit_in: mg/mg - trait_name: branch_mass_fraction - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: '3' - methods: Branch mass fraction was calculated as the mass side branches/total mass, - on a carbon dry mass basis. The zero values are correct - these are plants with - no branches. -- var_in: Seed mass (mg) - unit_in: mg - trait_name: seed_dry_mass - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: unknown - methods: Mean oven-dried seed mass (including seed coat but excluding seed accessories) - was estimated for all species with available field material. In total, collections - for 17 of 47 species were made. Data for an additional 12 species were drawn from - published (Osunkoya et al. 1994; Grubb et al. 1998) and unpublished (P. Juniper, - CSIRO Atherton) sources. -- var_in: LASA10 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a shoot whose sapwood had a cross sectional - area of 10 mm2. In detail from Wright_2006, which used this data, No single best - point exists to compare traits such as LM/ SM, LA/SM and LA/SA when considering - a set of species that varies widely in canopy architecture and typical maximum - height (here, approximately 20 cm to 85 m). We have used several approaches (Table - 1). In one study, we made measurements on the terminal twigs of each species, - i.e. on a relatively standard developmental unit (Westoby and Wright 2003). For - species at Ash, GLP, Myall and TRF, traits were measured at each of several different - distances back down the stem from the branch tip (Falster and Westoby 2005a, 2005b - and unpublished, Pickup et al. 2005). At GHP, RHM and RHW, traits were measured - at a standard sapwood cross-sectional area (10 mm2; Pickup et al. 2005). For the - present re-analysis, we took the raw data from the previous studies and, for every - species possible, calculated patterns of leaf and stem deployment at two standard - points: at 250 mm distance from the branch tip (Ash, GLP, Myall and TRF) and at - 10 mm2 stem (Ash, Myall, TRF) or sapwood (GHP, GLP, RHM, RHW) crosssectional area - (250 mm or 10 mm2 formulation denoted as subscript in trait abbreviations). This - was done as follows. For each individual plant, total leaf and stem dry mass at - 250 mm distance was estimated by straightline interpolation from values measured - at the nearest sampling points on either side of this distance. As the dry mass - data tended to display non-linear (power) relationships with distance from the - branch tip, the interpolated values were calculated from log10-log10- transformed - data, then back-transformed to the original scale. The same approach was used - for interpolating data to the standard stem (or sapwood) cross-sectional area. - For individuals where measurements had not been made on either side of the desired - point but the nearest measurement had been made within 25 mm of 250 mm or 1 mm2 - of 10 mm2 cross-section (i.e. within 10% of the desired point), we extrapolated - (rather than interpolated) the measured data to the standard point. This allowed - us to include a number of individuals and species for which interpolation was - not possible. Still, several large-leaved, large-stemmed species from the TRF - site could not be included in the 10-mm2 crosssection dataset. No unusual tendencies - in analyses, including the extrapolated data, were seen in comparison to analyses - including interpolated data only (details not shown). To illustrate how species'' - morphology varied at the two standard sampling points, species-mean stem cross-sectional - area varied between 1.2 and 258 mm2 at 250 mm distance from the branch tip, while - the distance from the branch tip at which stem cross-sectional area reached 10 - mm2 varied from 64 to 995 mm.' -- var_in: LASA250 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 250 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA50 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 50 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -- var_in: LASA1000 - unit_in: mm2{leaf}/mm2{sapwood} - trait_name: huber_value - entity_type: population - value_type: mean - basis_of_value: measurement - replicates: 3 - methods: 'Leaf area was determined for a 1000 mm branch segment and sapwood cross-sectional - area was determined where the branch was cut. In detail from Wright_2006, which - used this data, No single best point exists to compare traits such as LM/ SM, - LA/SM and LA/SA when considering a set of species that varies widely in canopy - architecture and typical maximum height (here, approximately 20 cm to 85 m). We - have used several approaches (Table 1). In one study, we made measurements on - the terminal twigs of each species, i.e. on a relatively standard developmental - unit (Westoby and Wright 2003). For species at Ash, GLP, Myall and TRF, traits - were measured at each of several different distances back down the stem from the - branch tip (Falster and Westoby 2005a, 2005b and unpublished, Pickup et al. 2005). - At GHP, RHM and RHW, traits were measured at a standard sapwood cross-sectional - area (10 mm2; Pickup et al. 2005). For the present re-analysis, we took the raw - data from the previous studies and, for every species possible, calculated patterns - of leaf and stem deployment at two standard points: at 250 mm distance from the - branch tip (Ash, GLP, Myall and TRF) and at 10 mm2 stem (Ash, Myall, TRF) or sapwood - (GHP, GLP, RHM, RHW) crosssectional area (250 mm or 10 mm2 formulation denoted - as subscript in trait abbreviations). This was done as follows. For each individual - plant, total leaf and stem dry mass at 250 mm distance was estimated by straightline - interpolation from values measured at the nearest sampling points on either side - of this distance. As the dry mass data tended to display non-linear (power) relationships - with distance from the branch tip, the interpolated values were calculated from - log10-log10- transformed data, then back-transformed to the original scale. The - same approach was used for interpolating data to the standard stem (or sapwood) - cross-sectional area. For individuals where measurements had not been made on - either side of the desired point but the nearest measurement had been made within - 25 mm of 250 mm or 1 mm2 of 10 mm2 cross-section (i.e. within 10% of the desired - point), we extrapolated (rather than interpolated) the measured data to the standard - point. This allowed us to include a number of individuals and species for which - interpolation was not possible. Still, several large-leaved, large-stemmed species - from the TRF site could not be included in the 10-mm2 crosssection dataset. No - unusual tendencies in analyses, including the extrapolated data, were seen in - comparison to analyses including interpolated data only (details not shown). To - illustrate how species'' morphology varied at the two standard sampling points, - species-mean stem cross-sectional area varied between 1.2 and 258 mm2 at 250 mm - distance from the branch tip, while the distance from the branch tip at which - stem cross-sectional area reached 10 mm2 varied from 64 to 995 mm.' -substitutions: .na -taxonomic_updates: -- find: Homalanthus novoguineensis - replace: Homalanthus novo-guineensis - reason: Change spelling to align with known name in APC (Daniel Falster, 2020.05.22) -- find: Haplostichanthus sp Coop. Ck - replace: Haplostichanthus submontanus - reason: Align previous phrase name with current APC name (E. Wenk, 2020-05-25) -- find: Psychotria sp Utchee Creek - replace: Psychotria sp. Utchee Creek (H.Flecker NQNC5313) - reason: Align to name in APC (D Falster, 2020.05.23) -exclude_observations: .na -questions: .na diff --git a/tests/testthat/examples/test4-data.csv b/tests/testthat/examples/test4-data.csv deleted file mode 100644 index cc739bf83..000000000 --- a/tests/testthat/examples/test4-data.csv +++ /dev/null @@ -1,34 +0,0 @@ -PlotSite,Temp-trt,Chamber,Date,Curator,Species,Treatment,month,Vcmax,Tleaf,Rd,lfN,N/area,A390,A630,LMA,Agrow,g_grow,Jmax,Jmax25,Vcmax25,Rd25,context,site_name,sex,fruit_colour -1,elevated,11,Dec 3 2010,K. Crous,Eucalyptus globulus,0C,DEC,112.03,27.46,-2.69,30.38999939,1.43,21.39999962,27.70000076,47.02,21.39999962,0.875999987,183.33,168.65,94.48,-2.27,elevated_temp_and_ambient_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 1,male,red -6,ambient,7,Dec 3 2010,K. Crous,Eucalyptus globulus,0C,DEC,108.16,25.53,-1.74,33.5,1.71,19.20000076,29.70000076,50.94,19.20000076,0.31099999,169.43,162.8,104.21,-1.67,ambient_temp_and_ambient_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 6,female,pink -12,ambient,5,Dec 10 2010,K. Crous,Eucalyptus globulus,0C,DEC,97.45,24.65,-1.01,34.81999969,1.84,22.89999962,29.39999962,52.86,22.89999962,0.49000001,168.79,170.02,99.89,-1.04,ambient_temp_and_ambient_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 12,male,bl -16,elevated,1,Dec 9 2010,K. Crous,Eucalyptus globulus,0C,DEC,71.19,25.22,-1.06,31.86000061,1.17,16.5,21.89999962,36.83,16.5,0.370000005,114.32,115.16,70.12,-1.04,elevated_temp_and_ambient_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 16,female,red -23,elevated,3,Dec 8 2010,K. Crous,Eucalyptus globulus,0C,DEC,70.67,24.95,-1.27,30.68000031,1.16,16.60000038,22.60000038,37.75,16.60000038,0.298000008,134.07,135.05,70.91,-1.28,elevated_temp_and_ambient_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 23,male,pink -29,ambient,9,Dec 8 2010,K. Crous,Eucalyptus globulus,0C,DEC,97.19,25.15,-1.46,31.35000038,1.53,20.29999924,27.60000038,48.7,20.29999924,0.319000006,161.72,162.9,96.17,-1.44,ambient_temp_and_ambient_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 29,female,bl -34,ambient,10,Dec 6 2010,K. Crous,Eucalyptus globulus,+C,DEC,81.19,25.12,-1.25,27.97999954,1.49,18.20000076,24.39999962,53.4,24.39999962,0.270000011,140.52,141.55,80.52,-1.24,ambient_temp_and_enriched_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 34,male,red -38,ambient,2,Dec 2 2010,K. Crous,Eucalyptus globulus,+C,DEC,136.14,25.44,-3.67,28.54999924,1.8,26.5,35.20000076,63,35.20000076,0.970000029,226.35,228.01,131.98,-3.55,ambient_temp_and_enriched_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 38,female,pink -42,ambient,12,Dec 7 2010,K. Crous,Eucalyptus globulus,+C,DEC,92.46,24.99,-1.55,28.88999939,1.61,21.5,27.60000038,55.6,27.60000038,0.298999995,162.83,164.03,92.54,-1.55,ambient_temp_and_enriched_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 42,male,bl -47,elevated,4,Dec 6 2010,K. Crous,Eucalyptus globulus,+C,DEC,62.49,25.04,-1.09,23.37000084,0.97,16,22.29999924,41.54,22.29999924,0.527999997,120.24,121.12,62.3,-1.09,elevated_temp_and_enriched_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 47,female,red -51,elevated,8,Dec 9 2010,K. Crous,Eucalyptus globulus,+C,DEC,97.59,24.97,-1.6,27.88999939,1.41,21.79999924,28.79999924,50.48,28.79999924,0.652999997,158.29,159.45,97.83,-1.61,elevated_temp_and_enriched_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 51,male,pink -57,elevated,6,Dec 7 2010,K. Crous,Eucalyptus globulus,+C,DEC,58.53,25.14,-1.28,19.95000076,1.14,14.10000038,18.79999924,57.24,18.79999924,0.317999989,106.45,107.23,57.95,-1.27,elevated_temp_and_enriched_CO2_treatment_and_measured_in_DEC,Hawkesbury Forest Experiment site plot 57,female,bl -62,ambient,5,Feb 10 2011,K. Crous,Eucalyptus globulus,0C,FEB,84.42,25.11,-0.74,34.13999939,1.93,19.70000076,NA,56.67,19.70000076,0.500999987,116.47,117.32,83.79,-0.74,ambient_temp_and_ambient_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 62,male,red -67,ambient,9,Feb 9 2011,K. Crous,Eucalyptus globulus,0C,FEB,88.13,25.14,-0.67,29.42000008,1.98,21.10000038,25.20000076,67.14,21.10000038,0.56400001,136.25,137.24,87.24,-0.67,ambient_temp_and_ambient_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 67,female,pink -71,ambient,7,Feb 14 2011,K. Crous,Eucalyptus globulus,0C,FEB,70.34,25.03,-1.07,19.27000046,1.38,18,23.39999962,71.56,18,0.61500001,133.55,134.53,70.19,-1.07,ambient_temp_and_ambient_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 71,male,bl -75,elevated,3,Feb 9 2011,K. Crous,Eucalyptus globulus,0C,FEB,64.55,25.15,-0.37,26.23999977,1.44,13.80000019,16.39999962,54.76,13.80000019,0.246999994,87.6,88.24,63.89,-0.36,elevated_temp_and_ambient_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 75,female,red -80,elevated,1,Feb 12 2011,K. Crous,Eucalyptus globulus,0C,FEB,84.79,25.09,-1,27.14999962,1.47,19.89999962,24,54.08,19.89999962,0.469999999,129.42,130.37,84.26,-0.99,elevated_temp_and_ambient_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 80,male,pink -87,ambient,2,Feb 15 2011,K. Crous,Eucalyptus globulus,+C,FEB,119.08,25.1,-1,33.99000168,2.38,30.00601959,39.74504089,70.15,39.74504089,1.057057858,235.65,237.38,118.26,-1,ambient_temp_and_enriched_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 87,female,bl -91,ambient,10,Feb 11 2011,K. Crous,Eucalyptus globulus,+C,FEB,61.38,24.27,-1.5,19.46999931,2.06,11.79452896,18.0937233,105.77,18.0937233,0.135541379,125.19,132.61,64.59,-1.58,ambient_temp_and_enriched_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 91,male,red -96,ambient,12,Feb 9 2011,K. Crous,Eucalyptus globulus,+C,FEB,93.17,24.87,-1.27,27.67000008,2.18,23,29.29999924,78.96,29.29999924,0.492000014,169.3,170.54,94.01,-1.28,ambient_temp_and_enriched_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 96,female,pink -101,elevated,4,Feb 12 2011,K. Crous,Eucalyptus globulus,+C,FEB,74.68,25.02,-1.76,27.13999939,1.67,16.59725189,21.67111206,61.54,21.67111206,0.412641644,124.37,125.29,74.59,-1.76,elevated_temp_and_enriched_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 101,male,bl -107,elevated,6,Feb 10 2011,K. Crous,Eucalyptus globulus,+C,FEB,94.92,24.96,-1.47,27.5,2.14,23.46526337,31.88568306,77.69,31.88568306,0.834146917,188.92,190.3,95.15,-1.47,elevated_temp_and_enriched_CO2_treatment_and_measured_in_FEB,Hawkesbury Forest Experiment site plot 107,female,red -115,elevated,11,Aug 26 2011,K. Crous,Eucalyptus globulus,0C,AUG,96.92,25.17,-1.86,24.19000053,2.08,20.20000076,29.10000038,86.08,20.20000076,0.300999999,202.48,203.97,95.8,-1.84,elevated_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 115,male,pink -120,elevated,3,Aug 29 2011,K. Crous,Eucalyptus globulus,0C,AUG,120.85,25,-2.4,33.52000046,3.42,21.89999962,30.29999924,101.91,21.89999962,0.270999998,212.14,213.7,120.82,-2.4,elevated_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 120,female,bl -125,ambient,7,Sep 2 2011,K. Crous,Eucalyptus globulus,0C,AUG,83.17,25.69,1.47,16.90999985,2.23,17.20000076,25.70000076,131.91,17.20000076,0.256999999,140.98,135.46,79.29,1.4,ambient_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 125,male,red -128,ambient,7,Sep 2 2011,K. Crous,Eucalyptus globulus,0C,AUG,78.21,24.93,-1.31,16.90999985,2.23,16.10000038,NA,131.91,16.10000038,0.672999978,141.86,142.9,78.62,-1.32,ambient_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 128,female,pink -130,ambient,5,Sep 5 2011,K. Crous,Eucalyptus globulus,0C,AUG,76.34,25.01,-1.3,21.13999939,2.6,17.79999924,21.5,123.21,17.79999924,0.38499999,144.64,145.7,76.29,-1.3,ambient_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 130,male,bl -134,ambient,9,Sep 5 2011,K. Crous,Eucalyptus globulus,0C,AUG,87.37,24.92,-2.34,14.38000011,1.82,14.39999962,21.20000076,126.51,14.39999962,0.123000003,143.32,144.37,87.86,-2.35,ambient_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 134,female,red -138,elevated,1,Sep 1 2011,K. Crous,Eucalyptus globulus,0C,AUG,104.74,24.97,-1.99,21.96999931,2.17,18.70000076,26,98.92,18.70000076,0.275999993,170.7,171.95,104.97,-2,elevated_temp_and_ambient_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 138,male,pink -143,ambient,12,Sep 8 2011,K. Crous,Eucalyptus globulus,+C,AUG,66.33,25.01,-1.33,10.32999992,1.6,15.10000038,21.89999962,154.83,21.89999962,0.286000013,137.38,138.38,66.27,-1.33,ambient_temp_and_enriched_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 143,female,bl -148,ambient,2,Sep 8 2011,K. Crous,Eucalyptus globulus,+C,AUG,88.76,24.99,-2.83,17.37000084,2.98,11.3,19.39999962,171.31,19.39999962,NA,169.71,170.95,88.84,-2.83,ambient_temp_and_enriched_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 148,male,red -153,elevated,6,Sep 2 2011,K. Crous,Eucalyptus globulus,+C,AUG,98.92,25.61,-1.73,33.81000137,3.25,17.70000076,24.60000038,96.07,24.60000038,0.171000004,143.93,138.29,94.81,-1.66,elevated_temp_and_enriched_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 153,female,pink -157,elevated,4,Sep 1 2011,K. Crous,Eucalyptus globulus,+C,AUG,31.44,25.18,-0.01,13.51000023,1.49,7.980000019,12,110.19,12,0.128000006,73.16,73.69,31.06,-0.01,elevated_temp_and_enriched_CO2_treatment_and_measured_in_AUG,Hawkesbury Forest Experiment site plot 157,male,bl diff --git a/tests/testthat/examples/test4-metadata.yml b/tests/testthat/examples/test4-metadata.yml deleted file mode 100644 index e71a5231f..000000000 --- a/tests/testthat/examples/test4-metadata.yml +++ /dev/null @@ -1,195 +0,0 @@ -source: - primary: - key: Crous_2013 - bibtype: Article - year: '2013' - author: Kristine Y. Crous and Audrey G. Quentin and Yan-Shih Lin and Belinda E. - Medlyn and David G. Williams and Craig V. M. Barton and David S. Ellsworth - journal: Global Change Biology - title: Photosynthesis of temperate Eucalyptus globulus trees outside their native - range has limited adjustment to elevated CO2 and climate warming - volume: '19' - number: '12' - pages: 3790--3807 - doi: 10.1111/gcb.12314 -contributors: - data_collectors: - - last_name: Crous - given_name: Kristine - ORCID: 0000-0001-9478-7593 - affiliation: Hawkesbury Institute for the Environment, Western Sydney University, - Australia - additional_role: contact - dataset_curators: Elizabeth Wenk -dataset: - data_is_long_format: no - custom_R_code: ' - data %>% - mutate( - location_name = "Hawkesbury Forest Experiment site", - Date = Date %>% mdy(), - CO2_Treat = stringr::str_replace(Treatment,"\\+C","added CO2"), - CO2_Treat = stringr::str_replace(CO2_Treat,"0C","ambient CO2") - ) - ' - collection_date: Date - taxon_name: Species - individual_id: Chamber - location_name: location_name - description: An experiment to investigate where Eucalyptus globulus, a widely planted - plantation species, would show high potential for acclimation of photosynthetic - traits across a wide range of growth conditions, including elevated [CO2] and - climate warming. - basis_of_record: lab - life_stage: sapling - sampling_strategy: Plant material Eucalyptus globulus ssp. globulus planting material - was obtained from a commercial tree nursery in Victoria as firstseason tube stock - seedlings. - original_file: Globulus_Austraits.xls - notes: A number of observations for 'leaf_light_respiration_per_area' are showing - up as duplicates, because the values adjusted to 25C and the raw values are sometimes - identical; both formulations are read into AusTraits, but the data are in separate - columns. -locations: - Hawkesbury Forest Experiment site: - latitude (deg): -33.6108111 - longitude (deg): 150.7410417 - description: tall closed tree chambers -contexts: -- context_property: sampling season - category: temporal_context - var_in: month - values: - - find: AUG - value: August - description: August (late winter) - - find: DEC - value: December - description: December (early summer) - - find: FEB - value: February - description: February (late summer) -- context_property: temperature treatment - category: treatment_context - var_in: Temp-trt - values: - - find: ambient - value: ambient - description: Plants grown at ambient temperatures; Jan average max = 29.4 dec - C / July average min = 3.2 dec C. - - find: elevated - value: elevated - description: Plants grown 3 deg C above ambient temperatures. -- context_property: CO2 treatment - category: treatment_context - var_in: CO2_Treat - values: - - find: ambient CO2 - value: 400 ppm - description: Plants grown at ambient CO2 (400 ppm). - - find: added CO2 - value: 640 ppm - description: Plants grown at elevated CO2 (640 ppm); 240 ppm above ambient. -- context_property: measurement temperature - category: method_context_context - var_in: method_context - values: - - find: Measurement made at 20°C - value: 20°C - description: Measurement made at 20°C - - find: Measurement made at 25°C - value: 25°C - description: Measurement made at 25°C -traits: -- var_in: fruit_colour - unit_in: .na - trait_name: fruit_colour - entity_type: species - value_type: mode - basis_of_value: expert_score - replicates: .na - methods: a dummy variable for tests -- var_in: Vcmax - unit_in: umol/m2/s - trait_name: leaf_photosynthesis_Vcmax_per_area - entity_type: individual - value_type: maximum - basis_of_value: measurement - replicates: 1 - method_context: Measurement made at 20°C - methods: &fluorescence Controlled photosynthetic CO2 response curve measurements were made using - Li-Cor 6400 portable infrared gas analysers (LiCor Inc., Lincoln, NE, USA). CO2 - response curves of net CO2 assimilation (Anet) were developed at a constant temperature - (termed 'Anet-Ci curves') for intact leaves within each tree chamber. These Anet-Ci - curve measurements progressed at four to five specified leaf temperatures for - the same leaf (i.e. one leaf per chamber) in each of three seasons (early summer, - December 2010; late summer, February 2011; and late winter, August 2011). Each - Anet-Ci response curve started with a steady-state measurement at the growth [CO2] - (henceforth called 'Anet at the growth [CO2]') and then consisted of 11 additional - steps all measured at a constant set leaf temperature while using light-saturating - photon flux density (PFD) of 1800 umol m-2 s-1. There were at least five [CO2] - levels used in the linear part of the curve, and at least three steps measured - in the saturating part of the curve. These Anet-Ci response curves were measured - on a leaf at the lowest set temperature (20 deg C) and then repeated fourmore - times on the same leaf, each time at an increased leaf temperature for each curve - following a progression of 25, 30, 35 and 41 deg C. From Anet-Ci response measurements - conducted at the set leaf temperatures, the photosynthetic parameters Jmax and - Vcmax from the biochemical model of Farquhar et al. (1980) can be extracted (e.g. - see (Bernacchi et al., 2002, 2001; Medlyn et al., 2002a). During the leaf-level - measurements, the entire tree was subjected to similar air temperatures in the - whole-tree chambers during the measurements. The entire tree was exposed to each - set temperature for at least 0.5 h before leaf gas exchange measurements started, - resulting in approximately 1.5 h duration set at each temperature level. At each - temperature, the curve was started with a measurement of Anet at the growth [CO2] - using the [CO2] appropriate for the long-term treatment for each chamber tree. - See manuscript for additional details on how humidity was controlled in the experimental - chambers to minimize stomatal closure. -- var_in: lfN - unit_in: mg/g - trait_name: leaf_N_per_dry_mass - entity_type: individual - value_type: raw - basis_of_value: measurement - replicates: 1 - methods: Leaves were collected after each Anet-Ci curve in December, February and - August, for determination of leaf area on a Li- Cor leaf area metre (Li-Cor model - 3100, Lincoln, NE, USA) and then oven-dried at 70 deg C. At final harvest in November, - a random sample of 100 leaves from each of three crown positions was also collected, - and area was measured on each of these leaves. For Anet-Ci leaves, leaf mass per - area ratio (LMA) was recorded before samples were ground to a homogenous powder - to analyse for total %N and %C on a microdigestion apparatus interfacing a CHN - elemental analyser (TruSpec; LECO Corp., St. Joseph, MI, USA).; Regarding the - high leaf N values, the author notes, given that E globulus was moved 700 km north - of its native distribution, it may have adapted via a change in Nmass as we have - seen in other studies (Sharwood et al. 2014, Crous et al. 2017 Tree Phys). -- var_in: LMA - unit_in: g/m2 - trait_name: leaf_mass_per_area - entity_type: individual - value_type: raw - basis_of_value: measurement - replicates: 1 - methods: Leaves were collected after each Anet-Ci curve in December, February and - August, for determination of leaf area on a Li- Cor leaf area metre (Li-Cor model - 3100, Lincoln, NE, USA) and then oven-dried at 70 deg C. At final harvest in November, - a random sample of 100 leaves from each of three crown positions was also collected, - and area was measured on each of these leaves. For Anet-Ci leaves, leaf mass per - area ratio (LMA) was recorded before samples were ground to a homogenous powder - to analyse for total %N and %C on a microdigestion apparatus interfacing a CHN - elemental analyser (TruSpec; LECO Corp., St. Joseph, MI, USA). -- var_in: Vcmax25 - unit_in: umol/m2/s - trait_name: leaf_photosynthesis_Vcmax_per_area - entity_type: individual - value_type: raw - basis_of_value: measurement - replicates: 1 - method_context: Measurement made at 25°C - methods: *fluorescence -substitutions: -- trait_name: fruit_colour - find: bl - replace: black -taxonomic_updates: .na -exclude_observations: .na -questions: .na diff --git a/tests/testthat/functions.R b/tests/testthat/functions.R deleted file mode 100644 index 59b78bf53..000000000 --- a/tests/testthat/functions.R +++ /dev/null @@ -1,126 +0,0 @@ - -# Better than expect_silent as contains `info` and allows for complete failures -expect_no_error <- function (object, regexp = NULL, ..., info = NULL, label = NULL) -{ - error <- tryCatch({ - object - NULL - }, error = function(e) { - e - }) - expect(is.null(error), sprintf("%s threw an error: %s", label, paste(error$message, collapse=",")), info = info) - invisible(NULL) -} - - -expect_unique <- function (object, info = NULL, label = NULL) { - x <- table(unlist(object)) - i <- x==1 - comp <- compare(all(i), TRUE) - expect(comp$equal, - sprintf("%s - not unique: %s", info, paste(names(x)[!i], collapse= ", "))) - invisible(object) -} - -expect_isin <- function(object, expected, ..., info = NULL, label = NULL, - expected.label = NULL, na.rm=TRUE) { - - if(na.rm) - object <- object[!is.na(object)] - i <- object %in% expected - - comp <- compare(all(i), TRUE, ...) - expect( - comp$equal, - sprintf("%s - should not contain: %s", info, paste(object[!i], collapse= ", ")) - ) - - invisible(object) -} - -expect_not_NA <- function (object, info = NULL, label = NULL) { - i <- !is.na(object) - comp <- compare(all(i), TRUE) - expect(comp$equal, - sprintf("%s - contains NAs: %s", info, label)) - invisible(object) -} - -test_list <- function(data, info) { - expect_true(class(data)=="list", info = info) -} - -test_list_names_valid <- function(data, info) { - test_list(data, info) - expect_not_NA(names(data), info = info) -# expect_allowed_text(names(data), info = info) - expect_unique(names(data), info = info) -} - -test_list_named <- function(data, expected_names, info) { - test_list_names_valid(data, info) - expect_named(data, expected_names, info= info) -} - -test_list_named_contains <- function(data, expected_names, info) { - test_list_names_valid(data, info) - expect_isin(names(data), expected_names) -} - - -test_dataframe_valid <- function(data, info) { - expect_not_NA(colnames(data), info = info) -# expect_allowed_text(colnames(data), info = info) - expect_unique(colnames(data), info = info) - expect_true(is.data.frame(data), info = info) -} - -test_dataframe_named <- function(data, expected_colnames, info) { - test_dataframe_valid(data, info) - expect_named(data, expected_colnames, info= info) -} - - -test_build_dataset <- function(path_metadata, path_data, info, definitions, unit_conversions, schema, resource_metadata, taxon_list) { - - # test it builds with no errors - expect_no_error({ - build_config <- dataset_configure(path_metadata, definitions, unit_conversions) - }, info = paste(info, " config")) - - expect_no_error({ - build_dataset_raw <- dataset_process(path_data, build_config, schema, resource_metadata) - }, info = paste(info, " dataset_process")) - - expect_no_error({ - build_dataset <- build_update_taxonomy(build_dataset_raw, taxon_list) - }, info = paste(info, " update taxonomy")) - - test_structure(build_dataset, info, schema, definitions, single_dataset = TRUE) - - build_dataset -} - -test_structure <- function(data, info, schema, definitions, single_dataset = TRUE) { - - vars_austraits <- - schema$austraits$elements %>% names() - - vars_tables <- vars_austraits %>% subset(., !(. %in% c("dataset_id", "definitions", "schema", "sources", "metadata", "build_info"))) - - # test lists have the right objects - comparison <- vars_austraits - - test_list_named(data, comparison, info = c(info, " - main elements")) - - # test structure of tables - for(v in vars_tables) { - - comparison <- schema$austraits$elements[[v]]$elements %>% names() - - test_dataframe_named(data[[v]], comparison, info = paste(info, " - structure of ", v)) - } - - # contains allowed traits - expect_isin(data$traits$trait_name %>% unique(), definitions$elements %>% names(), info = paste("traits ", v)) -} diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R deleted file mode 100644 index d008fd716..000000000 --- a/tests/testthat/helper.R +++ /dev/null @@ -1,3 +0,0 @@ - library(traits.build) - source("functions.R") - diff --git a/tests/testthat/test-get.R b/tests/testthat/test-get.R deleted file mode 100644 index a5700d8ec..000000000 --- a/tests/testthat/test-get.R +++ /dev/null @@ -1,14 +0,0 @@ - -test_that("test get_schema",{ - expect_silent(x <- get_schema()) - expect_equal(class(x), "list") - expect_equal(length(x), 6) - expect_equal(names(x), c("entity_type", "value_type", "basis_of_value", "basis_of_record", "austraits", "metadata")) - expect_equal(class(get_schema(subsection = "austraits")), "list") - expect_equal(length(get_schema(subsection = "austraits")), 3) - expect_equal(length(get_schema(subsection = "metadata")), 3) - expect_equal(length(get_schema(subsection = "value_type")), 3) - expect_equal(length(get_schema(subsection = "entity_type")), 3) - expect_equal(length(get_schema(subsection = "basis_of_record")), 3) - expect_equal(length(get_schema(subsection = "basis_of_value")), 3) -}) diff --git a/tests/testthat/test-process.R b/tests/testthat/test-process.R deleted file mode 100644 index c64e7c1eb..000000000 --- a/tests/testthat/test-process.R +++ /dev/null @@ -1,52 +0,0 @@ - -Test_data <- "data/Test_2022/data.csv" - -schema <- get_schema() -resource_metadata <- get_schema("config/metadata.yml", "metadata") -traits_definitions <- get_schema("config/traits.yml", I("traits")) -unit_conversions <- get_unit_conversions("config/unit_conversions.csv") -Test_config <- dataset_configure("data/Test_2022/test-metadata.yml", - traits_definitions, - unit_conversions) - -test_that("test dataset_configure is working",{ - expect_equal(class(dataset_configure("data/Test_2022/test-metadata.yml", - yaml::read_yaml("config/traits.yml"), - get_unit_conversions("config/unit_conversions.csv"))), "list") - expect_length(dataset_configure("data/Test_2022/test-metadata.yml", - yaml::read_yaml("config/traits.yml"), - get_unit_conversions("config/unit_conversions.csv")), 4) - expect_named(dataset_configure("data/Test_2022/test-metadata.yml", - yaml::read_yaml("config/traits.yml"), - get_unit_conversions("config/unit_conversions.csv")), - c("dataset_id", "metadata", "definitions", "unit_conversion_functions")) -}) - -test_that("test dataset_process is working",{ - austraits_names <- schema$austraits$elements %>% names() - - expect_no_error( x <- dataset_process(Test_data, Test_config, schema,resource_metadata)) - expect_equal(class(x), "list") - expect_length(x, 13) - expect_named(x, austraits_names) - expect_equal(nrow(x$excluded_data), 0) - expect_equal(nrow(dataset_process(Test_data, Test_config, schema, resource_metadata, filter_missing_values = TRUE)$excluded_data), 0) - expect_equal(nrow(dataset_process(Test_data, Test_config, schema, resource_metadata, filter_missing_values = FALSE)$excluded_data), 44) -}) - -test_that("test process_custom_code is working",{ - metadata <- Test_config$metadata - data <- readr::read_csv(Test_data, col_types = cols(), guess_max = 100000, progress=FALSE) - - expect_equal(ncol(data), 13) - expect_equal(ncol(process_custom_code(metadata[["dataset"]][["custom_R_code"]])(data)), 14) - expect_silent(process_custom_code(NULL)) -}) - -# test_that("test process_flag_unsupported_traits is working",{ -# process_flag_unsupported_traits(data, definitions) -# }) -# -# test_that("test process_flag_excluded_observations is working",{ -# process_flag_excluded_observations -# }) diff --git a/tests/testthat/test-setup.R b/tests/testthat/test-setup.R deleted file mode 100644 index c830d3386..000000000 --- a/tests/testthat/test-setup.R +++ /dev/null @@ -1,245 +0,0 @@ - - -# load packages needed for generating reports -suppressWarnings({ - library(austraits) - library(knitr) - library(kableExtra) -}) - -test_that("metadata_create_template is working",{ - unlink("data/Test_2022/metadata.yml") - - expect_silent(schema <- get_schema()) - - expect_invisible(metadata_create_template(dataset_id = "Test_2022", - path = file.path("data", "Test_2022"), - skip_manual = TRUE)) - test_metadata <- read_metadata("data/Test_2022/metadata.yml") - - metadata_names <- c("source", "contributors", "dataset", "locations", "contexts", "traits", - "substitutions", "taxonomic_updates", "exclude_observations", - "questions") - - collectors_names <- c("last_name", "given_name", "ORCID", "affiliation") - ## Test metadata exists with correct names - expect_named(test_metadata) - expect_equal(names(test_metadata), metadata_names) - expect_equal(length(test_metadata$source$primary), 10) - expect_isin(names(test_metadata$dataset), schema$metadata$elements$dataset$values %>% names()) - expect_type(test_metadata$contributors$data_collectors, "list") - expect_equal(test_metadata$contributors$data_collectors %>% length(), 1L) - expect_equal(names(test_metadata$contributors$data_collectors[[1]]), collectors_names) - expect_equal((test_metadata$contributors$data_collectors[[1]] %>% unique)[[1]], "unknown") - }) - -test_that("metadata_path_dataset_id is working",{ - expect_silent(metadata_path_dataset_id("Test_2022")) - expect_equal(metadata_path_dataset_id("Test_2022"), "data/Test_2022/metadata.yml") - expect_equal(class(metadata_path_dataset_id("Test_2022")), "character") -}) - -test_that("read_metadata_dataset is working",{ - expect_silent(read_metadata_dataset("Test_2022")) - expect_equal(class(read_metadata_dataset("Test_2022")), "list") -}) - -test_that("write_metadata_dataset is working",{ - metadata <- read_metadata_dataset("Test_2022") - - unlink("data/Test_2022/metadata.yml") - expect_false(file.exists("data/Test_2022/metadata.yml")) - - expect_silent(write_metadata_dataset(metadata, "Test_2022")) - expect_true(file.exists("data/Test_2022/metadata.yml")) - - expect_silent(read_metadata_dataset("Test_2022")) - expect_equal(class(read_metadata_dataset("Test_2022")), "list") -}) - - -test_that("metadata_add_source_doi is working",{ - - doi <- "https://doi.org/10.3389/fmars.2021.671145" - doi2 <- "https://doi.org/10.1111/j.0022-0477.2005.00992.x" - - expect_equal(doi, util_standardise_doi(doi)) - expect_equal(doi, util_standardise_doi("https://doi.org/10.3389/fmars.2021.671145")) - expect_equal(doi, util_standardise_doi("http://doi.org/10.3389/fmars.2021.671145")) - expect_equal(doi, util_standardise_doi("doi.org/10.3389/fmars.2021.671145")) - expect_equal(doi, util_standardise_doi("10.3389/fmars.2021.671145")) - - # We won't actually test querying of rcrossref, to avoid unnecessary fails - # passing in bib avoids calling corssref - - # Create and load test data - # bib <- rcrossref::cr_cn(doi) - # writeLines(bib, "tests/testthat/data/test.bib") - # bib2 <- rcrossref::cr_cn(doi2) - # writeLines(bib2, "tests/testthat/data/test2.bib") - bib <- readLines("data/test.bib") %>% paste(collapse = "\n") - bib2 <- readLines("data/test2.bib") %>% paste(collapse="\n") - - expect_invisible(metadata_add_source_doi(dataset_id = "Test_2022", doi=doi, bib=bib)) - expect_invisible(metadata_add_source_doi(dataset_id = "Test_2022", doi = doi2, bib = bib2, type = "secondary")) - - ret <- read_metadata("data/Test_2022/metadata.yml") - expect_equal(ret$source$primary$journal, "Frontiers in Marine Science") - expect_equal(ret$source$primary$year, "2021") - expect_equal(paste0("https://doi.org/", ret$source$primary$doi), doi) - - expect_equal(ret$source$secondary$journal, "Journal of Ecology") - expect_equal(ret$source$secondary$year, "2005") - expect_equal(paste0("https://doi.org/", ret$source$secondary$doi), doi2) -}) - - -test_that("metadata_check_custom_R_code is working",{ - expect_equal(class(metadata_check_custom_R_code("Test_2022")), c("spec_tbl_df", "tbl_df", "tbl", "data.frame")) - expect_equal(ncol(metadata_check_custom_R_code("Test_2022")), 13) - expect_equal(nrow(metadata_check_custom_R_code("Test_2022")), 45) - - expect_visible(metadata_check_custom_R_code("Test_2022")) -}) - -test_that("metadata_add_source_bibtex is working",{ - expect_silent(metadata_add_source_bibtex(dataset_id = "Test_2022", file = "data/test2.bib")) - expect_equal(read_metadata("data/Test_2022/metadata.yml")$source$primary$journal, "Journal of Ecology") -}) - -test_that("metadata_add_substitution is working",{ - expect_silent(suppressMessages(metadata_add_substitution("Test_2022", "leaf_mass_per_area", - "leaf_area", "leaf_mass_per_area"))) - expect_equal(length(read_metadata("data/Test_2022/metadata.yml")$substitutions[[1]]), 3) - expect_equal(read_metadata("data/Test_2022/metadata.yml")$substitutions[[1]]$trait_name, "leaf_mass_per_area") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$substitutions[[1]]$find, "leaf_area") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$substitutions[[1]]$replace, "leaf_mass_per_area") -}) - -test_that("metadata_add_taxonomic_change is working",{ - expect_output(metadata_add_taxonomic_change("Test_2022", "flower", "tree", "leaves", "Tissue")) - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$find, "flower") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$replace, "tree") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$reason, "leaves") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$taxonomic_resolution, "Tissue") -}) - -test_that("metadata_exclude_observations is working",{ - expect_output(metadata_exclude_observations("Test_2022", "stem", "branch", "test")) - expect_equal(read_metadata("data/Test_2022/metadata.yml")$exclude_observations[[1]]$variable, "stem") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$exclude_observations[[1]]$find, "branch") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$exclude_observations[[1]]$reason, "test") -}) - -test_that("metadata_update_taxonomic_change is working",{ - expect_error(metadata_update_taxonomic_change("Test_2022", "grass", "bark", "soil", "Substrate")) - expect_invisible(suppressMessages(metadata_update_taxonomic_change("Test_2022", "flower", "bark", "soil", "Substrate"))) - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$find, "flower") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$replace, "bark") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$reason, "soil") - expect_equal(read_metadata("data/Test_2022/metadata.yml")$taxonomic_updates[[1]]$taxonomic_resolution, "Substrate") -}) - -test_that("metadata_remove_taxonomic_change is working",{ - expect_invisible(metadata_remove_taxonomic_change("Test_2022", "flower")) -}) - -test_that("test dataset_test is working",{ - expect_error(dataset_test()) -}) - -test_that("test build_setup_pipeline is working",{ - - - unlink("remake.yml") - unlink("config/taxon_list.csv") - - unlink(".git", recursive = TRUE) - expect_false(file.exists("remake.yml")) - expect_false(file.exists("config/taxon_list.csv")) - expect_true(file.copy("data/Test_2022/test-metadata.yml", "data/Test_2022/metadata.yml", overwrite = TRUE)) - - expect_no_error(zip::unzip("config/testgit.zip")) - expect_no_error(sha <- git2r::sha(git2r::last_commit())) - expect_error(build_setup_pipeline(path = "Datas")) - - expect_silent(build_setup_pipeline()) - expect_true(file.exists("remake.yml")) - expect_silent(yaml::read_yaml("remake.yml")) - expect_true(file.exists("config/taxon_list.csv")) - expect_silent(taxa1 <- read_csv_char("config/taxon_list.csv")) - - vars <- c('aligned_name', 'taxonomic_dataset', 'aligned_scientific_name_id', 'aligned_name_taxonomic_status', 'aligned_name_alternative_taxonomic_status', 'taxon_name', 'taxon_id', 'scientific_name_authorship', 'taxon_rank', 'taxonomic_status', 'family', 'taxon_distribution', 'establishment_means', 'scientific_name', 'scientific_name_id') - - expect_named(taxa1, vars) - expect_length(taxa1, 15) - expect_true(nrow(taxa1) == 0) - expect_true(file.copy("config/taxon_list-orig.csv", "config/taxon_list.csv", TRUE)) - expect_silent(taxa2 <- read_csv_char("config/taxon_list.csv")) - expect_named(taxa2, vars) - expect_length(taxa2, 15) - expect_true(nrow(taxa2) == 7) - - unlink(".remake", recursive = TRUE) - expect_no_error(austraits_raw <- remake::make("austraits_raw")) - expect_no_error(austraits <- remake::make("austraits")) - - expect_null(austraits_raw$build_info$version) - expect_null(austraits_raw$build_info$git_SHA) - expect_equal(austraits$build_info$version, "4.0.0") - expect_true(is.character(austraits$build_info$git_SHA)) - expect_equal(austraits$build_info$git_SHA, sha) - expect_equal(austraits$build_info$git_SHA, "6c73238d8d048781d9a4f5239a03813be313f0dd") - - expect_length(austraits_raw$taxa, 14) - expect_length(austraits$taxa, 14) - expect_equal(nrow(austraits$taxa), nrow(austraits_raw$taxa)) -}) - -test_that("reports and plots produced",{ - - expect_no_error(austraits <- remake::make("austraits")) - - expect_no_error( - p <- 1 #austraits::plot_trait_distribution_beeswarm(austraits, "huber_value", "dataset_id", highlight = "Test_2022", hide_ids = TRUE) - ) - - expect_no_error( - dataset_report(dataset_id = "Test_2022", austraits = austraits, overwrite = TRUE) - ) -}) - -testthat::test_that("Is test_data working", { - - expect_silent( - out <- dataset_test("Test_2022", reporter = testthat::SilentReporter) - ) - - expect_true( - all(c("SilentReporter", "Reporter", "R6") %in% class(out)) - ) - -}) - -testthat::test_that("test metadata_add_substitutions_table", { - substitutions_df <- tibble::tibble( - dataset_id = "Test_2022", - trait_name = "Tree", - find = "Root", - replace = "Branch" - ) - - path_metadata <- "data/Test_2022/metadata.yml" - - metadata_create_template( - dataset_id = "Test_2022", - path = "data", - skip_manual = TRUE - ) - - metadata <- read_metadata(path_metadata) - metadata$substitutions <- NA - write_metadata(metadata, path_metadata) - expect_invisible(metadata_add_substitutions_table(substitutions_df, "Test_2022", "trait_name", "find", "replace")) - expect_equal(read_metadata(path_metadata)$substitutions %>% sapply(`%in%`, x = "Tree") %>% any(), TRUE) -}) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R deleted file mode 100644 index d25b6b492..000000000 --- a/tests/testthat/test-utils.R +++ /dev/null @@ -1,62 +0,0 @@ -test_that("util_replace_null returns NA",{ - expect_equal(util_replace_null(NULL), NA) - expect_equal(util_replace_null(1), 1) -}) - -test_that("util_extract_list_element returns an element in character",{ - test_list <- util_df_to_list(iris) - names(test_list) <- paste("row", seq_len(nrow(iris))) - - expect_type(util_extract_list_element(1, test_list, "Sepal.Length"), "double") - expect_equal(util_extract_list_element(1, test_list, "Sepal.Length"), 5.1) - expect_equal(util_extract_list_element("row 2", test_list, "Sepal.Length"), 4.9) - expect_error(util_extract_list_element((length(test_list)+1), test_list, "units"), "subscript out of bounds") -}) - -test_that("util_separate_and_sort returns alphabetically sorted characters",{ - expect_type(util_separate_and_sort("z y x"), "character") - expect_match(util_separate_and_sort("z y x"), "x y z") - expect_match(util_separate_and_sort("300 200 100 1 2 3"), "1 100 2 200 3 300") -}) - -test_that("util_df_to_list",{ - expect_match(class(util_df_to_list(iris)), "list") - expect_type(util_df_to_list(iris), "list") - - expect_match(class(util_append_to_list(as.list(iris)[c(1,2)], as.list(iris)[c(3)])), "list") - expect_equal(length(util_append_to_list(as.list(iris)[c(1,2)], as.list(iris)[c(3)])), 3) -}) - -test_that("util_list_to_df2",{ - expect_equal(util_list_to_df2(NULL), NA) - expect_equal(util_list_to_df2(NA), NA) - - my_list <- util_df_to_list(iris) - expect_match(class(util_list_to_df2(my_list))[1], "tbl_df") - - my_list <- list(NA) - expect_equal(util_list_to_df2(my_list), NA) -}) - -test_that("util_append_to_list",{ - my_list <- as.list(iris) - expect_equal(util_append_to_list(my_list, NULL), my_list) - expect_length((util_append_to_list(my_list, NA)), 6) - expect_gt(length(util_append_to_list(my_list, NA)), length(my_list)) - expect_error(util_append_to_list(my_list), 'argument "to_append" is missing, with no default') -}) - -test_that("util_strip_taxon_names",{ - v1 <- c("banksia serrata", "Banksia_serrata", "banksia serrata", "Banksia Serrata") - v2 <- util_strip_taxon_names(v1) - - expect_true(all(v2 == v1[1])) - expect_equal(length(v1), length(v2)) - - v1 <- c("banksia serrata spinulosa", "Banksia_serrata var. SpinUlosa", "banksia serrata s.l. spinulosa", "Banksia Serrata aff. spinulosa") - v2 <- util_strip_taxon_names(v1) - - expect_true(all(v2 == v1[1])) - expect_equal(length(v1), length(v2)) -}) - diff --git a/tests/testthat/test-xamples.R b/tests/testthat/test-xamples.R deleted file mode 100644 index c2158508e..000000000 --- a/tests/testthat/test-xamples.R +++ /dev/null @@ -1,156 +0,0 @@ - -testthat::test_that("test datasets", { - - - - schema <- get_schema() - resource_metadata <- get_schema("config/metadata.yml", "metadata") - definitions <- get_schema("config/traits.yml", "traits") - unit_conversions <- traits.build:::get_unit_conversions("config/unit_conversions.csv") - taxon_list <- read_csv_char("config/taxon_list.csv") - - - examples.dir <- "examples" - - # Build example -- this runs a bunch of tests already - - # Example 1 - Test for basis_of_record and life_stage at the dataset level - # test1-metadata and test1-data are copies of Falster_2005_1 - Ex1 <- test_build_dataset(file.path(examples.dir, "test1-metadata.yml"), file.path(examples.dir, "test1-data.csv"), "Example 1", definitions, unit_conversions, schema, resource_metadata, taxon_list) - - expect_equal(Ex1$traits$basis_of_record %>% unique, "field") - expect_equal(Ex1$traits$life_stage %>% unique, "adult") - expect_equal(Ex1$traits %>% filter(basis_of_record == "field") %>% nrow(), 406) - expect_equal(Ex1$traits %>% filter(life_stage == "adult") %>% nrow(), 406) - expect_equal(nrow(Ex1$excluded_data), 0) - - # Example 2 - Test variables are read in at the trait level - # test2-metadata basis_of_record for Leaf N trait changed to lab, basis_of_record for every other trait - # has not been specified so should take the dataset level value - ## Ex2 basis_of_record for Leaf N changed to lab - Ex2 <- test_build_dataset(file.path(examples.dir, "test2-metadata.yml"), file.path(examples.dir, "test1-data.csv"), "Example 2", definitions, unit_conversions, schema, resource_metadata, taxon_list) - - expect_equal(Ex2$traits$basis_of_record %>% unique, c("field", "lab")) - expect_equal(Ex2$traits %>% filter(basis_of_record == "field") %>% nrow(), 361) - expect_equal(Ex2$traits %>% filter(basis_of_record == "lab") %>% nrow(), 45) - expect_equal(Ex2$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% unique, "lab") - expect_equal(Ex2$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% length, 45) - - # Example 3 - Test variables stored as a column in data.csv is read in correctly - # test2-data basis_of_record column has been added in data.csv - # test2.1 metadata basis_of_record and life_stage changed to match column name - # basis_of_record in the column contains "wild" while the dataset level basis_of_record is "field" - # the values in the column should take precedence over the dataset value - Ex3 <- test_build_dataset(file.path(examples.dir, "test2.1-metadata.yml"), file.path(examples.dir, "test2-data.csv"), "Example 3", definitions, unit_conversions, schema, resource_metadata, taxon_list) - - expect_equal(Ex3$traits$basis_of_record %>% unique, c("wild", "lab")) - expect_equal(Ex3$traits %>% filter(basis_of_record == "wild") %>% nrow(), 361) - expect_equal(Ex3$traits$life_stage %>% unique, "seedling") - expect_equal(Ex3$traits %>% filter(life_stage == "seedling") %>% nrow(), 406) - expect_equal(yaml::read_yaml(file.path(examples.dir, "test2.1-metadata.yml"))$dataset$basis_of_record, "basis_of_record") - expect_equal(yaml::read_yaml(file.path(examples.dir, "test2.1-metadata.yml"))$dataset$life_stage, "life_stage") - - - # Example 4 - Test variables stored as a column in data.csv are replaced with trait level value, - # also introduced a value at the trait level Leaf_N ~ lab - # test3-data basis_of_record column has been added in data.csv with missing values - # Similar to EX 3 but this time values should be filled in for traits that have a value specified - Ex4 <- test_build_dataset(file.path(examples.dir, "test2.1-metadata.yml"), file.path(examples.dir, "test3-data.csv"), "Example 4", definitions, unit_conversions, schema, resource_metadata, taxon_list) - - expect_equal(Ex4$traits$basis_of_record %>% unique, c(NA, "lab", "wild")) - expect_equal(Ex4$traits %>% filter(is.na(basis_of_record)) %>% nrow(), 352) - expect_equal(Ex4$traits %>% filter(basis_of_record == "lab") %>% nrow(), 45) - expect_equal(Ex4$traits %>% filter(basis_of_record == "wild") %>% nrow(), 9) - - expect_equal(Ex4$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% unique, c("lab")) - expect_equal(Ex4$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% grep(pattern = "lab") %>% length , 45) - expect_equal(Ex4$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% grep(pattern = "wild") %>% length , 0) - - expect_equal(Ex4$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "seed_dry_mass") %>% - pull(basis_of_record) %>% unique, c(NA, "wild")) - expect_equal(Ex4$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "seed_dry_mass") %>% - pull(basis_of_record) %>% is.na %>% sum, 28) - expect_equal(Ex4$traits %>% select(dplyr::all_of(c("trait_name", "basis_of_record"))) %>% - filter(trait_name == "seed_dry_mass") %>% - pull(basis_of_record) %>% grep(pattern = "wild") %>% length , 1) - - # Example 5 - Test a combination of trait, site and dataset level values - # Basis of record has been specified for dataset level ~ field, site level ~ Cape_Tribulation - # trait level ~ leaf_N and column ~ wild - # column values should take precedence followed by traits values, followed by locations and then dataset values - Ex5 <- test_build_dataset(file.path(examples.dir, "test3-metadata.yml"), file.path(examples.dir, "test3-data.csv"), "Example 5", definitions, unit_conversions, schema, resource_metadata, taxon_list) - - expect_equal(Ex5$traits$basis_of_record %>% unique, c(NA, "lab", "Cape_Tribulation")) - expect_equal(Ex5$traits %>% filter(is.na(basis_of_record)) %>% nrow(), 81) - expect_equal(Ex5$traits %>% filter(basis_of_record == "Cape_Tribulation") %>% nrow(), 315) - expect_equal(Ex5$traits %>% filter(basis_of_record == "lab") %>% nrow(), 10) - expect_equal(Ex5$traits %>% filter(basis_of_record == "wild") %>% nrow(), 0) - - expect_equal(Ex5$traits %>% select(c("taxon_name", "basis_of_record")) %>% - filter(taxon_name == "Trema aspera") %>% pull(basis_of_record) %>% unique, c("Cape_Tribulation")) - expect_equal(Ex5$traits %>% select(c("taxon_name", "basis_of_record")) %>% - filter(taxon_name == "Trema aspera") %>% pull(basis_of_record) %>% length, 10) - - expect_equal(Ex5$traits %>% select(c("trait_name", "basis_of_record")) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% grep(pattern ="lab") %>% length, 10) - expect_equal(Ex5$traits %>% select(c("trait_name", "basis_of_record")) %>% - filter(trait_name == "leaf_N_per_dry_mass") %>% - pull(basis_of_record) %>% grep(pattern ="wild") %>% length, 0) - - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "01") %>% - pull(basis_of_record) %>% unique, c(NA, "lab")) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "01") %>% - pull(basis_of_record) %>% length, 91) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "01") %>% - pull(basis_of_record) %>% is.na %>% sum, 81) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "01") %>% - pull(basis_of_record) %>% grep(pattern = "lab") %>% length, 10) - - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "02") %>% - pull(basis_of_record) %>% unique, c("Cape_Tribulation")) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "02") %>% - pull(basis_of_record) %>% length, 315) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "02") %>% - pull(basis_of_record) %>% grep(pattern = "Cape_Tribulation") %>% length, 315) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "02") %>% - pull(basis_of_record) %>% grep(pattern = "lab") %>% length, 0) - expect_equal(Ex5$traits %>% select(c("location_id", "basis_of_record")) %>% filter(location_id == "02") %>% - pull(basis_of_record) %>% grep(pattern = "wild") %>% length, 0) - - expect_equal(Ex5$traits %>% pull(location_id) %>% unique, Ex5$locations %>% pull(location_id) %>% unique) - expect_equal(Ex5$traits %>% select(c("location_id")) %>% unique() %>% nrow(), Ex5$locations %>% select(c("location_name")) %>% unique() %>% nrow()) - - # Example 6 - Tests focus on context and the various context identifiers - # Based on Crous_2013 - # Have also added data for sex to test this field (commented out for now) - - Ex6 <- test_build_dataset(file.path(examples.dir, "test4-metadata.yml"), file.path(examples.dir, "test4-data.csv"), "Example 6", definitions, unit_conversions, schema, resource_metadata, taxon_list) - - #expect_equal(Ex6$traits$sex %>% unique, c("male", "female")) - expect_equal(Ex6$traits$location_id %>% unique, c("01")) - #expect_equal(Ex6$traits %>% filter(sex == "male") %>% nrow(), 85) - expect_equal(Ex6$traits %>% distinct(method_id, temporal_id, treatment_id) %>% nrow(), 36) - - expect_equal(Ex6$contexts$category %>% unique, c("temporal", "treatment", "method")) - expect_equal(Ex6$contexts %>% nrow(), 9) - expect_equal(Ex6$contexts %>% nrow(), Ex6$contexts %>% group_by(link_id, link_vals) %>% distinct() %>% nrow()) - expect_equal(Ex6$contexts %>% pull(context_property) %>% unique() %>% length, 4) - - expect_equal(Ex6$traits %>% filter(trait_name == "fruit_colour") %>% pull(value) %>% unique, c("pink", "black", "red")) - - expect_equal(Ex6$traits %>% pull(observation_id) %>% unique() %>% length(), 35) - -})