Finding the best hospital in a state

The function reads the outcome-of-care-measures.csv le and returns a
character vector
with the name of the hospital that has the best (i.e. lowest) 30-day
mortality for the specied 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 rst 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).
Ranking hospitals in all states

 The function reads the outcome-of-care-measures.csv le and returns a
2-column data frame
containing the hospital in each state that has the ranking specied 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 rst 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.
 Ranking hospitals by outcome in a state

The function reads the outcome-of-care-measures.csv le and returns a
character vector with the name
of the hospital that has the ranking specied by the num argument. F
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.