Name: rls2dwc
Owner: Smithsonian Institution
Description: MarineGEO Reef Life Survey to Darwin Core R package
Created: 2018-03-16 16:23:46.0
Updated: 2018-03-16 16:27:36.0
Pushed: 2018-03-16 16:27:35.0
Homepage: null
Size: 800
Language: R
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Converts a Reef life Survey spreadsheet to a R data frame and aligns the terms with Darwin Core terminology. The functions convert the reef life survey observations to a long tidy format and validates scientific names against the World Register of Marine Species. Exports the reef life survey data into several tables including Event, Occurrence and MeasurementOrFact
all.packages("devtools")
ools::install_github("Smithsonian/rls2dwc")
Full example of processing a Reef Life Survey dataset
Loads a reef life survey excel datasheet as a R dataframe. Provide the path to the excel spreadsheet and the name of the tab that contains the data (usually called “DATA”). The function will load the spreadsheet, clean up the extra header info in the second row, combine the date and time field into one column, filter out empty data rows (Total=0), and add a source column using the filename provided.
ata <- readRLS('example_data.xlsx', 'DATA')
Extracts the location data (SiteID, SiteName, decimalLatitude, decimalLongitude) from a reef life survey data set
tions <- uniqueSites(rlsdata)
Validate the scientific names using WoRMs and joins the results back to the original data
fy_sciName(rlsdata, dryrun=TRUE) # verify all unique scientific names against worms and report ones that don't have matches
x the scientific names
ata <- replace_sciName(rlsdata, "Acanthurus sp", "Acanthurus") %>%
replace_sciName(rlsdata, "Scaridae sp.", "Scaridae") %>%
replace_sciName(rlsdata, "Abudefduf sp.", "Abudefduf")
rify scientific names again
verify_sciName(rlsdata, dryrun=FALSE) # non-matched names retained
Turns dataframe into a long format by gathering the abundances by size class.
thers observations into a long format (one size class per row)
ong <- gather_measures(v)
d unique IDs for the events and the occurrences
ong_ids <- makeIDs(RLSlong)
Generate the Event, Occurence and MeasurementOrFact tables.
t_table <- event(RLSlong_ids)
rence_table <- occurence(RLSlong_ids)
urementOrFact_table <- emof(RLSlong_ids)