Skip to Content
R Programming Fundamentals
book

R Programming Fundamentals

by Kaelen Medeiros
September 2018
Beginner
206 pages
4h 27m
English
Packt Publishing
Content preview from R Programming Fundamentals

Activity: Implementing Data Summary

Scenario

You need to teach a coworker how to use apply functions. You write them a reproducible example using the mtcars dataset.

Aim

To summarize the variables in the mtcars data set using apply().

Prerequisites

Make sure you have R and RStudio installed on your machine. The datasets package should be installed.

Steps for Completion

  1. Load the mtcars dataset, if it currently isn't loaded in your R environment, and examine the data with str().
  2. Use apply() to summarize all of the variables in mtcars that are not categorical. Find the mean and variance of each.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Programming Fundamentals

R Programming Fundamentals

Samik Sen, Marcin Dubel
Python for Programmers

Python for Programmers

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781789612998Supplemental Content