-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from Plant-Functional-Trait-Course/next_version
Next version
- Loading branch information
Showing
29 changed files
with
775 additions
and
260 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' check the items inside `flux_fun_check` | ||
#' @param arg argument to be checked by `fn` | ||
#' @param fn function to check `arg` | ||
#' @param msg message to display in case `arg` is the wrong class | ||
#' @param narg name of `arg` | ||
#' @param df_name name of `arg` in case it is a data frame | ||
#' @author Adam Klimes | ||
|
||
|
||
flux_check_item <- function(arg, | ||
fn, | ||
msg, | ||
narg, | ||
df_name = NA) { | ||
isok <- fn(arg) | ||
if (!isok) { | ||
msg_parts <- if (!is.na(df_name)) | ||
c("Column ", paste0(" of data frame ", df_name, " ")) | ||
else c("Argument ", " ") | ||
message(paste0(msg_parts[1], narg, msg_parts[2], msg)) | ||
FALSE | ||
} else { | ||
TRUE | ||
} | ||
} |
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
Oops, something went wrong.