Explain how to create a function in arguments using apply() in r?
Answer Posted / Jyoti Rawat
apply(data, margin, my_function) - where data is the matrix or array you're working on, margin specifies which dimension to iterate over (1 for rows, 2 for columns), and my_function is your custom function.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers