Programming Assignment 3: Hospital Quality

My code repository for coursera data science specialization by john hopkins university, assignment instructions.

The data for this assignment come from the Hospital Compare web site (http://hospitalcompare.hhs.gov) run by the U.S. Department of Health and Human Services. The purpose of the web site is to provide data and information about the quality of care at over 4,000 Medicare-certified hospitals in the U.S. This dataset es- sentially covers all major U.S. hospitals. This dataset is used for a variety of purposes, including determining whether hospitals should be fined for not providing high quality care to patients (see http://goo.gl/jAXFX for some background on this particular topic).

The Hospital Compare web site contains a lot of data and we will only look at a small subset for this assignment. The zip file for this assignment contains three files

  • outcome-of-care-measures.csv: Contains information about 30-day mortality and readmission rates for heart attacks, heart failure, and pneumonia for over 4,000 hospitals.
  • hospital-data.csv: Contains information about each hospital.
  • Hospital_Revised_Flatfiles.pdf: Descriptions of the variables in each file (i.e the code book).

A description of the variables in each of the files is in the included PDF file named Hospital_Revised_Flatfiles.pdf. This document contains information about many other files that are not included with this programming assignment. You will want to focus on the variables for Number 19 (“Outcome of Care Measures.csv”) and Number 11 (“Hospital Data.csv”). You may find it useful to print out this document (at least the pages for Tables 19 and 11) to have next to you while you work on this assignment. In particular, the numbers of the variables for each table indicate column indices in each table (i.e. “Hospital Name” is column 2 in the outcome-of-care-measures.csv file)

More information about the assignment here

Data zip file - link

1 Plot the 30-day mortality rates for heart attack - outcome.R

histogram for heart attack

2 Finding the best hospital in a state - best.R

Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specified outcome in that state. The hospital name is the name provided in the Hospital.Name variable. The outcomes can be one of “heart attack”, “heart failure”, or “pneumonia”. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

3 Ranking hospitals by outcome in a state - rankhospital.R

Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a state (state), an outcome (outcome), and the ranking of a hospital in that state for that outcome (num). The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the ranking specified by the num argument. For example, the call rankhospital(“MD”, “heart failure”, 5) would return a character vector containing the name of the hospital with the 5th lowest 30-day death rate for heart failure. The num argument can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

4 Ranking hospitals in all states - rankall.R

Write 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”) would 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 should return a value for every state (some may be NA). The first column in the data frame is named hospital, which contains the hospital name, and the second column is named state, which contains the 2-character abbreviation for the state name. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

R programming Assignment 3 week 4

Course 2 r programming, assignment 3 (week 4), under data science by johns hopkins university, 1 plot the 30-day mortality rates for heart attack, 3 ranking hospitals by outcome in a state, 4 ranking hospitals in all states.

R Programming

Getting started.

  • Resources for R Programming
  • References for R Programming
  • Data Science Specialization Value Proposition
  • R Onboarding for SAS Users

Programming Assignments

  • Strategy for Coding the Programming Assignments
  • Tutorial for those struggling with Programming Assignment 1
  • Breaking Down pollutantmean
  • Assignment 1: A More Elegant Solution
  • A SAS Version of pollutantmean?
  • Tutorial for those struggling with Programming Assignment 2
  • Tutorial for those struggling with Programming Assignment 3
  • PA1-test: testthat , Unit Tests for Programming Assignment 1
  • PA3-test: testthat , Unit Tests for Programming Assignment 3
  • Alternative submit script for Programming Assignment 1 that makes submitting more convenient by allowing selection of multiple parts plus prompting if user wants to submit another part before exiting
  • Grading the SHA-1 Hash Code
  • Assignment 2: Demystifying makeVector
  • Assignment 2: makeCacheMatrix as an Object
  • Some notes on the R Language
  • A Data Frame is Also a List
  • S Objects, R Objects, and Lexical Scoping
  • Common R Mistakes: Overwriting Functions with Data Objects
  • Forms of the Extract Operator
  • Functions to Sort Data Frames
  • Creative Use of R: Downloading Course Lectures Article illustrating how to use R to automate the download of lectures from Data Science Specialization courses, such as R Programming . Techniques used in this article are helpful to make research reproducible, as required for courses like Getting and Cleaning Data and Reproducible Research .
  • Lexical Scoping and Statistical Computing Article by Robert Gentleman and Ross Ihaka at the University of Auckland describing how lexical scoping works, and why it is valuable in statistical computing.
  • Data Science Job Report 2017: R Passes SAS, But Python Leaves Them Both Behind Bob Muenchen’s take on the job market for various data science langauges.

R language cheatsheet

  • R cheatsheet covering all lectures

R and Commercial Statistics Packages

  • R Onboarding for SAS Users Provides an overview and links to a variety of resources to help people with SAS experience make the transition to R
  • Commercial Statistics Packages: An Historical Perspective
  • Why is R More Difficult than SAS?
  • Thinking in R versus Thinking in SAS

Comprehensive Notes

  • Complete notes for R Programming

Instantly share code, notes, and snippets.

@kfeoktistoff

kfeoktistoff / best.R

  • Star 2 You must be signed in to star a gist
  • Fork 26 You must be signed in to fork a gist
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.
  • Learn more about clone URLs

@Cosmin11

Cosmin11 commented Mar 21, 2015

best <- function(state, outcome ) {

Read outcome data----------------------------------------

Error msg for outcomes-----------------------------------, error msg for state--------------------------------------, create data frame with hosp., state, h. attack, h. failure & pneumonia-----, replace 'not available with na---------------------------------------------, find minimum value of the outcome--------------------------------------------, display all hospitals with the minimum dead rate-----------------------------, display result in alphabetical ordered------------------------------------------, display first value from the result vector-------------------------------------.

Sorry, something went wrong.

@bbrewington

bbrewington commented Jul 10, 2015

You should take this down, since you're enabling other people to copy it and cheat. Also, this goes against the Coursera Honor Code (link: https://www.coursera.org/about/terms/honorcode )

It says "I will not make solutions to homework, quizzes, exams, projects, and other assignments available to anyone else (except to the extent an assignment explicitly permits sharing solutions). This includes both solutions written by me, as well as any solutions provided by the course staff or others."

@rahul351987

rahul351987 commented Feb 15, 2016

Good one but calling functions in other codes makes it difficult plus time consuming!

R Programming Assignment 3: Hospital Quality

Introduction.

Download the file ProgAssignment3-data.zip file containing the data for Programming Assignment 3 from the Coursera web site. Unzip the file in a directory that will serve as your working directory. When you start up R make sure to change your working directory to the directory where you unzipped the data.

The data for this assignment come from the Hospital Compare web site ( http://hospitalcompare.hhs.gov ) run by the U.S. Department of Health and Human Services. The purpose of the web site is to provide data and information about the quality of care at over 4,000 Medicare-certified hospitals in the U.S. This dataset essentially covers all major U.S. hospitals. This dataset is used for a variety of purposes, including determining whether hospitals should be fined for not providing high quality care to patients (see http://goo.gl/jAXFX for some background on this particular topic).

The Hospital Compare web site contains a lot of data and we will only look at a small subset for this assignment. The zip file for this assignment contains three files:

  • outcome-of-care-measures.csv : Contains information about 30-day mortality and readmission rates for heart attacks, heart failure, and pneumonia for over 4,000 hospitals.
  • hospital-data.csv : Contains information about each hospital.
  • Hospital_Revised_Flatfiles.pdf : Descriptions of the variables in each file (i.e the code book).

A description of the variables in each of the files is in the included PDF file named Hospital_Revised_Flatfiles.pdf . This document contains information about many other files that are not included with this programming assignment. You will want to focus on the variables for Number 19 (“Outcome of Care Measures.csv”) and Number 11 (“Hospital Data.csv”). You may find it useful to print out this document (at least the pages for Tables 19 and 11) to have next to you while you work on this assignment. In particular, the numbers of the variables for each table indicate column indices in each table (i.e. “Hospital Name” is column 2 in the outcome-of-care-measures.csv file).

Part 1: Plot the 30-day mortality rates for heart attack

Read the outcome data into R via the read.csv function and look at the first few rows.

There are many columns in this dataset. You can see how many by typing ncol(outcome) (you can see the number of rows with the nrow function). In addition, you can see the names of each column by typing names(outcome) (the names are also in the PDF document).

To make a simple histogram of the 30-day death rates from heart attack (column 11 in the outcome dataset), run

Because we originally read the data in as character (by specifying colClasses = “character” we need to coerce the column to be numeric. You may get a warning about NAs being introduced but that is okay.

There is nothing to submit for this part.

Part 2: Finding the best hospital in a state

Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specified outcome in that state. The hospital name is the name provided in the Hospital.Name variable. The outcomes can be one of “heart attack”, “heart failure”, or “pneumonia”. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Handling ties. If there is a tie for the best hospital for a given outcome, then the hospital names should be sorted in alphabetical order and the first hospital in that set should be chosen (i.e. if hospitals “b”, “c”, and “f” are tied for best, then hospital “b” should be returned).

The function should use the following template.

The function should check the validity of its arguments. If an invalid state value is passed to best , the function should throw an error via the stop function with the exact message “invalid state”. If an invalid outcome value is passed to best , the function should throw an error via the stop function with the exact message “invalid outcome”.

Here is some sample output from the function.

Save your code for this function to a file named best.R .

Part 3: Ranking hospitals by outcome in a state

Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a state ( state ), an outcome ( outcome ), and the ranking of a hospital in that state for that outcome ( num ). The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the ranking specified by the num argument. For example, the call

would return a character vector containing the name of the hospital with the 5th lowest 30-day death rate for heart failure. The num argument can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA . Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Handling ties . It may occur that multiple hospitals have the same 30-day mortality rate for a given cause of death. In those cases ties should be broken by using the hospital name. For example, in Texas (“TX”), the hospitals with lowest 30-day mortality rate for heart failure are shown here.

Note that Cypress Fairbanks Medical Center and Detar Hospital Navarro both have the same 30-day rate (8.7). However, because Cypress comes before Detar alphabetically, Cypress is ranked number 3 in this scheme and Detar is ranked number 4. One can use the order function to sort multiple vectors in this manner (i.e. where one vector is used to break ties in another vector).

The function should check the validity of its arguments. If an invalid state value is passed to rankhospital , the function should throw an error via the stop function with the exact message “invalid state”. If an invalid outcome value is passed to rankhospital , the function should throw an error via the stop function with the exact message “invalid outcome”.

Save your code for this function to a file named rankhospital.R .

Part 4: Ranking hospitals in all states

Write 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”) would 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 should return a value for every state (some may be NA ). The first column in the data frame is named hospital , which contains the hospital name, and the second column is named state , which contains the 2-character abbreviation for the state name. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Handling ties . The rankall function should handle ties in the 30-day mortality rates in the same way that the rankhospital function handles ties.

NOTE : For the purpose of this part of the assignment (and for efficiency), your function should NOT call the rankhospital function from the previous section.

The function should check the validity of its arguments. If an invalid outcome value is passed to rankall , the function should throw an error via the stop function with the exact message “invalid outcome”. The num variable can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA .

Save your code for this function to a file named rankall.R .

My Solution

A good tutorial.

Link: https://github.com/DanieleP/PA3-tutorial

xmuxiaomo

  • 1. Introduction
  • 2. Part 1: Plot the 30-day mortality rates for heart attack
  • 3. Part 2: Finding the best hospital in a state
  • 4. Part 3: Ranking hospitals by outcome in a state
  • 5. Part 4: Ranking hospitals in all states
  • 6. My Solution
  • 8. A Good Tutorial

r programming assignment 3

Secure Your Spot in Our R Programming Online Course - Register Until Nov. 27 (Click for More Info)

Joachim Schork Image Course

Assignment Operators in R (3 Examples) | Comparing = vs. <- vs. <<-

On this page you’ll learn how to apply the different assignment operators in the R programming language .

The content of the article is structured as follows:

Let’s dive right into the exemplifying R syntax!

Example 1: Why You Should Use <- Instead of = in R

Generally speaking, there is a preference in the R programming community to use an arrow (i.e. <-) instead of an equal sign (i.e. =) for assignment.

In my opinion, it makes a lot of sense to stick to this convention to produce scripts that are easy to read for other R programmers.

However, you should also take care about the spacing when assigning in R. False spacing can even lead to error messages .

For instance, the following R code checks whether x is smaller than minus five due to the false blank between < and -:

A properly working assignment could look as follows:

However, this code is hard to read, since the missing space makes it difficult to differentiate between the different symbols and numbers.

In my opinion, the best way to assign in R is to put a blank before and after the assignment arrow:

As mentioned before, the difference between <- and = is mainly due to programming style . However, the following R code using an equal sign would also work:

In the following example, I’ll show a situation where <- and = do not lead to the same result. So keep on reading!

Example 2: When <- is Really Different Compared to =

In this Example, I’ll illustrate some substantial differences between assignment arrows and equal signs.

Let’s assume that we want to compute the mean of a vector ranging from 1 to 5. Then, we could use the following R code:

However, if we want to have a look at the vector x that we have used within the mean function, we get an error message:

Let’s compare this to exactly the same R code but with assignment arrow instead of an equal sign:

The output of the mean function is the same. However, the assignment arrow also stored the values in a new data object x:

This example shows a meaningful difference between = and <-. While the equal sign doesn’t store the used values outside of a function, the assignment arrow saves them in a new data object that can be used outside the function.

Example 3: The Difference Between <- and <<-

So far, we have only compared <- and =. However, there is another assignment method we have to discuss: The double assignment arrow <<- (also called scoping assignment).

The following code illustrates the difference between <- and <<- in R. This difference mainly gets visible when applying user-defined functions .

Let’s manually create a function that contains a single assignment arrow:

Now, let’s apply this function in R:

The data object x_fun1, to which we have assigned the value 5 within the function, does not exist:

Let’s do the same with a double assignment arrow:

Let’s apply the function:

And now let’s return the data object x_fun2:

As you can see based on the previous output of the RStudio console, the assignment via <<- saved the data object in the global environment outside of the user-defined function.

Video & Further Resources

I have recently released a video on my YouTube channel , which explains the R syntax of this tutorial. You can find the video below:

The YouTube video will be added soon.

In addition to the video, I can recommend to have a look at the other articles on this website.

  • R Programming Examples

In summary: You learned on this page how to use assignment operators in the R programming language. If you have further questions, please let me know in the comments.

assignment-operators-in-r How to use different assignment operators in R – 3 R programming examples – R programming language tutorial – Actionable R programming syntax in RStudio

Subscribe to the Statistics Globe Newsletter

Get regular updates on the latest tutorials, offers & news at Statistics Globe. I hate spam & you may opt out anytime: Privacy Policy .

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Post Comment

Joachim Schork Statistician Programmer

I’m Joachim Schork. On this website, I provide statistics tutorials as well as code in Python and R programming.

Statistics Globe Newsletter

Get regular updates on the latest tutorials, offers & news at Statistics Globe. I hate spam & you may opt out anytime: Privacy Policy .

Related Tutorials

Haversine Great Circle Distance in R (Example)

Haversine Great Circle Distance in R (Example)

match.call Function in R (Example)

match.call Function in R (Example)

Popular Tutorials

Popular examples, learn python interactively, r introduction.

  • R Reserved Words
  • R Variables and Constants

R Operators

  • R Operator Precedence and Associativitys

R Flow Control

  • R if…else Statement

R ifelse() Function

  • R while Loop
  • R break and next Statement
  • R repeat loop
  • R Functions
  • R Return Value from Function
  • R Environment and Scope
  • R Recursive Function

R Infix Operator

  • R switch() Function

R Data Structures

  • R Data Frame

R Object & Class

  • R Classes and Objects
  • R Reference Class

R Graphs & Charts

  • R Histograms
  • R Pie Chart
  • R Strip Chart

R Advanced Topics

  • R Plot Function
  • R Multiple Plots
  • Saving a Plot in R
  • R Plot Color

Related Topics

R Operator Precedence and Associativity

R Program to Add Two Vectors

In this article, you will learn about different R operators with the help of examples.

R has many operators to carry out different mathematical and logical operations. Operators perform tasks including arithmetic, logical and bitwise operations.

  • Type of operators in R

Operators in R can mainly be classified into the following categories:

  • Arithmetic Operators
  • Relational Operators
  • Logical Operators
  • Assignment Operators
  • R Arithmetic Operators

These operators are used to carry out mathematical operations like addition and multiplication. Here is a list of arithmetic operators available in R.

Let's look at an example illustrating the use of the above operators:

  • R Relational Operators

Relational operators are used to compare between values. Here is a list of relational operators available in R.

Let's see an example for this:

  • Operation on Vectors

The above mentioned operators work on vectors . The variables used above were in fact single element vectors.

We can use the function c() (as in concatenate) to make vectors in R.

All operations are carried out in element-wise fashion. Here is an example.

When there is a mismatch in length (number of elements) of operand vectors, the elements in the shorter one are recycled in a cyclic manner to match the length of the longer one.

R will issue a warning if the length of the longer vector is not an integral multiple of the shorter vector.

  • R Logical Operators

Logical operators are used to carry out Boolean operations like AND , OR etc.

Operators & and | perform element-wise operation producing result having length of the longer operand.

But && and || examines only the first element of the operands resulting in a single length logical vector.

Zero is considered FALSE and non-zero numbers are taken as TRUE . Let's see an example for this:

  • R Assignment Operators

These operators are used to assign values to variables.

The operators <- and = can be used, almost interchangeably, to assign to variables in the same environment.

The <<- operator is used for assigning to variables in the parent environments (more like global assignments). The rightward assignments, although available, are rarely used.

Check out these examples to learn more:

  • Add Two Vectors
  • Take Input From User
  • R Multiplication Table

Table of Contents

  • Introduction

Sorry about that.

R Tutorials

Programming

r programming assignment 3

UC Business Analytics R Programming Guide

Assignment & evaluation.

The first operator you’ll run into is the assignment operator. The assignment operator is used to assign a value. For instance we can assign the value 3 to the variable x using the <- assignment operator. We can then evaluate the variable by simply typing x at the command line which will return the value of x . Note that prior to the value returned you’ll see ## [1] in the command line. This simply implies that the output returned is the first output. Note that you can type any comments in your code by preceding the comment with the hashtag ( # ) symbol. Any values, symbols, and texts following # will not be evaluated.

Interestingly, R actually allows for five assignment operators:

The original assignment operator in R was <- and has continued to be the preferred among R users. The = assignment operator was added in 2001 primarily because it is the accepted assignment operator in many other languages and beginners to R coming from other languages were so prone to use it. However, R uses = to associate function arguments with values (i.e. f(x = 3) explicitly means to call function f and set the argument x to 3. Consequently, most R programmers prefer to keep = reserved for argument association and use <- for assignment.

The operators <<- is normally only used in functions which we will not get into the details. And the rightward assignment operators perform the same as their leftward counterparts, they just assign the value in an opposite direction.

Overwhelmed yet? Don’t be. This is just meant to show you that there are options and you will likely come across them sooner or later. My suggestion is to stick with the tried and true <- operator. This is the most conventional assignment operator used and is what you will find in all the base R source code…which means it should be good enough for you.

Lastly, note that R is a case sensitive programming language. Meaning all variables, functions, and objects must be called by their exact spelling:

Programming Assignment 3: Quiz >> R Programming

1. What result is returned by the following code?

  • CAROLINAS HOSPITAL SYSTEM
  • MCLEOD MEDICAL CENTER – DARLINGTON
  • MUSC MEDICAL CENTER
  • MARY BLACK MEMORIAL HOSPITAL
  • LAKE CITY COMMUNITY HOSPITAL
  • GRAND STRAND REG MED CENTER

2. What result is returned by the following code?

  • MAIMONIDES MEDICAL CENTER
  • NORTHERN DUTCHESS HOSPITAL
  • HOSPITAL FOR SPECIAL SURGERY
  • KINGSBROOK JEWISH MEDICAL CENTER
  • BROOKS MEMORIAL HOSPITAL
  • CROUSE HOSPITAL

3. What result is returned by the following code?

  • PROVIDENCE ALASKA MEDICAL CENTER
  • ALASKA NATIVE MEDICAL CENTER
  • YUKON KUSKOKWIM DELTA REG HOSPITAL
  • CENTRAL PENINSULA GENERAL HOSPITAL
  • CORDOVA COMMUNITY MEDICAL CENTER
  • MT EDGECUMBE HOSPITAL

4. What result is returned by the following code?

  • CATAWBA VALLEY MEDICAL CENTER
  • WAYNE MEMORIAL HOSPITAL
  • WAKEMED, CARY HOSPITAL
  • SPRUCE PINE COMMUNITY HOSPITAL
  • CAROLINAS MEDICAL CENTER-NORTHEAST
  • THOMASVILLE MEDICAL CENTER

5. What result is returned by the following code?

  • YAKIMA VALLEY MEMORIAL HOSPITAL
  • KENNEWICK GENERAL HOSPITAL
  • ST ANTHONY HOSPITAL
  • KADLEC REGIONAL MEDICAL CENTER
  • JEFFERSON HEALTHCARE HOSPITAL
  • TACOMA GENERAL ALLENMORE HOSPITAL

6. What result is returned by the following code?

  • WEST HOUSTON MEDICAL CENTER
  • SETON SMITHVILLE REGIONAL HOSPITAL
  • MEMORIAL HERMANN NORTHEAST
  • PROVIDENCE MEMORIAL HOSPITAL
  • UNIVERSITY OF TEXAS HEALTH SCIENCE CENTER AT TYLER
  • SCENIC MOUNTAIN MEDICAL CENTER

7. What result is returned by the following code?

  • FOREST HILLS HOSPITAL
  • NASSAU UNIVERSITY MEDICAL CENTER
  • BELLEVUE HOSPITAL CENTER
  • UNIVERSITY HOSPITAL S U N Y HEALTH SCIENCE CENTER
  • FLUSHING HOSPITAL MEDICAL CENTER
  • ADIRONDACK MEDICAL CENTER

8. What result is returned by the following code?

  • NORTH COUNTRY HOSPITAL AND HEALTH CENTER
  • CASTLE MEDICAL CENTER
  • SANFORD USD MEDICAL CENTER
  • ST FRANCIS MEDICAL CENTER
  • PARKLAND HEALTH AND HOSPITAL SYSTEM
  • CLARK REGIONAL MEDICAL CENTER

9. What result is returned by the following code?

  • POTTSTOWN MEMORIAL MEDICAL CENTER
  • BERGEN REGIONAL MEDICAL CENTER
  • LAURENS COUNTY HEALTHCARE SYSTEM
  • TERREBONNE GENERAL MEDICAL CENTER
  • BAY AREA HOSPITAL
  • LAKES REGION GENERAL HOSPITAL

10. What result is returned by the following code?

  • HAWAII MEDICAL CENTER EAST
  • RENOWN SOUTH MEADOWS MEDICAL CENTER
  • CARY MEDICAL CENTER
  • CARONDELET ST JOSEPHS HOSPITAL
  • YORK GENERAL HOSPITAL

Related Questions & Answers:

  • Week 1 Quiz >> R Programming Week 1 Quiz >> R Programming 1. R was developed by statisticians working at Microsoft Johns Hopkins University The University ... Read more...
  • Week 2 Quiz >> R Programming Week 2 Quiz >> R Programming 1. Suppose I define the following function in R cube <- function(x, n) {         ... Read more...
  • Week 3 Quiz >> R Programming Week 3 Quiz >> R Programming 1. Take a look at the ‘iris’ dataset that comes with R. The data ... Read more...
  • Week 4 Quiz >> R Programming Week 4 Quiz >> R Programming 1. What is produced at the end of this snippet of R code? set.seed(1) ... Read more...
  • Programming Assignment 1: Quiz >> R Programming Programming Assignment 1: Quiz >> R Programming 1. What value is returned by the following call to pollutantmean()? You should ... Read more...
  • Graded Quiz: Functions, Sub-Queries, Multiple Tables Graded Quiz: Functions, Sub-Queries, Multiple Tables >> Databases and SQL for Data Science with Python 1.Which of the following queries ... Read more...

Leave a Comment Cancel reply

Save my name, email, and website in this browser for the next time I comment.

Please Enable JavaScript in your Browser to Visit this Site.

  • R Programming - Week 3 Assignment
  • by Ken Wood
  • Last updated over 3 years ago
  • Hide Comments (–) Share Hide Toolbars

Twitter Facebook Google+

Or copy & paste this link into an email or IM:

IMAGES

  1. Coursers R programming week 3 Assignment Submission and Program

    r programming assignment 3

  2. R assignment #3 video

    r programming assignment 3

  3. GitHub

    r programming assignment 3

  4. R-Programming

    r programming assignment 3

  5. R programming assignment 3.pdf

    r programming assignment 3

  6. Comparison Operators in R Programming

    r programming assignment 3

VIDEO

  1. 6. Week

  2. introduction to R programming 🔥|Rstudio| chandrakant

  3. R-Programing Part 9

  4. 8 Uses Of R Programming Language In 2024/@calltutors7362

  5. NPTEL Programming, Data Structures and Algorithms using Python Programming Assignment 3 July-2023

  6. Why R Programming is better (For me) ?

COMMENTS

  1. nishantsbi/R-Programming-Assignment-3

    R-Programming-Assignment-3 for coursera assignment Programming Assignment 3: Instructions Help Introduction This fourth programming assignment will be graded via a submit script which is described below.

  2. R Programming Programming Assignment 3 (Week 4) John Hopkins Data

    R Programming Project 3 github repo for rest of specialization: Data Science Coursera The zip file containing the data can be downloaded here: Assignment 3 Data Part 1 Plot the 30-day mortality rates for heart attack ( outcome.R)

  3. Coursers R programming week 3 Assignment Submission and Program

    This video contains the code for programming assignment-3 and the step by step instructions for submission of assignment which includes forking, cloning repo...

  4. Programming Assignment 3: Hospital Quality

    4 Ranking hospitals in all states - rankall.R Write 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.

  5. R programming Assignment 3 week 4

    8/21/2017 Course 2 R Programming, Assignment 3 (Week 4), under Data Science by Johns Hopkins University 1 Plot the 30-day mortality rates for heart attack

  6. RPubs

    R Pubs by RStudio. Sign in Register Programming Assignment 3 - R Programming; by Wagner Pinheiro; Last updated about 7 years ago; Hide Comments (-) Share Hide Toolbars

  7. R Programming Course (Johns Hopkins)

    Welcome to Week 2 of R Programming. This week, we take the gloves off, and the lectures cover key topics like control structures and functions. We also introduce the first programming assignment for the course, which is due at the end of the week.

  8. R Programming

    Tutorial for those struggling with Programming Assignment 3; PA1-test: testthat, Unit Tests for Programming Assignment 1; PA3-test: testthat, Unit Tests for Programming Assignment 3; Alternative submit script for Programming Assignment 1 that makes submitting more convenient by allowing selection of multiple parts plus prompting if user wants ...

  9. Programming assignment 3 for Coursera "R Programming" course ...

    Programming assignment 3 for Coursera "R Programming" course by Johns Hopkins University Raw best.R best <- function (state, outcome) { ## Read outcome data ## Check that state and outcome are valid ## Return hospital name in that state with lowest 30-day death ## rate source ("sortHospitalsByOutcome.R")

  10. R Programming Assignment 3: Hospital Quality

    R Programming Assignment 3: Hospital Quality // 小默的博客 1. Introduction 2. Part 1: Plot the 30-day mortality rates for heart attack 3. Part 2: Finding the best hospital in a state 4. Part 3: Ranking hospitals by outcome in a state 5. Part 4: Ranking hospitals in all states 6. My Solution 7. Results 8. A Good Tutorial 匆忙世间的闲人。

  11. Assignment Operators in R (3 Examples)

    Assignment Operators in R (3 Examples) | Comparing = vs. <- vs. <<- On this page you'll learn how to apply the different assignment operators in the R programming language. The content of the article is structured as follows: 1) Example 1: Why You Should Use <- Instead of = in R 2) Example 2: When <- is Really Different Compared to =

  12. R Operators (With Examples)

    We can use the function c () (as in concatenate) to make vectors in R. All operations are carried out in element-wise fashion. Here is an example. x <- c (2, 8, 3) y <- c (6, 4, 1) x + y x > y. Output. [1] 8 12 4 [1] FALSE TRUE TRUE. When there is a mismatch in length (number of elements) of operand vectors, the elements in the shorter one are ...

  13. RPubs

    R Pubs by RStudio. Sign in Register [Programming Assignment 3] R Programming; by Anderson Hitoshi Uyekita; Last updated over 1 year ago; Hide Comments (-) Share Hide Toolbars

  14. PDF GitHub: Let's build from here · GitHub

    {"payload":{"allShortcutsEnabled":false,"fileTree":{"R-Programming/Week-4":{"items":[{"name":"img","path":"R-Programming/Week-4/img","contentType":"directory"},{"name ...

  15. R Programming

    7 programming assignments • Total 1,260 minutes. swirl Lesson 1: Basic Building Blocks • 180 minutes. swirl Lesson 2: Workspace and Files • 180 minutes. swirl Lesson 3: Sequences of Numbers • 180 minutes. swirl Lesson 4: Vectors • 180 minutes. swirl Lesson 5: Missing Values • 180 minutes.

  16. R Programming

    RPubs - Ryan Tillis - R Programming - Data Science - Quiz 3 - Coursera. by RStudio.

  17. Assignment & Evaluation · UC Business Analytics R Programming Guide

    The original assignment operator in R was <-and has continued to be the preferred among R users. The = assignment operator was added in 2001 primarily because it is the accepted assignment operator in many other languages and beginners to R coming from other languages were so prone to use it. However, R uses = to associate function arguments with values (i.e. f(x = 3) explicitly means to call ...

  18. GitHub

    README R-Programming-Assignment-Week-3 Introduction This second programming assignment will require you to write an R function is able to cache potentially time-consuming computations. For example, taking the mean of a numeric vector is typically a fast operation.

  19. Programming Assignment 3: Quiz >> R Programming

    YUKON KUSKOKWIM DELTA REG HOSPITAL CENTRAL PENINSULA GENERAL HOSPITAL CORDOVA COMMUNITY MEDICAL CENTER MT EDGECUMBE HOSPITAL 4. What result is returned by the following code? rankhospital ("NC", "heart attack", "worst") CATAWBA VALLEY MEDICAL CENTER WAYNE MEMORIAL HOSPITAL WAKEMED, CARY HOSPITAL SPRUCE PINE COMMUNITY HOSPITAL

  20. RPubs

    R Pubs by RStudio. Sign in Register R Programming - Week 3 Assignment; by Ken Wood; Last updated over 3 years ago; Hide Comments (-) Share Hide Toolbars

  21. Assignment Writing Services

    4 likes, 0 comments - assignmentwritingservices__ on December 4, 2023: "Online Assignment Writing help has emerged as a valuable resource for students seeking to manage ..." Assignment Writing Services | Dissertation Writing on Instagram: "Online Assignment Writing help has emerged as a valuable resource for students seeking to manage their ...

  22. GitHub

    Entering a number between 1 and 10 will execute the corresponding part of the homework. We will compare the output of your functions to the correct output. For each test passed you receive the specified number of points on the Assignments List web page. Coursera - R Programming - Week 4. Contribute to Fleid/RPro-Week4 development by creating an ...