Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce17363
commit 5910f3c
Showing
39 changed files
with
2,314 additions
and
1,641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Extract measurements or facts from occurrence data with a mof column. | ||
#' | ||
#' @usage measurements(df, fields = c("id")) | ||
#' @param df the occurrence dataframe. | ||
#' @param fields columns from the occurrence dataframe to include. | ||
#' @return The measurements. | ||
#' @export | ||
measurements <- function(df, fields = c("id")) { | ||
if ("id" %in% names(df) & "mof" %in% names(df)) { | ||
if (class(df$mof) == "list") { | ||
return(unnest(df %>% select(c(fields, "mof")), cols = "mof")) | ||
} else { | ||
return(data.frame()) | ||
} | ||
} else { | ||
warning("Missing columns id or mof") | ||
return(NULL) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.