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

Can I pass NULL to auk_project? #74

Open
nmtarr opened this issue Oct 5, 2023 · 2 comments
Open

Can I pass NULL to auk_project? #74

nmtarr opened this issue Oct 5, 2023 · 2 comments

Comments

@nmtarr
Copy link

nmtarr commented Oct 5, 2023

Hello,

I would like to avoid using an if statement in the following lines of code from one of my scripts:

Condition next action on whether NCBA records only are desired.

if (NCBA_only == TRUE) {
sampling <- EBD_sampling %>%
auk_sampling() %>%
auk_project("EBIRD_ATL_NC") %>%
auk_filter(file = "TMP_EBD.txt", overwrite = TRUE) %>%
read_sampling() %>%
data.frame()
} else {
sampling <- EBD_sampling %>%
auk_sampling() %>%
auk_filter(file = "TMP_EBD.txt", overwrite = TRUE) %>%
read_sampling() %>%
data.frame()
}

Is there a way that I can pass a null value to auk_project() so that I can do something like:

project <- NULL

Read in sampling data frame with auk

sampling <- EBD_sampling %>%
auk_sampling() %>%
auk_project(project = project) %>%
auk_filter(file = "TMP_EBD.txt", overwrite = TRUE) %>%
read_sampling() %>%
data.frame()

If I set project <- NULL in that case, the code won't run, but I would like for it to proceed anyways.

Any help would be greatly appreciated!

Nate

@nmtarr nmtarr changed the title Can I pass NULL values to auk_project? Can I pass NULL to auk_project? Oct 5, 2023
@mstrimas
Copy link
Contributor

Hi Nate, that's not currently how the auk_*() functions work, they require a valid non-NULL input. In theory this could be added, but for consistency would have to be added to all the filtering functions, which I don't have the bandwidth for at the moment. I'll leave this open and consider adding the functionality in future if I have some free time. For now though, I think you're stuck using the if statement approach you have been using.

@nmtarr
Copy link
Author

nmtarr commented Oct 10, 2023

Thanks Matt. It would be a handy change but I can work around it in the meantime.

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

No branches or pull requests

2 participants