do.call & call Functions in R (3 Examples) | How to Execute a Function by Its Name | eval Expression

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

x1 <- 1:10 # Example vector
x1 # Print example vector

sum(x1) # Comparison with conventional syntax

x2 <- c(x1, NA) # Example vector with NA
x2 # Print example vector

my_call # Return output of call function

eval(my_call) # Apply eval function to call object

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

First time I am introduced to the Eval function, thank you, Joachim!!

agsoutas
Автор

Why does the na.rm = TRUE go inside the list function on line 14? Should it not be the third argument for the do.call function? Thanks!

idmanic
Автор

Hallow. Good evening
I would like to ask you about turning the class of the expression to function.

Kind regards

ahmadalarfaj
Автор

R has thousands of built-in commands and functions. Do you know (perhaps there is a list or study somewhere) what the top most used commands/functions are? For instance which are essential for teaching beginners - e.g. top 20 - to get them started? I am asking from the perspective of someone getting ready to teach a class using R on a university level (grad students and possibly upper-level undergraduates in the physical sciences).

haraldurkarlsson
Автор

Thanks for this informative video! Why do people use this do.call() function? It just seems more complicated than just using the function without the do.call. I don't understand the benefit!

cristianriccio