Last active
September 11, 2016 21:02
-
-
Save daranzolin/5f845b1ce401b5b48dc770a95eb9a963 to your computer and use it in GitHub Desktop.
Demonstration of how negative function arguments are coerced to class "call"
This file contains hidden or 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
| 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