Skip to content

Instantly share code, notes, and snippets.

@daranzolin
Last active September 11, 2016 21:02
Show Gist options
  • Save daranzolin/5f845b1ce401b5b48dc770a95eb9a963 to your computer and use it in GitHub Desktop.
Save daranzolin/5f845b1ce401b5b48dc770a95eb9a963 to your computer and use it in GitHub Desktop.
Demonstration of how negative function arguments are coerced to class "call"
check_negative_args_classes <- function(lon = NULL, lat = NULL) {
args <- as.list(match.call())
return(args)
}
l <- check_negative_args_classes(lon = 45, lat = -86.7)
lapply(l, class)
"""
Output:
[[1]]
[1] "name"
$lon
[1] "numeric"
$lat
[1] "call"
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment