Grokking the Behavioral Interview
Get Educative’s popular interview prep course for free.
list() function in R is used to create a list of elements of different types. A list can contain numeric, string, or vector elements.
list() function takes a parameter value
...indicating the R objects, which may or may not be named.
list() function returns a list that is composed of the arguments passed to it.
# creating Objects as arguments for the list functiona = c(1, 2, 3, 4, 5)b = c("A", "B", "C", "D", "E")c = c("A", "B", "c", "1", "2")# implementing the list() functionlist(a, b, c)
cthat will serve as the argument to the
list()function and passed the objects
cas its arguments. We print the result to the console.