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

an error message when using auk_filter #71

Open
huckbuc opened this issue Dec 13, 2022 · 0 comments
Open

an error message when using auk_filter #71

huckbuc opened this issue Dec 13, 2022 · 0 comments

Comments

@huckbuc
Copy link

huckbuc commented Dec 13, 2022

Hi,

I am new to auk, but have a lot of experience with R. I am trying to work through the "Best Practices" guide, but got stuck in the "Data extraction with auk" section, as I am getting an error message "Error running AWK command" after running the auk_filter command.

Here are more details:

  • Because of disk space issues, I downloaded a much smaller EBD file, of Israel only, so I have on my (windows) computer the two files ebd_IL_relOct-2022.txt and ebd_sampling_relOct-2022.txt in the directory C:/ebird_data.

  • I ran seemingly successfully the following code (changed the filter a bit):

library(auk)
library(lubridate)
library(sf)
library(gridExtra)
library(tidyverse)

select <- dplyr::select

dir.create("data", showWarnings = FALSE)

ebd_main_file <- "C:/ebird_data/ebd_IL_relOct-2022.txt"
ebd_main_sampling_file <- "C:/ebird_data/ebd_sampling_relOct-2022.txt"

ebd <- auk_ebd(ebd_main_file, 
               file_sampling = ebd_main_sampling_file)

ebd_filters <- ebd %>% 
  auk_date(date = c("2020-06-01", "2020-06-30")) %>% 
  auk_protocol(protocol = c("Stationary", "Traveling")) %>% 
  auk_complete()
ebd_filters

data_dir <- "data"
if (!dir.exists(data_dir)) {
  dir.create(data_dir)
}

f_ebd <- file.path(data_dir, "ebd_june_2020_IL.txt")
f_sampling <- file.path(data_dir, "ebd_checklists_june_2020_IL.txt")
  • But upon running the next command, (when the data directory is empty),
if (!file.exists(f_ebd)) {
  auk_filter(ebd_filters, file = f_ebd, file_sampling = f_sampling)
}

I get the error message

Error in auk_filter.auk_ebd(ebd_filters, file = f_ebd, file_sampling = f_sampling) : 
  Error running AWK command.
  • Cygwin is installed properly on my computer, and awk works well within cygwin.

  • auk seems to know the right place of awk:

> auk_get_awk_path()
[1] "C:/cygwin64/bin/gawk.exe"

What am I missing? Will greatly appreciate any help!

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

1 participant