Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Importing multiple .mt files into one frame

Hi, I am completely new to MouseTracker and RStudio. I just finished data collection for my study and now I am trying to analyze the data.


I have put all my data in the map called "raw_data" and selected this as working directory in RStudio. Both mousetrap and readbulk libraries are installed. Now I would like to read all files in one frame with the following code:

# Load libraries

library(mousetrap)

library(readbulk)


# Use read_bulk to read all raw data files ending with ".mt" that are

# stored in the folder "raw_data" (in the current working directory)

mt_data_raw <- read_bulk("raw_data", fun=read_mt, extension=".mt")


# Import the data into mousetrap

mt_data <- mt_import_wide(mt_data_raw)

I get the following message: Warning message:

In read_bulk("raw_data", fun = read_mt, extension = ".mt") :
  Final data.frame has 0 rows. Please check that directory was specified correctly.


How can I solve this? I have tried loading one single file with the following code which was successful

# Read a single raw data file from MouseTracker

# (stored in the current working directory)

mt_data_raw <- read_mt("99_231204_1520.mt")


I don't see why a single file is successful but mering multiple files into one frame not.


Thank you so much in advance!☺️

Comments

Sign In or Register to comment.