Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append species information to RDBES data #141

Open
davidcurrie2001 opened this issue Oct 18, 2023 · 4 comments
Open

Append species information to RDBES data #141

davidcurrie2001 opened this issue Oct 18, 2023 · 4 comments
Labels
1_import_and_data_handling Import data from RDBES and general data handling (filter, merging, validation, ...)

Comments

@davidcurrie2001
Copy link
Contributor

Users find it difficult to understand aphia ids but these are the only mandatory species information available in the RDBES. Can we append useful species information such as scientific name/common name to our RDBES data.

@davidcurrie2001 davidcurrie2001 added the 1_import_and_data_handling Import data from RDBES and general data handling (filter, merging, validation, ...) label Oct 18, 2023
@KirstenBirchHaakansson
Copy link
Contributor

I think it would be relativity simple to add scientific name, but not so straight forward with common name / FAO.

So a function for adding species information and as a start scientific name

@davidcurrie2001
Copy link
Contributor Author

Related issues have been opened: #146 #147

@davidcurrie2001
Copy link
Contributor Author

Example of adding scientific name to SA using the ICES Worms code list:

# Load some RDBES data
myObject <- createRDBESDataObject(input = "./tests/testthat/h1_v_1_19_18")
# Append ICES specWorms code list to SA data
# (the "Description" column contains the scientific name)
saWithSpecWorms <- dplyr::left_join(myObject[["SA"]],
                                    RDBEScore::icesSpecWoRMS,
                                    by=c("SAspeCode"="Key"))

@davidcurrie2001
Copy link
Contributor Author

Example of adding scientific name to SA using the Aphia records from WoRMS:

# Load some RDBES data
myObject <- createRDBESDataObject(input = "./tests/testthat/h1_v_1_19_18")
aphiaRecords <- RDBEScore::wormsAphiaRecord
# Change the AphiaID to a char (so it is easier to join to the RDBES speCode field)
aphiaRecords$AphiaID <- as.character(aphiaRecords$AphiaID)
# Append ahpia records to SA data
# (the "scientificname" column contains the scientific name)
saWithAphiaID <- dplyr::left_join(myObject[["SA"]],
                                    aphiaRecords,
                                    by=c("SAspeCode"="AphiaID"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1_import_and_data_handling Import data from RDBES and general data handling (filter, merging, validation, ...)
Projects
None yet
Development

No branches or pull requests

2 participants