brunobrr / bdc

Check out the vignettes with detailed documentation on each module of the bdc package
https://brunobrr.github.io/bdc
GNU General Public License v3.0
23 stars 7 forks source link

[ERROR]: Column names defined in the metadata do not match column names in the file #212

Closed peake-and-troughs closed 2 years ago

peake-and-troughs commented 2 years ago

I'm having an issue with bdc_standardize_datasets() function. Of 14 datasets just one isn't reading properly. I get the error mentioned in the title. I've checked that I have the correct file path and compared the two column names lists multiple times but they're a complete match. I don't suppose there's a way for the error message to be slightly more specific?

For reference below are the column names with their corresponding DarwinCore variables. The first row is what I have in the metadata file and the second is the dataset.

datasetName,fileName,bibliographicCitation,Identification,scientificName,fieldNumber,verbatimEventDate,verbatimLocality,verbatimDepth,verbatimLatitude,verbatimLongitude,decimalLatitude,decimalLongitude

Data set,CRYPTIC CLADE,organism,field number,Date Collected ,location identifier,depth (m),Lat reported,Long reported,Dec lat,Dec long

Data set,CRYPTIC CLADE,organism,field number,Date Collected ,location identifier,depth (m),Lat reported,Long reported,Dec lat,Dec long

kguidonimartins commented 2 years ago

Thanks for reporting. Could you provide us with a sample of the data that returns the error?

kguidonimartins commented 2 years ago

In the meantime, you can test the development version of {bdc}. We made a few improvements, and now the bdc_standardize_datasets should return which column(s) are missing/wrong in your datasets. Please, install the development version with:

if (!require("remotes")) install.packages("remotes")
remotes::install_github("brunobrr/bdc", force = TRUE)
peake-and-troughs commented 2 years ago

ok it's working now with the development version. it seems that the space after Date Collected in the dataset csv file was the issue. Sorry I couldn't get back to you with an example file, it's unpublished data and I didn't have permission from my coworkers and other stakeholders to share it with you.

kguidonimartins commented 2 years ago

Glad you found the problem. Thanks for testing the package and suggesting improvements. Feel free to open new issues as needed.