Get Function Parameters as List in R (Example) | Save Arguments & Input | environment() Function

preview_player
Показать описание
R code of this video:

my_fun1 <- function(input1, input2 = 5, ...) { # Create user-defined function

out <- input1 + input2
print(out)
}

my_fun1(input1 = 10) # Apply user-defined function

my_fun2 <- function(input1, input2 = 5, ...) { # Save parameters of user-defined function


out <- input1 + input2
print(out)
}

my_fun2(input1 = 10) # Apply user-defined function

my_parameters # Print parameters

my_fun2(input1 = 10, # Specify multiple arguments
input2 = 20,
input3 = "xxx")

my_parameters # Print parameters

Follow me on Social Media:

Рекомендации по теме