From 1dc8c8be0ea06334cd517421ae3d784debee15bb Mon Sep 17 00:00:00 2001 From: patstout Date: Fri, 11 Oct 2024 09:16:46 -0500 Subject: [PATCH 1/3] allowing the team regex to match with either a trailing space or the end of input --- R/fp_projections.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/fp_projections.R b/R/fp_projections.R index 635b002..3f8bdb6 100644 --- a/R/fp_projections.R +++ b/R/fp_projections.R @@ -83,7 +83,7 @@ fp_projections_parse.fp_nfl <- function(response){ 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() ) From fde9743e836838c60f6bfd55606e0f97c7066a48 Mon Sep 17 00:00:00 2001 From: patstout Date: Fri, 11 Oct 2024 09:23:26 -0500 Subject: [PATCH 2/3] bumping version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From efd6af720dbb8bdd9157bf8235ef02663c112b92 Mon Sep 17 00:00:00 2001 From: patstout Date: Fri, 11 Oct 2024 09:46:04 -0500 Subject: [PATCH 3/3] stripping 'highlow' off of the team name --- R/fp_projections.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/fp_projections.R b/R/fp_projections.R index 3f8bdb6..81a6349 100644 --- a/R/fp_projections.R +++ b/R/fp_projections.R @@ -80,6 +80,8 @@ 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) %>%