COMM 205 2018W2 Lecture 20 - For Canvas.pptx - COMM 205 Introduction to Management Information Systems Instructor Adam Saunders Lecture 20 Data

COMM 205 2018W2 Lecture 20 - For Canvas.pptx - COMM 205...

This preview shows page 1 - 6 out of 20 pages.

COMM 205Introduction to Management Information SystemsInstructor: Adam SaundersLecture 20: Data Wrangling Part II March 18, 2019
Background image
LOAD THE TIDYVERSE LIBRARYBefore you start, make sure you have tidyverseloaded.To do so, first typelibrary(tidyverse)Then, load the data frame companies(the one we used in the previous lecture). COMM 205: Introduction to Management Information SystemsLecture 20: Data Wrangling Part II
Background image
DATA WRANGLINGData wrangling is defined as the process of transforming and mapping datafrom one raw data form into another, with the intent of making the data more useful (e.g., for analytics). In R, we will use the dplyrand magrittrpackages shipped with tidyverse. Since you have already installed tidyverse, go ahead and load it by entering library(tidyverse)in Rstudio.magrittroffers a set of operators which make your code more readable. COMM 205: Introduction to Management Information SystemsLecture 20: Data Wrangling Part II
Background image
DATA WRANGLINGAs indicated last lecture, dplyrprovides functions (in the form of verbs) that solve the most common data manipulation challenges. Below are some of the main dplyrfunctions:FunctionHow it worksselect()picks variables based on their namesfilter()picks observations based on their valuesmutate()adds new variables that are functions of existing variablessummarise()reduces multiple values to a summary statisticsarrange()changes the order of rowsgroup_by()allows a user to perform the above functions on a subset of the dataCOMM 205: Introduction to Management Information SystemsLecture 20: Data Wrangling Part II
Background image
USING YOUR FIRST R DATASETIn this course, we will be frequently using a dataset stored in the file North_American_Stock_Market_1994-2013.rdsThe dataset contains information on virtually all publicly traded firms in Canada and the United States from 1994 to 2013 (obtained from Compustat).
Background image
Image of page 6

You've reached the end of your free preview.

Want to read all 20 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes