How to Apply the as.function() Function in R (Example Code)
In this R tutorial you’ll learn how to apply the as.function function.
Example: Applying as.function() Command to Create a Function
f <- as.function(alist(a = , # as.function & alist functions b = , c = 5, (a * b) / c)) |
f <- as.function(alist(a = , # as.function & alist functions b = , c = 5, (a * b) / c))
f(a = 2, b = 10) # Use function # [1] 4 |
f(a = 2, b = 10) # Use function # [1] 4