# Summarize Data by Several Variables

[This article was first published on

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Here's an example how to conveniently summarize data with the cast function (package reshape). By the way you see how this could be done “in-conveniently” by hand. You also see how a for-loop works and how a matrix is constructed and filled. In addition this serves as an illustrative example how flexible “indexing” in R works, as seen in the below loop! (download data)(this example is adapted from https://stat.ethz.ch/pipermail/r-sig-ecology/2011-May/002174.html)**theBioBucket***, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Read more »

To

**leave a comment**for the author, please follow the link and comment on their blog:**theBioBucket***.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.