R-Programming - Assignment 3 - Part 3

April 18, 2015

Report Abuse
This is assignment 3 part 3 for "Introduction to R Programming" course
This experiment creates a function called **rankall** that takes two arguments: an outcome name (outcome) and a hospital ranking(num). The function reads the outcome-of-care-measures.csv file and returns a 2-column data frame containing the hospital in each state that has the ranking specified in num. For example the function call rankall("heart attack", "best") will return a data frame containing the names of the hospitals that are the best in their respective states for 30-day heart attack death rates. The function returns a value for every state (some may be NA). This is part of [Introduction to R programming course](https://www.coursera.org/course/rprog) The experiment graph for this assignment is shown below. For this experiment, we uploaded dataset as zip file, created sample test input as part of enter module data, and finally wrote the function as a script in **Execute-R** module. ![](http://neerajkh.blob.core.windows.net/images/ass3part3_1.PNG) The following figure shows the hospital list and state for the hospital that has a specific rank for a specified outcome. ![](http://neerajkh.blob.core.windows.net/images/ass3part3_2.PNG)