Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QualityControlID not filtered correctly #120

Open
see24 opened this issue Jul 4, 2023 · 0 comments · May be fixed by #121
Open

QualityControlID not filtered correctly #120

see24 opened this issue Jul 4, 2023 · 0 comments · May be fixed by #121

Comments

@see24
Copy link

see24 commented Jul 4, 2023

When QualityControlID = 1 in munge_bbs_data, which is the default, I am still getting results with 0 in the QualityControlID column.

I checked the code and the issue is that the argument and column have the same name and inside the dplyr filter function it looks first in the context of the data frame so it does not use the value of QualityControlID = 1 that was supplied as an argument but rather the column in the data frame.

I will attempt to make a pull request now since it is an easy fix!

library(bbsAssistant)
library(dplyr)

# Set parameters for script
start_yr <- 1991
end_yr <- 2023


# Get the BBS data
# downloads the data the first time and will import it if already downloaded.
bbs_raw <- grab_bbs_data()

obs_ON_1991 <- munge_bbs_data(
  bbs_raw,
  states = region_codes %>% filter(State == "ontario") %>% pull(StateNum),
  zero.fill = FALSE,
  year.range = start_yr:end_yr,
  keep.stop.level.data = TRUE
)
see24 added a commit to see24/bbsAssistant that referenced this issue Jul 4, 2023
@see24 see24 linked a pull request Jul 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant