X

Jeff Taylor's Weblog

  • Sun
    February 10, 2014

Finding datasets for South African Heart Disease

I've been working with R recently and have been looking for interesting data sets, for example:

http://statweb.stanford.edu/~tibs/ElemStatLearn/data.html


The following command is documented but fails because R can't track through 2 302 status codes and a "301 Moved Permanently":

> read.table("http://www-stat.stanford.edu/~tibs/ElemStatLearn/datasets/SAheart.data", sep=",",head=T,row.names=1)
Error in file(file, "rt") : cannot open the connection



This worked:

> read.table("http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/SAheart.data", sep=",",head=T,row.names=1)


Even better:

http://cran.r-project.org/web/packages/ElemStatLearn/ElemStatLearn.pdf

> install.packages("ElemStatLearn")
> help(package="ElemStatLearn")
> library( package = ElemStatLearn )
> str(SAheart)
> summary(SAheart)
> data(SAheart)

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.