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

read.wc introducing NAs while opening -PDT.csv files #83

Open
marosteg opened this issue Jun 23, 2023 · 1 comment
Open

read.wc introducing NAs while opening -PDT.csv files #83

marosteg opened this issue Jun 23, 2023 · 1 comment
Assignees

Comments

@marosteg
Copy link
Collaborator

marosteg commented Jun 23, 2023

read.wc() is currently introducing NAs into the object assigned from reading in a -PDT.csv from one of the spearfish. This isn't an issue in the context of running HMMoce but it does yield an error with tags2etuff when using tag_to_etuff(). MWE below (needed file attached):

#Read in metadata
meta <- read.csv('add_shortbillspearfish_meta.csv',header=T)
## format dates
meta$time_coverage_start <- lubridate::parse_date_time(meta$time_coverage_start, orders='Ymd HMS', tz='UTC')
meta$time_coverage_end <- lubridate::parse_date_time(meta$time_coverage_end, orders='Ymd HMS', tz='UTC')


dir <- '~/Google Drive/Shared drives/MPG_WHOI/data/shortbill_spearfish/MiniPAT/'

fish <- list.files(dir)
fish <- fish[-c(8,9)]

i <- 4
  fishID <- fish[i] # specify the individual
  data_dir <- paste(dir, fishID, sep='')

  etuff <- tag_to_etuff(dir=data_dir, meta=meta[which(meta$ptt == fishID),], gpe3 = FALSE)

This yields...

Error in if (nchar(binchar[i]) < 2) binchar[i] <- paste("0", binchar[i], :
missing value where TRUE/FALSE needed

...originating on code line 654 due to the IF statement encountering an NA that cannot be used for this TRUE/FALSE test.

add_shortbillspearfish_meta.csv

@camrinbraun
Copy link
Owner

I cant recreate the issue on my end as everything seems to be working fine. I did have a different (e.g. simplified/updated) version of read.wc() that I pushed to HMMoce here. Hopefully that's the only difference and you're good to go?

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