diff --git a/DESCRIPTION b/DESCRIPTION index f81a959..ab8c02f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ffpros Title: Retrieves Data from FantasyPros -Version: 0.1.5 +Version: 0.1.6 Authors@R: person(given = "Tan", family = "Ho", diff --git a/R/fp_projections.R b/R/fp_projections.R index 635b002..81a6349 100644 --- a/R/fp_projections.R +++ b/R/fp_projections.R @@ -80,10 +80,12 @@ fp_projections_parse.fp_nfl <- function(response){ team = rvest::html_text(player_labels) %>% tail(-1) ) %>% dplyr::mutate( + #The 'highlow' string may appear in the 'team' text when max and min requested + team = stringr::str_remove(team, "highlow$"), team = purrr::map2(.data$player_name, .data$team, ~stringr::str_remove_all(.y,.x) %>% - stringr::str_extract_all("[A-Z]+ ") %>% + stringr::str_extract_all("[A-Z]+(\\s|$)") %>% stringr::str_squish()) %>% unlist() )