这里下载数据,有三个文件:

要求:

best_hospt("TX", "heart attack")
## [1] "CYPRESS FAIRBANKS MEDICAL CENTER"
best_hospt("TX", "heart failure")
## [1] "FORT DUNCAN MEDICAL CENTER"
best_hospt("MD", "heart attack")
## [1] "JOHNS HOPKINS HOSPITAL, THE"
best_hospt("MD", "pneumonia")
## [1] "GREATER BALTIMORE MEDICAL CENTER"

当有参数输入错误时,会返回错误信息:

best_hospt("BB", "heart attack")
##invalid state
best_hospt("NY", "heat attack")
##invalid outcome
rankhospital("TX", "heart failure", 4)
## [1] "DETAR HOSPITAL NAVARRO"
rankhospital("MD", "heart attack", "worst")
## [1] "HARFORD MEMORIAL HOSPITAL"
rankhospital("MN", "heart attack", 5000)
## [1] NA

请以“R语言与多元统计5+姓名+学号”为标题 Email至:32025690@qq.com

返回课程主页