# how to important data into R

## 1) libraries

## 2) URL (only if in github)
sport_five_thirty_eight <- read.csv("https://raw.githubusercontent.com/fivethirtyeight/data/master/nfl-fandom/NFL_fandom_data-google_trends.csv", 
                                    header=TRUE)
# head(sport_five_thirty_eight)

## 3) download
sport538 <- read.csv("NFL_fandom_data-google_trends.csv", 
                     header=TRUE)
head(sport538)
##                            X Pct..Of.major.sports.searches X.1 X.2 X.3    X.4
## 1                        DMA                           NFL NBA MLB NHL NASCAR
## 2      Abilene-Sweetwater TX                           45% 21% 14%  2%     4%
## 3                  Albany GA                           32% 30%  9%  1%     8%
## 4 Albany-Schenectady-Troy NY                           40% 20% 20%  8%     6%
## 5    Albuquerque-Santa Fe NM                           53% 21% 11%  3%     3%
## 6              Alexandria LA                           42% 28%  9%  1%     5%
##   X.5 X.6              X.7
## 1 CBB CFB Trump 2016 Vote%
## 2  3% 11%           79.13%
## 3  3% 17%           59.12%
## 4  3%  4%           44.11%
## 5  4%  6%           39.58%
## 6  3% 12%           69.64%