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

load_raw_all #12

Open
KaraS106 opened this issue May 31, 2024 · 1 comment
Open

load_raw_all #12

KaraS106 opened this issue May 31, 2024 · 1 comment

Comments

@KaraS106
Copy link

Hello!
I am trying to figure out the best way to load all of my logger data. I have one Folder "data" with several txt files from different loggers. I would like to load and combine the files and have the logger_id be the name of the file.
the file names are 2 different formats:
one is for example RF05DATA.TXT and the other is RF07_D03.TXT

I have tried load_raw_all

r<- load_raw_all(r_dir = "~/Desktop/RFID Analysis/RFID_Analysis/RFID/data", details = 0)

and I got these errors:
Loading file /Users/karasnow/Desktop/RFID Analysis/RFID_Analysis/RFID/data/RF01DATA.TXT...
Error in utils::read.table(r_file, col.names = c("animal_id", "date", :
duplicate 'row.names' are not allowed
In addition: Warning messages:
1: In utils::read.table(r_file, col.names = c("animal_id", "date", :
header and 'col.names' are of different lengths
2: In stop(c, call. = FALSE) : additional arguments ignored in stop()

@steffilazerte
Copy link
Member

steffilazerte commented Jun 3, 2024

Hi @KaraS106,

This will really depend on what your data files look like. The load_raw() and load_raw_all() functions are designed to work with data that has three columns (animal_id, date, and time). It's flexible enough to handle a couple of different formats, but was designed for the typical loggers in use about 7 years ago (which may not the format in use now).

I suggest taking a close look at your logger files and the options in load_raw(). You can see the documentation for these functions with ? eg. ?load_raw(). Try looking at your files and see if you can read a single file with load_raw(). If not, you'll probably have to load them yourself (consider read_csv()), just make sure the final data has animal_id, time (date/time) and logger_id.

If you're still struggling after this, post the first 30 lines of an example data file here, and I'll see if I can't get you some more specific suggestions 😁

Good luck!

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