How do you define a function in R?
a) function_name <- function()
b) function function_name()
c) def function_name()
d) func function_name()
Answer:
a) function_name <- function()
Explanation:
In R, a function is defined using the syntax function_name <- function()
, where function()
contains the function logic.