Question:

There is a function fn(a, b, c, d, e) a + b * c - d / e. Write the code to call fn on the vector c(1,2,3,4,5) such that the output is same as fn(1,2,3,4,5).

Answer:

do.call (fn, as.list(c (1, 2, 3, 4, 5)))


Keywords:

© 2017 QuizBucket.org