YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Number of Purchases - Data Analysis with R

Get Embed Code
5 Languages

Showing Revision 2 created 05/25/2016 by Udacity Robot.

  1. For this programming assignment you needed to create the
  2. variable all purchases and add it to our Yo data
  3. frame. The transform function takes in a data frame and
  4. allows us to add different variables to it by recombining
  5. variables that are already within the data frame. So
  6. here I'll create the variable All Purchases and then I'll
  7. set it equal to the sum of all the yogurt
  8. flavors strawberry, blueberry, pina colda, plain, and mixed berry. When
  9. I run the code, I can see that my number of variables
  10. changed. And, just to be sure, I can print a summary of
  11. this variable as well. You might have also used this code. This
  12. code is fine, it's just a bit more verbose than we need.