How to run a function using its name within the do.call and call functions in the R programming language. More details: statisticsglob...
R code of this video:
x1 <- 1:10 # Example vector
x1 # Print example vector
do.call("sum", list(x1)) # Apply do.call
sum(x1) # Comparison with conventional syntax
x2 <- c(x1, NA) # Example vector with NA
x2 # Print example vector
do.call("sum", list(x2)) # Basic application of do.call
do.call("sum", list(x2, na.rm = TRUE)) # Specify additional arguments
my_call <- call("sum", x2, na.rm = TRUE) # Applying call function
my_call # Return output of call function
eval(my_call) # Apply eval function to call object
Follow me on Social Media:
Facebook: / statisticsglobecom
Patreon: / statisticsglobe
Pinterest: www.pinterest....
Reddit: / joachimschork
Twitter: / joachimschork
Негізгі бет do.call & call Functions in R (3 Examples) | How to Execute a Function by Its Name | eval Expression
No video
Пікірлер: 15