rethomics / damr

Read TriKinetics' DAM data in R
http://rethomics.github.io
6 stars 7 forks source link

Parsing failure #24

Closed JessHCarroll closed 5 years ago

JessHCarroll commented 5 years ago

Hi, Thanks for making such an amazing package! I seem to be having problems with the linking step. I get the following error;

metadata <- link_dam_metadata(metadata, result_dir = DATA_DIR) _Warning: 1 parsing failure. row col expected actual 1 -- date like 12-03-2019 15:51:00

Error: 1 parsing failure_

I know a similar post (2017) was made, however the issue with that was the date/time wasn't formatted as required and I cannot work out what is wrong to save my life!

Any thoughts would be really really appreciated, thank you so much!

Here's the code (I've created my own metadata file);

rm(list=ls())

library(damr) library(zeitgebr) library(ggetho) library(behavr) library(data.table)

DATA_DIR <- "C:\Users\jlhc\Documents\R\fitboks" list.files(DATA_DIR, pattern= ".txt|.csv") setwd(DATA_DIR)

metadata <- fread("metadata.csv") metadata

metadata <- link_dam_metadata(metadata, result_dir = DATA_DIR) metadata

############################

metadata output

metadata file id start_datetime stop_datetime start_time stop_time region_id 1: bok_231.csv 231 12-03-2019 15:51:00 13-03-2019 09:00:00 15:51 09:00 1 2: bok_235.csv 235 13-03-2019 16:00:00 14-03-2019 08:41:00 16:00 08:41 2 3: bok_236.csv 236 08-03-2019 15:53:00 09-03-2019 09:00:00 15:53 09:00 3 4: bok_237.csv 237 11-03-2019 15:51:00 12-03-2019 09:00:00 15:51 09:00 4 5: bok_263.csv 263 13-03-2019 16:00:00 14-03-2019 09:00:00 16:00 09:00 5 6: bok_267.csv 267 06-03-2019 15:49:00 07-03-2019 09:04:00 15:49 09:04 6 7: bok_269.csv 269 14-03-2019 13:58:00 15-03-2019 09:00:00 13:58 09:00 7

JessHCarroll commented 5 years ago

Bugger, just realised it was because it wasn't yyyy-mm-dd. Can't delete this, sorry!!