do.call & call Functions in R (3 Examples) | How to Execute a Function by Its Name | eval Expression
How to run a function using its name within the do.call and call functions in the R programming language. More details: https://statisticsglobe.com/do-call-and-call-functions-in-r/
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: https://www.facebook.com/statisticsglobecom/
Patreon: https://www.patreon.com/statisticsglobe
Pinterest: https://www.pinterest.de/JoachimSchork
Reddit: https://www.reddit.com/user/JoachimSchork
Twitter: https://twitter.com/JoachimSchork
Видео do.call & call Functions in R (3 Examples) | How to Execute a Function by Its Name | eval Expression канала Statistics Globe
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: https://www.facebook.com/statisticsglobecom/
Patreon: https://www.patreon.com/statisticsglobe
Pinterest: https://www.pinterest.de/JoachimSchork
Reddit: https://www.reddit.com/user/JoachimSchork
Twitter: https://twitter.com/JoachimSchork
Видео do.call & call Functions in R (3 Examples) | How to Execute a Function by Its Name | eval Expression канала Statistics Globe
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![3 Simple Tips to Avoid Overplotting in R #shorts #rstats #programming #ggplot2 #datavisualization](https://i.ytimg.com/vi/N6EJWDvaoA4/default.jpg)
![Calculate Mean by Group in Python (2 Examples) | Average of Subgroups | groupby() & mean() Functions](https://i.ytimg.com/vi/H4U_LTTeZ64/default.jpg)
![Difference Between data.frame & as.data.frame Functions in R (2 Examples) | Create & Convert Data](https://i.ytimg.com/vi/n1Y6yMsAz84/default.jpg)
![Log Transformation of Data Frame in R (Example) | Convert All Values & Columns | Apply log Function](https://i.ytimg.com/vi/pLX-Mn7-NcA/default.jpg)
![Sum of List Elements in R (2 Examples) | Calculate Within & Between | Reduce() & sapply() Function](https://i.ytimg.com/vi/O8L14CzaHkU/default.jpg)
![Introduction to the venn Package (6 Examples) | Draw Up to 7 Sets | Intersections, Labels & Colors](https://i.ytimg.com/vi/bgTEY_JYjoQ/default.jpg)
![Add Subscript & Superscript to Labels of ggplot2 Facet Plot in R | labeller Argument in facet_wrap](https://i.ytimg.com/vi/ADfmjgsqiiA/default.jpg)
![We Need to Talk About the Future of Statistics Globe on YouTube](https://i.ytimg.com/vi/hkjoDr8LDdc/default.jpg)
![na.omit Function in R (Example) | Listwise Deletion | Data Frame & Vector | Remove Incomplete Cases](https://i.ytimg.com/vi/r3Z-_coo5XU/default.jpg)
![Replace NaN by Empty String in pandas DataFrame in Python (Example) | Substitute by Blank Character](https://i.ytimg.com/vi/UFXzzQZ9hlE/default.jpg)
![Add Individual Text to Each Facet of ggplot2 Plot in R (Example) | annotate() & geom_text() Function](https://i.ytimg.com/vi/MTUU9LlAebM/default.jpg)
![Get Function Parameters as List in R (Example) | Save Arguments & Input | environment() Function](https://i.ytimg.com/vi/R5hFB7KZQSY/default.jpg)
![Extract Data Frame Rows that do not Match Logical Condition in R (Example) | Filter, Select & Subset](https://i.ytimg.com/vi/vG1qDtMeOdY/default.jpg)
![How to Convert a Factor to Numeric in R (Example Code) | Vector & Data Frame Column | Keep Numbers](https://i.ytimg.com/vi/m1SG2sNUjPo/default.jpg)
![Python INTEGER Trick (EASY Life) !! #shorts #python #integers #pythonprogramming #programming](https://i.ytimg.com/vi/djc5QT5Nq5s/default.jpg)
![Calculate Cartesian Product in R (2 Examples) | expand.grid() & crossing() Functions | tidyr Package](https://i.ytimg.com/vi/M-mC9KDhJK8/default.jpg)
![Best Generative AI DALL-E Prompts - Manga Comic Images! #AI #dalle #manga #anime #animeart #openai](https://i.ytimg.com/vi/Imn1-8vJ-4g/default.jpg)
![Extract Year and Month from yearmon Object in R | zoo & lubridate Packages | Using format() Function](https://i.ytimg.com/vi/eVZg1I-_MhE/default.jpg)
![Mean by Group in R (2 Examples) | dplyr Package vs. Base R | group_by() & summarise_at() Functions](https://i.ytimg.com/vi/huvKQ9YYEq4/default.jpg)
![Remove Rows with Non-Numeric Characters (Example) | Drop & Delete | as.numeric() & is.na() Functions](https://i.ytimg.com/vi/hEn_pnLddoA/default.jpg)
![Get End of Month for Certain Date in R (Examples) | ceiling_date() & timeLastDayInMonth() Functions](https://i.ytimg.com/vi/XLxxP0s5jJ8/default.jpg)