Skip to content

Commit

Permalink
remove duplicate - add correct namespace and build site/manual
Browse files Browse the repository at this point in the history
  • Loading branch information
jthomasmock committed Mar 16, 2020
1 parent 6e79501 commit 7ebf95d
Show file tree
Hide file tree
Showing 32 changed files with 3,976 additions and 106 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^README\.Rmd$
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Imports:
purrr,
glue,
jsonlite,
stringr
stringr,
janitor
6 changes: 2 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Generated by roxygen2: do not edit by hand

export(get_espn_college_qbr)
export(get_espn_nfl_standings)
export(get_college_qbr)
export(get_nfl_qbr)
export(get_nfl_standings)
export(scrape_espn_stats)
import(dplyr)
import(purrr)
import(stringr)
import(tidyr)
importFrom(dplyr,"%>%")
importFrom(glue,glue)
importFrom(janitor,clean_names)
importFrom(janitor,make_clean_names)
importFrom(jsonlite,fromJSON)
importFrom(readr,parse_number)
importFrom(rvest,html_table)
Expand Down
10 changes: 6 additions & 4 deletions R/espn_api_standings.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
#' @param season Either numeric or character
#'
#' @return Returns a tibble
#' @export get_espn_nfl_standings
#' @export
#' @import tidyr dplyr purrr
#' @importFrom dplyr %>%
#' @importFrom jsonlite fromJSON
#' @importFrom glue glue
#' @examples
#' get_espn_nfl_standings(season = "2018")
#' # Get standings from 2018 season
#' get_nfl_standings(season = "2018")
#'
#' get_espn_nfl_standings(2010)
#' # Get standings from 2010 season
#' get_nfl_standings(2010)
#'
get_espn_nfl_standings <- function(season = 2019){
get_nfl_standings <- function(season = 2019){

current_year <- as.double(substr(Sys.Date(), 1, 4))

Expand Down
82 changes: 0 additions & 82 deletions R/get_espn_standings.R

This file was deleted.

6 changes: 4 additions & 2 deletions R/scrape_college_espn_qbr.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
#'
#' @examples
#'
#'# Get college QBR from 2011 season as a whole
#' get_college_qbr(season = 2011, week = NA)
#'
#' get_espn_college_qbr(2019, 1)
#'# Get college QBR from 2019 season week 1
#' get_college_qbr(2019, 1)
#'
get_espn_college_qbr <- function(season = 2019, week = NA) {
get_college_qbr <- function(season = 2019, week = NA) {

current_year <- as.double(substr(Sys.Date(), 1, 4))

Expand Down
2 changes: 1 addition & 1 deletion R/scrape_espn_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @examples
#' scrape_espn_stats(season = 2000, stat = "passing")
scrape_espn_stats <- function(stat = "receiving", season = 2019, season_type = "Regular"){
scrape_espn_stats <- function(season = 2019, stat = "receiving", season_type = "Regular"){

current_year <- as.double(substr(Sys.Date(), 1, 4))

Expand Down
6 changes: 2 additions & 4 deletions R/scrape_nfl_espn_qbr.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
#' @importFrom jsonlite fromJSON
#' @importFrom glue glue
#' @examples
#' # Get ALL Playoff QBR from 2016 season
#' get_nfl_qbr("2016", season_type = "Playoffs", week = NA)
#'
#' all_superbowls <- tidyr::crossing(season = 2006:2019, season_type = "Playoffs", week = 4) %>%
#' dplyr::filter(season != 2017) %>%
#' purrr::pmap_dfr(get_nfl_qbr)
#'
#' # Get Regular season QBR for week 4 of 2019
#' get_nfl_qbr("2019", season_type = "Regular", week = 4)
#'
get_nfl_qbr <- function(season = 2019, week = NA, season_type = "Regular") {
Expand Down
6 changes: 2 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ remotes::install_github("jthomasmock/espnscrapeR")
```
## Example

This is a basic example which shows you how to solve a common problem:

```{r example}
library(espnscrapeR)
```
Expand All @@ -42,7 +40,7 @@ get_nfl_qbr("2019", season_type = "Regular", week = 4)

```{r}
# Get NFL standings for 2010
get_espn_nfl_standings(2010)
get_nfl_standings(2010)
```


Expand All @@ -53,6 +51,6 @@ scrape_espn_stats(2019, stat = "rushing")

```{r}
# Get college QBR for 2014 week 5
get_espn_college_qbr(season = 2014, week = 5)
get_college_qbr(season = 2014, week = 5)
```

Loading

0 comments on commit 7ebf95d

Please sign in to comment.