Welcome to R
. It sounds like you love to do your analysis in Excel. Thats completely fine, but the fact that you are asking to crawl data from the web AND are asking about R, I think its safe to assume that you will start to find programming your analyses is the way to go.
That said, what you really want to do is crawl the web. There are tons of examples of how to do this with R, right here on SO. Look for things like "web scraping", "crawling", and "screen scraping".
Ok, dialogue aside. Don't worry about grabbing the data in XL format. You can parse the data directly with R. Most websites use a consistent naming convention, so using a for
loop and building the URLs for your datasets will be easy.
Below is an example of parsing your page, directly with R, into a data.frame
which acts very similar to tablular data in XL.
## load the packages you will need
# install.packages("XML")
library(XML)
## Define the URL -- you could dynamically build this
URL = "http://www.fantasypros.com/nfl/rankings/qb.php"
## Read the tables form the page into R
tables = readHTMLTable(URL)
## how many do we have
length(tables)
## look at the first one
tables[1]
## thats not it
## lets look at the 2nd table
tables[2]
## bring it into a dataframe
df = as.data.frame(tables[2])
If you are using R
for the first time, you can install external packages pretty easily with the command install.packages("PackageNameHere")
. However, if you are serious about learning R, I would look into using the RStudio IDE. It really flattened the learning curve for me on a ton of levels.