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(a = 2, b = 10)                # Use function
# [1] 4

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed