Social Media Research

02 R Data Analysis


Question

What is the apply (...) function?


Answer

apply() is a R function which enables to make quick operations on matrix, vector or array. The operations can be done on the lines, the columns or even both of them.

Example: Execute a given function to the rows (index 1) or column (index 2)of a matrix or an array. [apply(x,2,sum].




Comments