afsc-assessments / afscdata

An R package for data extraction of AFSC survey and fishery data
https://afsc-assessments.github.io/afscdata/
Other
2 stars 0 forks source link

add_fields not working #47

Closed pete-hulson closed 6 months ago

pete-hulson commented 6 months ago

https://github.com/afsc-assessments/afscdata/blob/8229f00841fd8ac061a7960c87d855f5c60ab9d8/R/queries.R#L384 This if() statement can be dropped - as it is constructed now you can't use the add_fields parameter - basically this will only let you select all columns - I think you can simply drop the if(!is.null(add_fields)) and just have the test if "*" is in the add_fields - if it's the default NULL the columns following this will still filter, and will add a column through add_field if one desires

BenWilliams-NOAA commented 6 months ago

@pete-hulson removed the first if statement and replaced it with: if(isTRUE(grepl("\\*", add_fields))){ seems to be working now

pete-hulson commented 6 months ago

shweet - working on my end too