Skip to content

Commit

Permalink
Added code to default to pull to current year if year is NA
Browse files Browse the repository at this point in the history
  • Loading branch information
andybeet committed Oct 1, 2024
1 parent 380b5a7 commit 560b113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/get_comland_raw_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
get_comland_raw_data <- function(channel, filterByYear = NA, filterByArea = NA,
useLanded = T, removeParts = T){

#If not specifying a year default to 1964 - 2019
if(is.na(filterByYear[1])) filterByYear <- 1964:2019
#If not specifying a year default to 1964 - current year
currentYear <- as.numeric(format(Sys.Date(),"%Y"))
if(is.na(filterByYear[1])) filterByYear <- 1964:currentYear
filteryears <- sqltext(filterByYear)

message(paste0("Pulling landings data from ",
Expand Down
2 changes: 1 addition & 1 deletion man/get_comland_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 560b113

Please sign in to comment.