Homework 3 Untitled January 3, 2019 This is the second homework assig.docx - Homework 3 Untitled January 3 2019 This is the second homework assignment

Homework 3 Untitled January 3, 2019 This is the second homework assig.docx

  • No School
  • AA 1
  • 3

This preview shows page 1 - 3 out of 3 pages.

Image of page 1

Subscribe to view the full document.

Homework 3 Untitled January 3, 2019 This is the second homework assignment for Intro to R. You must submit both the RMD and "knitted" HTML files are due before class on Friday (Day 5) Use this dataset on infant mortality for the following questions: http /johnmuschelli.com/intro_to_ridata/indicatordead kids35.csv you can add more, or change...these are suggestions library (tidyverse) library(readr) library(dplyr) library(ggplot2) library(tidyr) Questions 1. Read the data using read esv) and name it mort. Rename the first column to country using the rename () command in dplyr. Create an object year variable by extracting column names (using colnames () ) and make it to an integer as.integer () ), excluding the first column either with string manipulations or bracket subsetting or subsetting with is.na 2. Reshape the data so that there is a variable named year corresponding to year (key) and a column of the mortalities named mortality (value). Hint: use the tidyr package and its gather() function. Name the output long and make year a numeric variable. Hint remember that
Image of page 2
Image of page 3
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes