rethomics / damr

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

load_dam command causing R to crash #31

Open mrs98 opened 3 years ago

mrs98 commented 3 years ago

I am having a problem where R Studio is suddenly crashing when I try to run a specific line of code with the error message "R Session Aborted, R encountered a fatal error. the session was terminated."

The code I am attempting to run is as follows:

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

DATA_DIR = ("C:/Users/Madalyn/Documents/Actographs by Treatment/Orexin") list.files(DATA_DIR, pattern= ".txt|.csv") setwd(DATA_DIR) metadata = link_dam_metadata("OrexinMetadata.csv", result_dir = DATA_DIR) metadata$stop_datetime = as.character(metadata$stop_datetime) metadata dt=load_dam(metadata)

It always crashes as I am attempting to run the last command in the script. This script, and all commands included, works perfectly fine with other data sets (the other data sets are actually LARGER then the one I am attempting to run here), but I cannot figure out what the problem is. If anybody has any ideas as to how I can fix this, PLEASE let me know!

I have done the usual preliminary troubleshooting steps: uninstalled and then reinstalled R and R-studio, and restarted my computer.

Here is the error code from Session Log: 06 Oct 2020 15:10:38 [rsession-Madalyn] ERROR system error 10053 (An established connection was aborted by the software in your host machine) [request-uri: /events/get_events]; OCCURRED AT void cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:113; LOGGED FROM: void cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:118

Orexin12345678.txt OrexinMetadata.txt

qgeissmann commented 3 years ago

Hey, sorry to hear that! before we start debugging that. have you tried that on R, not Rstudio? and have you tried on another machine? It looks like an R session issue somehow...

mrs98 commented 3 years ago

Thanks so much for reaching out so quickly. I did try this in R and on another computer and still had the crash. After formatting my original data files a bit, I was able to get passed the "R Session Aborted" problem and have gotten a more useful error message:

dt=load_dam(metadata) Error in find_dam_first_last_lines(path, start_datetime, stop_datetime, : Time has jumped for an hour or more! No valid data during this time. Possibly, device was disconected or maybe a change from summer to winter time In addition: Warning message: In find_dam_first_last_lines(path, start_datetime, stop_datetime, : The sampling period is not always regular in C:/Users/Madalyn/Documents/PSU/Data/Drug Manipulation Experiment/Actographs by Treatment/Orexin/Orexin12345678.txt. Some reads must have been skipped.

I believe what the problem is is that I had a power outage within the time period of this treatment. Because of this, column 4 of the data file has the value "51" during this time, as the monitor wasn't working properly. I still am trying to visualize the data that was successfully collected around this power outage though. How do you typically work around this?

Attaching the updated versions of my data: Orexin12345678.txt OrexinMetadata.txt

qgeissmann commented 3 years ago

The metadata is encoded in a weird format (UTF-16) and the date fields are formatted in an unconventional way e.g. 8/27/2020 6:00. any chance you could update that/send a new csv? That would make it smoother for me :)

mrs98 commented 3 years ago

Of course. This should be better. The site didn't seem to want to accept a csv file before, and so I must have accidentally altered the formatting while saving it as a txt.

On Thu, Oct 8, 2020 at 3:27 AM Quentin Geissmann notifications@github.com wrote:

The metadata is encoded in a weird format (UTF-16) and the date fields are formatted in an unconventional way e.g. 8/27/2020 6:00. any chance you could update that/send a new csv? That would make it smoother for me :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rethomics/damr/issues/31#issuecomment-705386135, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEF3VTKWEN2ER5VATDTZWLSJVSXDANCNFSM4SGLKQLA .

-- Pennsylvania State University PhD Candidate: Ecology Program Mrs98@psu.edu Madalyn.rose94@gmail.com 215-687-9746