camrinbraun / HMMoce

hidden markov model for psat data v.1.1
Other
6 stars 7 forks source link

read.wc() for raw light data #38

Closed marosteg closed 3 years ago

marosteg commented 3 years ago

In running: light <- read.wc(lightFile, type = "light", tag = tag, pop = pop, verbose = T) I get this error: Error in utils::read.table(filename, sep = ",", header = T, blank.lines.skip = F, : more columns than column names In this case, tag = 2015-08-21, pop = 2015-11-05, lightFile is the path specific to my Google Drive (this worked for use of read.wc() on other files, such as SST and Series, from this fish's folder), and the raw LightLoc file is in your email.

Reading this file in directly with read.csv() has no issues (and inspection of the actual LightLoc.csv file shows no mismatch in the number of columns and column names. The underlying issue is within read.wc() where the 'if' statement identifies type as "light" and then specifies action to that file type only with read.table(, skip = 2).

This action was seemingly appropriate for older LightLoc files from WC but is now deprecated as the new files no longer contain two relatively empty rows above the actual table (compare the emailed 141449-LightLoc.csv file against 141259-LightLoc.csv used in the HMMoce vignette). Interestingly, this format change seemingly comes in recent years from the WC Portal, as my old computer hard copies of the LightLoc.csv files from our shortbill miniPATs have the two empty rows, but redownloading these just now did not include those empty rows.

Changing this code for the modern format is super easy but would eliminate functionality with older downloads of LightLoc files, so am uncertain on best procedure here.

camrinbraun commented 3 years ago

This should be fixed with #39. Please pull new changes from dev and try again.