Skip to content

Commit

Permalink
Resolving the issue of sampling effort units. Added either Identified…
Browse files Browse the repository at this point in the history
… Samples or Individuals to the total sum of the units.

Removed the leading and trailing quotes in the `dynamicProperties` field.

All relating to issue #7.
  • Loading branch information
SimonGoring committed Dec 28, 2016
1 parent 524f9af commit b4fadbf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions functionalized_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ test_dwc_export <- function(x){
#institutionCode = NA, # I can't find the link here. . .
datasetName = paste0(query_out$SiteName, " ",
query_out$samplingProtocol, ' dataset'),
dynamicProperties = paste0('"{"estimatedSampleAge":', query_out$Age,',',
dynamicProperties = paste0('{"estimatedSampleAge":', query_out$Age,',',
'"latestSampleAge":', query_out$AgeOlder,',',
'"earliestSampleAge":', query_out$AgeYounger,',',
'"sampleAgeType":', query_out$AgeType,',',
'"sampleAgeDatum":','}"'),
'"sampleAgeDatum":','}'),
occurrenceID = paste0('Neotoma_occ_',
query_out$AnalysisUnitID, '-',
query_out$TaxonID),
Expand Down Expand Up @@ -369,7 +369,13 @@ test_dwc_export <- function(x){
# assign samplingEffort:
samp_eff <- sum(output$sampleSizeValue[which(output$collectionID == output$collectionID[i] &
output$sampleSizeUnit == output$sampleSizeUnit[i])])
output$samplingEffort[i] <- samp_eff

if (query_out$sampleSizeUnit == "Number of Identified Samples") {
output$samplingEffort[i] <- paste0(samp_eff, " Identified Samples")
}
if (query_out$sampleSizeUnit == "Minimum Number of Individuals") {
output$samplingEffort[i] <- paste0(samp_eff, " Individuals (Minimum)")
}
}

if (length(unique(query_out$SiteID)) == 1) {
Expand Down

0 comments on commit b4fadbf

Please sign in to comment.