# Run any of the following if you don't have them installed yet
install.packages("nimble")
install.packages("remotes")
Intro to course tools: VectorByte Dataset Access Functions
This section will cover the exploration of of the VecTraits database and the functions included in the package bayesTPC
to access to specific data.
Installing bayesTPC
package
Lets start installing the package bayesTPC
. It is important to have some packages installed in advance. The package bayesTPC
uses some functionality from the package nimble
. It is also useful to install the package remotes
to install bayesTPC
from the repository. To do so, you can run the following codes:
To install the package bayesTPC
, you can use the following line of code:
::install_github("johnwilliamsmithjr/bayesTPC") remotes
Getting to know the VecTraits database
Explore the VecTraits database. Notice that you can search datasets by filtering according to traits, variables, genus, etc. We encourage you to identify some datasets that meets your particular interests.
Pulling data into R
using the VecTraits API (Application Programming Interface) from bayesTPC
This section will walk you through the functions included in bayesTPC
to retrieve data from VecTraits database
Load some packages…
library(nimble)
library(bayesTPC)
library(tidyverse)
Next, we are going to use some functions to extract specific datasets. We can use the function get_dataset()
to extract a single one:
<- get_dataset(50) # Get dataset with ID 50
dataset50 head(dataset50)
Id DatasetID IndividualID OriginalID OriginalTraitName
1 81848 50 PHX261 fecundity rate
2 81849 50 PHX261 fecundity rate
3 81850 50 PHX261 fecundity rate
4 81851 50 PHX261 fecundity rate
5 81852 50 PHX261 fecundity rate
OriginalTraitDef StandardisedTraitName StandardisedTraitDef
1 mean eggs individual-1 day-1 NA NA
2 mean eggs individual-1 day-1 NA NA
3 mean eggs individual-1 day-1 NA NA
4 mean eggs individual-1 day-1 NA NA
5 mean eggs individual-1 day-1 NA NA
OriginalTraitValue OriginalTraitUnit OriginalErrorPos OriginalErrorNeg
1 3.0 eggs individual-1 day-1 51.7 51.7
2 6.3 eggs individual-1 day-1 33.4 33.4
3 9.6 eggs individual-1 day-1 36.3 36.3
4 12.5 eggs individual-1 day-1 45.7 45.7
5 5.8 eggs individual-1 day-1 75.2 75.2
OriginalErrorUnit StandardisedTraitValue StandardisedTraitUnit
1 coefficient of variance NA NA
2 coefficient of variance NA NA
3 coefficient of variance NA NA
4 coefficient of variance NA NA
5 coefficient of variance NA NA
StandardisedErrorPos StandardisedErrorNeg StandardisedErrorUnit Replicates
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
Habitat LabField ArenaValue ArenaUnit ArenaValueSI ArenaUnitSI
1 terrestrial laboratory NA NA NA NA
2 terrestrial laboratory NA NA NA NA
3 terrestrial laboratory NA NA NA NA
4 terrestrial laboratory NA NA NA NA
5 terrestrial laboratory NA NA NA NA
AmbientTemp AmbientTempMethod AmbientTempUnit AmbientLight AmbientLightUnit
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
4 NA NA NA NA NA
5 NA NA NA NA NA
SecondStressor SecondStressorDef SecondStressorValue SecondStressorUnit
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
TimeStart TimeEnd TotalObsTimeValue TotalObsTimeUnit TotalObsTimeValueSI
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
4 NA NA NA NA NA
5 NA NA NA NA NA
TotalObsTimeUnitSI TotalObsTimeNotes ResRepValue ResRepUnit ResRepValueSI
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
4 NA NA NA NA NA
5 NA NA NA NA NA
ResRepUnitSI LocationText LocationType OriginalLocationDate LocationDate
1 NA Dryden New York NA NA 1974-01-06
2 NA Dryden New York NA NA 1974-01-06
3 NA Dryden New York NA NA 1974-01-06
4 NA Dryden New York NA NA 1974-01-06
5 NA Dryden New York NA NA 1974-01-06
LocationDatePrecision CoordinateType Latitude Longitude Interactor1
1 3 decimal 42.48917 -76.35972 Sepedon fuscipennis
2 3 decimal 42.48917 -76.35972 Sepedon fuscipennis
3 3 decimal 42.48917 -76.35972 Sepedon fuscipennis
4 3 decimal 42.48917 -76.35972 Sepedon fuscipennis
5 3 decimal 42.48917 -76.35972 Sepedon fuscipennis
Interactor1Common Interactor1Wholepart Interactor1WholePartType
1 Marsh fly NA NA
2 Marsh fly NA NA
3 Marsh fly NA NA
4 Marsh fly NA NA
5 Marsh fly NA NA
Interactor1Number Interactor1Kingdom Interactor1Phylum Interactor1Class
1 17 Animalia Arthropoda Insecta
2 59 Animalia Arthropoda Insecta
3 54 Animalia Arthropoda Insecta
4 52 Animalia Arthropoda Insecta
5 24 Animalia Arthropoda Insecta
Interactor1Order Interactor1Family Interactor1Genus Interactor1Species
1 Diptera Sciomyzidae Sepedon fuscipennis
2 Diptera Sciomyzidae Sepedon fuscipennis
3 Diptera Sciomyzidae Sepedon fuscipennis
4 Diptera Sciomyzidae Sepedon fuscipennis
5 Diptera Sciomyzidae Sepedon fuscipennis
Interactor1Stage Interactor1Sex Interactor1Temp Interactor1TempUnit
1 adult female 15 Celsius
2 adult female 21 Celsius
3 adult female 26 Celsius
4 adult female 30 Celsius
5 adult female 33 Celsius
Interactor1TempMethod Interactor1GrowthTemp Interactor1GrowthTempUnit
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1GrowthDur Interactor1GrowthdDurUnit Interactor1GrowthType
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1Acc Interactor1AccTemp Interactor1AccTempNotes Interactor1AccTime
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
Interactor1AccTimeNotes Interactor1AccTimeUnit Interactor1OrigTemp
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1OrigTempNotes Interactor1OrigTime Interactor1OrigTimeNotes
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1OrigTimeUnit Interactor1EquilibTimeValue
1 NA NA
2 NA NA
3 NA NA
4 NA NA
5 NA NA
Interactor1EquilibTimeUnit Interactor1Size Interactor1SizeUnit
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1SizeType Interactor1SizeSI Interactor1SizeUnitSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1DenValue Interactor1DenUnit Interactor1DenTypeSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1DenValueSI Interactor1DenUnitSI Interactor1MassValueSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor1MassUnitSI Interactor2 Interactor2Common Interactor2Kingdom
1 NA None None NA NA
2 NA None None NA NA
3 NA None None NA NA
4 NA None None NA NA
5 NA None None NA NA
Interactor2Phylum Interactor2Class Interactor2Order Interactor2Family
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
Interactor2Genus Interactor2Species Interactor2Stage Interactor2Sex
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
Interactor2Temp Interactor2TempUnit Interactor2TempMethod
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2GrowthTemp Interactor2GrowthTempUnit Interactor2GrowthDur
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2GrowthDurUnit Interactor2GrowthType Interactor2Acc
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2AccTemp Interactor2AccTempNotes Interactor2AccTime
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2AccTimeNotes Interactor2AccTimeUnit Interactor2OrigTemp
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2OrigTempNotes Interactor2OrigTime Interactor2OrigTimeNotes
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2OrigTimeUnit Interactor2EquilibTimeValue
1 NA NA
2 NA NA
3 NA NA
4 NA NA
5 NA NA
Interactor2EquilibTimeUnit Interactor2Size Interactor2SizeUnit
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2SizeType Interactor2SizeSI Interactor2SizeUnitSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2DenValue Interactor2DenUnit Interactor2DenTypeSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2DenValueSI Interactor2DenUnitSI Interactor2MassValueSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
Interactor2MassUnitSI PhysicalProcess PhysicalProcess_1 PhysicalProcess_2
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
FigureTable
1 table 1
2 table 1
3 table 1
4 table 1
5 table 1
Citation
1 Barnes 1976. Effect of temperature on development survival oviposition and diapause in laboratory populations of Sepedon fuscipennis (Diptera: Sciomyzidae). Environ. Entomol. 5: 1089-1098
2 Barnes 1976. Effect of temperature on development survival oviposition and diapause in laboratory populations of Sepedon fuscipennis (Diptera: Sciomyzidae). Environ. Entomol. 5: 1089-1098
3 Barnes 1976. Effect of temperature on development survival oviposition and diapause in laboratory populations of Sepedon fuscipennis (Diptera: Sciomyzidae). Environ. Entomol. 5: 1089-1098
4 Barnes 1976. Effect of temperature on development survival oviposition and diapause in laboratory populations of Sepedon fuscipennis (Diptera: Sciomyzidae). Environ. Entomol. 5: 1089-1098
5 Barnes 1976. Effect of temperature on development survival oviposition and diapause in laboratory populations of Sepedon fuscipennis (Diptera: Sciomyzidae). Environ. Entomol. 5: 1089-1098
CuratedByCitation CuratedByDOI DOI SubmittedBy
1 NA NA 10.1093/ee/5.6.1089 Paul Huxley
2 NA NA 10.1093/ee/5.6.1089 Paul Huxley
3 NA NA 10.1093/ee/5.6.1089 Paul Huxley
4 NA NA 10.1093/ee/5.6.1089 Paul Huxley
5 NA NA 10.1093/ee/5.6.1089 Paul Huxley
ContributorEmail Notes DefaultChartXaxis DefaultChartCategory
1 phuxly@gmail.com NA Interactor1Temp LocationText
2 phuxly@gmail.com NA Interactor1Temp LocationText
3 phuxly@gmail.com NA Interactor1Temp LocationText
4 phuxly@gmail.com NA Interactor1Temp LocationText
5 phuxly@gmail.com NA Interactor1Temp LocationText
Retrieve Multiple Datasets
Get a list of datasets by their ID numbers.
format: get_datasets(<Vector or sequence of IDs>)
<- get_datasets(c(1:10)) list_of_dataframes
Retrieving dataset: 1
Retrieving dataset: 2
Retrieving dataset: 3
Retrieving dataset: 4
Retrieving dataset: 5
Retrieving dataset: 6
Retrieving dataset: 7
Retrieving dataset: 8
Retrieving dataset: 9
Retrieving dataset: 10
Use do.call
and lapply
to create a single dataframe containing all of the datasets you pulled in the previous step:
<- do.call(rbind,lapply(list_of_dataframes, data.frame, stringsAsFactors=FALSE))
datasets1to10 head(datasets1to10)
Id DatasetID IndividualID OriginalID OriginalTraitName
1 81518 1 PHX801 development time
2 81519 1 PHX801 development time
3 81520 1 PHX801 development time
4 81521 1 PHX801 development time
5 81522 1 PHX801 development time
6 81523 2 PHX802 fecundity
OriginalTraitDef StandardisedTraitName StandardisedTraitDef
1 mean duration of life stage NA NA
2 mean duration of life stage NA NA
3 mean duration of life stage NA NA
4 mean duration of life stage NA NA
5 mean duration of life stage NA NA
6 mean lifetime offspring NA NA
OriginalTraitValue OriginalTraitUnit OriginalErrorPos OriginalErrorNeg
1 21.3 days 0.31 0.31
2 12.2 days 0.23 0.23
3 8.3 days 0.16 0.16
4 6.7 days 0.16 0.16
5 6.5 days 0.26 0.26
6 51.5 offspring individual-1 3.93 3.93
OriginalErrorUnit StandardisedTraitValue StandardisedTraitUnit
1 se NA NA
2 se NA NA
3 se NA NA
4 se NA NA
5 se NA NA
6 se NA NA
StandardisedErrorPos StandardisedErrorNeg StandardisedErrorUnit Replicates
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
6 NA NA NA NA
Habitat LabField ArenaValue ArenaUnit ArenaValueSI ArenaUnitSI
1 terrestrial laboratory NA NA NA NA
2 terrestrial laboratory NA NA NA NA
3 terrestrial laboratory NA NA NA NA
4 terrestrial laboratory NA NA NA NA
5 terrestrial laboratory NA NA NA NA
6 terrestrial laboratory NA NA NA NA
AmbientTemp AmbientTempMethod AmbientTempUnit AmbientLight AmbientLightUnit
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
4 NA NA NA NA NA
5 NA NA NA NA NA
6 NA NA NA NA NA
SecondStressor SecondStressorDef SecondStressorValue SecondStressorUnit
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
6 NA NA NA NA
TimeStart TimeEnd TotalObsTimeValue TotalObsTimeUnit TotalObsTimeValueSI
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
4 NA NA NA NA NA
5 NA NA NA NA NA
6 NA NA NA NA NA
TotalObsTimeUnitSI TotalObsTimeNotes ResRepValue ResRepUnit ResRepValueSI
1 NA NA NA NA NA
2 NA NA NA NA NA
3 NA NA NA NA NA
4 NA NA NA NA NA
5 NA NA NA NA NA
6 NA NA NA NA NA
ResRepUnitSI LocationText LocationType OriginalLocationDate
1 NA Nonsan-si Republic of Korea field NA
2 NA Nonsan-si Republic of Korea field NA
3 NA Nonsan-si Republic of Korea field NA
4 NA Nonsan-si Republic of Korea field NA
5 NA Nonsan-si Republic of Korea field NA
6 NA Nonsan-si Republic of Korea field NA
LocationDate LocationDatePrecision CoordinateType Latitude Longitude
1 2009-01-01 1 decimal 36.5 126.75
2 2009-01-01 1 decimal 36.5 126.75
3 2009-01-01 1 decimal 36.5 126.75
4 2009-01-01 1 decimal 36.5 126.75
5 2009-01-01 1 decimal 36.5 126.75
6 2009-01-01 1 decimal 36.5 126.75
Interactor1 Interactor1Common Interactor1Wholepart
1 Acyrthosiphon pisum Pea aphid NA
2 Acyrthosiphon pisum Pea aphid NA
3 Acyrthosiphon pisum Pea aphid NA
4 Acyrthosiphon pisum Pea aphid NA
5 Acyrthosiphon pisum Pea aphid NA
6 Acyrthosiphon pisum Pea aphid NA
Interactor1WholePartType Interactor1Number Interactor1Kingdom
1 NA 39 Animalia
2 NA 53 Animalia
3 NA 45 Animalia
4 NA 42 Animalia
5 NA 8 Animalia
6 NA 50 Animalia
Interactor1Phylum Interactor1Class Interactor1Order Interactor1Family
1 Arthropoda Insecta Hemiptera Aphididae
2 Arthropoda Insecta Hemiptera Aphididae
3 Arthropoda Insecta Hemiptera Aphididae
4 Arthropoda Insecta Hemiptera Aphididae
5 Arthropoda Insecta Hemiptera Aphididae
6 Arthropoda Insecta Hemiptera Aphididae
Interactor1Genus Interactor1Species Interactor1Stage Interactor1Sex
1 Acyrthosiphon pisum juvenile <NA>
2 Acyrthosiphon pisum juvenile <NA>
3 Acyrthosiphon pisum juvenile <NA>
4 Acyrthosiphon pisum juvenile <NA>
5 Acyrthosiphon pisum juvenile <NA>
6 Acyrthosiphon pisum adult female
Interactor1Temp Interactor1TempUnit Interactor1TempMethod
1 10 Celsius NA
2 15 Celsius NA
3 20 Celsius NA
4 25 Celsius NA
5 30 Celsius NA
6 10 Celsius NA
Interactor1GrowthTemp Interactor1GrowthTempUnit Interactor1GrowthDur
1 NA <NA> NA
2 NA <NA> NA
3 NA <NA> NA
4 NA <NA> NA
5 NA <NA> NA
6 NA <NA> NA
Interactor1GrowthdDurUnit Interactor1GrowthType Interactor1Acc
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1AccTemp Interactor1AccTempNotes Interactor1AccTime
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1AccTimeNotes Interactor1AccTimeUnit Interactor1OrigTemp
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1OrigTempNotes Interactor1OrigTime Interactor1OrigTimeNotes
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1OrigTimeUnit Interactor1EquilibTimeValue
1 NA NA
2 NA NA
3 NA NA
4 NA NA
5 NA NA
6 NA NA
Interactor1EquilibTimeUnit Interactor1Size Interactor1SizeUnit
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1SizeType Interactor1SizeSI Interactor1SizeUnitSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1DenValue Interactor1DenUnit Interactor1DenTypeSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1DenValueSI Interactor1DenUnitSI Interactor1MassValueSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor1MassUnitSI Interactor2 Interactor2Common Interactor2Kingdom
1 NA None None NA NA
2 NA None None NA NA
3 NA None None NA NA
4 NA None None NA NA
5 NA None None NA NA
6 NA None None NA NA
Interactor2Phylum Interactor2Class Interactor2Order Interactor2Family
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
6 NA NA NA NA
Interactor2Genus Interactor2Species Interactor2Stage Interactor2Sex
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
6 NA NA NA NA
Interactor2Temp Interactor2TempUnit Interactor2TempMethod
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2GrowthTemp Interactor2GrowthTempUnit Interactor2GrowthDur
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2GrowthDurUnit Interactor2GrowthType Interactor2Acc
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2AccTemp Interactor2AccTempNotes Interactor2AccTime
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2AccTimeNotes Interactor2AccTimeUnit Interactor2OrigTemp
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2OrigTempNotes Interactor2OrigTime Interactor2OrigTimeNotes
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2OrigTimeUnit Interactor2EquilibTimeValue
1 NA NA
2 NA NA
3 NA NA
4 NA NA
5 NA NA
6 NA NA
Interactor2EquilibTimeUnit Interactor2Size Interactor2SizeUnit
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2SizeType Interactor2SizeSI Interactor2SizeUnitSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2DenValue Interactor2DenUnit Interactor2DenTypeSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2DenValueSI Interactor2DenUnitSI Interactor2MassValueSI
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
Interactor2MassUnitSI PhysicalProcess PhysicalProcess_1 PhysicalProcess_2
1 NA NA NA NA
2 NA NA NA NA
3 NA NA NA NA
4 NA NA NA NA
5 NA NA NA NA
6 NA NA NA NA
FigureTable
1 table 1
2 table 1
3 table 1
4 table 1
5 table 1
6 table 1
Citation
1 Ahn et al. 2020. Thermal effects on the population parameters and growth of Acyrthosiphon pisum (Harris) (Hemiptera: Aphididae). Insects 11:8
2 Ahn et al. 2020. Thermal effects on the population parameters and growth of Acyrthosiphon pisum (Harris) (Hemiptera: Aphididae). Insects 11:8
3 Ahn et al. 2020. Thermal effects on the population parameters and growth of Acyrthosiphon pisum (Harris) (Hemiptera: Aphididae). Insects 11:8
4 Ahn et al. 2020. Thermal effects on the population parameters and growth of Acyrthosiphon pisum (Harris) (Hemiptera: Aphididae). Insects 11:8
5 Ahn et al. 2020. Thermal effects on the population parameters and growth of Acyrthosiphon pisum (Harris) (Hemiptera: Aphididae). Insects 11:8
6 Ahn et al. 2020. Thermal effects on the population parameters and growth of Acyrthosiphon pisum (Harris) (Hemiptera: Aphididae). Insects 11:8
CuratedByCitation CuratedByDOI DOI SubmittedBy
1 NA NA 10.3390/insects11080481 Paul Huxley
2 NA NA 10.3390/insects11080481 Paul Huxley
3 NA NA 10.3390/insects11080481 Paul Huxley
4 NA NA 10.3390/insects11080481 Paul Huxley
5 NA NA 10.3390/insects11080481 Paul Huxley
6 NA NA 10.3390/insects11080481 Paul Huxley
ContributorEmail Notes DefaultChartXaxis
1 phuxly@gmail.com reared on faba bean leaves Interactor1Temp
2 phuxly@gmail.com reared on faba bean leaves Interactor1Temp
3 phuxly@gmail.com reared on faba bean leaves Interactor1Temp
4 phuxly@gmail.com reared on faba bean leaves Interactor1Temp
5 phuxly@gmail.com reared on faba bean leaves Interactor1Temp
6 phuxly@gmail.com reared on faba bean leaves Interactor1Temp
DefaultChartCategory
1 LocationText
2 LocationText
3 LocationText
4 LocationText
5 LocationText
6 LocationText
Search for and list datasets on a specific genus
<- find_datasets("Sepedon") list_of_sepedon
6 datasets found. Attempting to retreive.
Retrieving dataset: 49
Retrieving dataset: 50
Retrieving dataset: 51
Retrieving dataset: 52
Retrieving dataset: 53
Retrieving dataset: 54
Other options
Format:
list_of_dataframes <- get_datasets(<Vector or Range of IDs>)
Examples:
<- get_datasets(c(10, 20, 35)) # Get datasets 10, 20, and 35 list_of_dataframes
Retrieving dataset: 10
Retrieving dataset: 20
Retrieving dataset: 35
<- get_datasets(seq(200, 240, 10)) # Get datasets 200, 210, 220, 230, and 240 list_of_dataframes
Retrieving dataset: 200
Retrieving dataset: 210
Retrieving dataset: 220
Retrieving dataset: 230
Retrieving dataset: 240
<- get_datasets(c(50, 1, 580, 20)) # Get datasets 1, 20, 50, and 580 list_of_dataframes
Retrieving dataset: 50
Retrieving dataset: 1
Retrieving dataset: 580
Retrieving dataset: 20
<- get_datasets(320:324) # Get datasets 320, 321, 322, 323, and 324 list_of_dataframes
Retrieving dataset: 320
Retrieving dataset: 321
Retrieving dataset: 322
Retrieving dataset: 323
Retrieving dataset: 324
The pick()
Function
If all the information above was too much and there’s no way you’re going to remember it, all you need to know is the pick()
function. The pick()
function displays a small menu and allows you to choose an option in order for you to find and retrieve whatever dataset(s) you may be looking for.
Format:
x <- pick()
Access Dataframes In Lists
When multiple datasets are retrieved and stored in a list of dataframes, you can access individual datasets with the following format:
first_dataframe <- list_of_dataframes[[1]]
second_dataframe <- list_of_dataframes[[2]]
…and so on for every dataframe in the list.
Example:
To print a list of the names of those who contributed to the datasets related to tiger mosquitos:
for (i in 1:length(list_of_tiger_dataframes)) {
print(list_of_tiger_dataframes[[i]]$SubmittedBy[1])
}
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Lauren Chapman"
[1] "Paul Huxley"
[1] "Paul Huxley"
[1] "Lauren Chapman"
[1] "Lauren Chapman"
[1] "Lauren Chapman"
or retrieve the IDs:
for (i in 1:length(list_of_tiger_dataframes)) {
print(list_of_tiger_dataframes[[i]]$DatasetID[1])
}
[1] 6
[1] 69
[1] 70
[1] 71
[1] 72
[1] 108
[1] 109
[1] 110
[1] 111
[1] 112
[1] 171
[1] 288
[1] 289
[1] 290
[1] 291
[1] 292
[1] 293
Access Data In Dataframes
To access variable x
in row y
of a dataset stored as a dataframe, use the $
symbol and square brackets []
:
variable_value <- dataframe$x[y]
For example, if you had a dataset stored as a dataframe and you wanted to know the Genus of Interactor 1 in the fifth row, you could get that with the following code:
$Interactor1Genus[5] dataset50
[1] "Sepedon"
The same format also works for dataframes in lists. For example, you could run the following to get the original trait value in row 3 of the fourth dataset in the list:
3]]$OriginalTraitValue[5] list_of_dataframes[[
[1] 0.25
The same format also works on raw functions, although it is recommended that retrieved datasets are immediately stored in an R
object:
get_dataset(5)$SubmittedBy[1] # Name of person who submitted the dataset with ID 5
[1] "Paul Huxley"
Plotting datasets using ggplot2
Once the database is retrieved, data can be used to explore and plot. In this example the dataset 49 will be used. This dataset have data about fecundity (number of eggs per individual) at different temperatures for the species Sepedon fuscipennis:
<- get_dataset(49) dataset49
By using tools from ggplot2
data can be transformed and used:
%>%
dataset49 ggplot(aes(Interactor1Temp,OriginalTraitValue)) +
geom_point(col = "blue") +
geom_errorbar(aes(ymax = OriginalTraitValue+OriginalErrorPos,
ymin = OriginalTraitValue-OriginalErrorNeg), width = 1) +
theme_bw()
The same can be done when multiple datasets are retrieved. For this example we will use two datasets about fecundity (number of eggs per individual) at different temperatures.
<- get_datasets(c(71,111)) longevity_temp
Retrieving dataset: 71
Retrieving dataset: 111
<- do.call(rbind,lapply(longevity_temp, data.frame, stringsAsFactors=FALSE)) longevity_temp
Now we can display both datasets on the same plot:
%>%
longevity_temp mutate(DatasetID = factor(DatasetID)) %>%
ggplot(aes(Interactor1Temp, OriginalTraitValue, col = DatasetID)) +
geom_point() +
geom_errorbar(aes(ymax = OriginalTraitValue+OriginalErrorPos,
ymin = OriginalTraitValue-OriginalErrorNeg), width = 2) +
theme_bw()