#### Overview of this book

Data analytics with R has emerged as a very important focus for organizations of all kinds. R enables even those with only an intuitive grasp of the underlying concepts, without a deep mathematical background, to unleash powerful and detailed examinations of their data. This book will show you how you can put your data analysis skills in R to practical use, with recipes catering to the basic as well as advanced data analysis tasks. Right from acquiring your data and preparing it for analysis to the more complex data analysis techniques, the book will show you how you can implement each technique in the best possible manner. You will also visualize your data using the popular R packages like ggplot2 and gain hidden insights from it. Starting with implementing the basic data analysis concepts like handling your data to creating basic plots, you will master the more advanced data analysis techniques like performing cluster analysis, and generating effective analysis reports and visualizations. Throughout the book, you will get to know the common problems and obstacles you might encounter while implementing each of the data analysis techniques in R, with ways to overcoming them in the easiest possible way. By the end of this book, you will have all the knowledge you need to become an expert in data analysis with R, and put your skills to test in real-world scenarios.
Preface
Free Chapter
Acquire and Prepare the Ingredients - Your Data
Lessons from History - Time Series Analysis
How does it look? - Advanced data visualization
This may also interest you - Building Recommendations
Work Smarter, Not Harder - Efficient and Elegant R Code
Playing Nice - Connecting to Other Systems

# Processing entire rows or columns using the apply function

The apply function can apply a user-specified function to all the rows or columns of a matrix and return an appropriate collection with the results.

This recipe uses no external objects or resources.

# How to do it...

To process entire rows or columns using the apply function, follow these steps:

1. Calculate row minimums for the matrix:
```> m <- matrix(seq(1,16), 4, 4)
> m

[,1] [,2] [,3] [,4]
[1,]    1    5    9   13
[2,]    2    6   10   14
[3,]    3    7   11   15
[4,]    4   ...```