Skip to content

Commit

Permalink
calculate depth
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterprovoost committed May 17, 2019
1 parent 7e49c68 commit 79a314f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: robis
Title: Ocean Biogeographic Information System (OBIS) Client
Description: Client for the Ocean Biogeographic Information System (<https://obis.org>).
Version: 2.1.3
Version: 2.1.4
Date: 2019-05-17
Authors@R: c(
person("Pieter", "Provoost", , "pieterprovoost@gmail.com", c("cre", "aut")),
Expand Down
7 changes: 7 additions & 0 deletions R/occurrence.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,12 @@ occurrence <- function(
}

data <- bind_rows(result_list)

depthFields <- intersect(c("minimumDepthInMeters", "maximumDepthInMeters"), names(data))
if (length(depthFields) > 0) {
data$depth <- rowMeans(data[depthFields], na.rm = TRUE)
data$depth[which(is.nan(data$depth))] <- NA
}

return(data)
}

0 comments on commit 79a314f

Please sign in to comment.