VOOZH about

URL: https://www.geeksforgeeks.org/r-language/apply-a-function-over-a-ragged-array-in-r-programming-tapply-function/

⇱ Apply a Function over a Ragged Array in R Programming - tapply() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Apply a Function over a Ragged Array in R Programming - tapply() Function

Last Updated : 15 Jul, 2025
tapply() function in R Language is used to apply a function over a subset of vectors given by a combination of factors
Syntax: tapply(vector, factor, fun) Parameters: vector: Created Vector factor: Created Factor fun: Function to be applied
Example 1: Output:
 1 2 3 
10 18 17 
This is how above code works: 👁 Image
  Example 2: Output:
 1 2 3 
24 210 72 
Comment

Explore