R For Dummies by Meys Joris & de Vries Andrie

R For Dummies by Meys Joris & de Vries Andrie

Author:Meys, Joris & de Vries, Andrie [Meys, Joris]
Language: eng
Format: epub
Publisher: John Wiley and Sons
Published: 2012-06-05T22:00:00+00:00


Applying functions on rows and columns

In Chapter 7, you calculate the sum of a matrix with the rowSums() function. You can do the same for means with the rowMeans() function, and you have the related functions colSums() and colMeans() to calculate the sum and the mean for each column. But R doesn’t have similar functions for every operation you want to carry out. Luckily, you can use the apply() function to apply a function over every row or column of a matrix or data frame.

Counting birds



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.