Answer Posted / Ashish Khare
sapply is a function from the base R package that applies a function to each element of an object (like a list or vector) and returns a simplified result. For example, sapply(c(1, 2, 3), function(x) x^2) will return a vector containing the squares of the numbers 1, 2, and 3.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers