Comments (5)
You might want to head over to the https://www.sr-support.com/ and ask them about recovering the ID--they are really great.
My suggestion is that you should just use item as you trial id variable.
from gazer.
Thank you for the advice! The people from SR support are indeed very helpful! They suggested to use the Variable "!MODE RECORD CR 1000 2 1 L" instead of "TRIALID", because this should (at least in my files) be always logged with each trial as well. But yes, I could also use "item", as you suggested.
However, I still have problems inplementing this. When I use the function find_messages_edf(), I get an error message when including "!MODE RECORD CR 1000 2 1 L" as a search pattern.
find_messages_edf(file_list = file_list_edf, varnames = c("TRIALID", "mode_variable", "condition", "item", "keypress"), patterns = c("TRIALID", "!MODE RECORD CR 1000 2 1 L", "!V TRIAL_VAR condition", "!V TRIAL_VAR item", "!V TRIAL_VAR keypress"), output_dir_behave_data)
Also, I cannot simply remove the TRIALID-variable, I think the function searches for it automatically. When I remove the TRIALID variable from the function, I get the following error:
Error: Can't rename columns that don't exist.
x Column TRIALID
doesn't exist.
from gazer.
You will need to actually change the function itself. I suggest changing TRIALID below to mode_variable and it should work:
find_messages_edf <- function(file_list,varnames,patterns, output_dir)
{
subs <- length(file_list)
for (sub in 1:subs) {
subject = basename(file_list[sub]) # get id from file
msg=edf.messages.c(file_list[sub])
messagelist = list()
for(i in 1:length(varnames)){
find_msg <- msg$msg %>%
subset(str_detect(string=., pattern=varnames[i])) %>% # find specific pattern
str_replace(pattern=patterns[i], replacement = "") %>% # replace pattern with white space
str_replace_all(pattern=" ", repl="") # get rid of white space
messagelist[[i]]<-find_msg
}
message_data=dplyr::bind_cols(messagelist) %>%
set_names(varnames) %>%
dplyr::mutate(subject=as.factor(subject)) %>%
dplyr::rename(trial = "mode_variable")%>% #I changed this from TRIALID to mode_variable
dplyr::mutate(trial=as.integer(trial))
subOutData <- file.path(output_dir, paste(file_list[sub], "_behave_data.csv", sep="")) # save file
write.table(message_data, file = subOutData, append = FALSE, sep = ",",
row.names = FALSE, col.names = TRUE)
}
}
from gazer.
Great, thank you! It works now. There was some strange behaviour still, so instead of "mode_variable", I entered "!MODE RECORD CR 1000 2 1 L" in the line you changed above and in the following used the following code for extracting bebavioural data:
find_messages_edf_ADJUSTED(file_list = file_list_edf, varnames = c("!MODE RECORD CR 1000 2 1 L", "condition", "item", "keypress"), patterns = c("!MODE RECORD CR 1000 2 1 L", "!V TRIAL_VAR condition", "!V TRIAL_VAR item", "!V TRIAL_VAR keypress"), output_dir_behave_data)
from gazer.
I have to add that also with "!MODE RECORD CR 1000 2 1 L", it did not work for all of my files. Therefore, I am now using the item variable after all, which seems to be present for all of the trials.
from gazer.
Related Issues (20)
- GazeR functions exceed my working space limit: how to downsample HOT 12
- Can GazeR process datasets of the task which is implemented using MATLAB? HOT 2
- parse_edf function deletes message entries on the way HOT 3
- Cannot either install or download the GazeR package(s) HOT 11
- parse_edf function creates more trials than actually present HOT 11
- unable to use edfR HOT 14
- blink velocity hz? HOT 14
- Downsample XY for Pupil
- sample_message to message not updated in merge_pupil HOT 1
- unable to install saccades and edfR HOT 15
- Baseline correction problem HOT 5
- Loading edfs on Code Ocean HOT 28
- Read pupil data from excel HOT 7
- Error when running dplyr::gather HOT 2
- issues edfR HOT 14
- error using the downsample_gaze function HOT 5
- Accommodating data timebinned in Eyelink HOT 2
- downsample_gaze not found HOT 13
- Can GazeR analyze eye movement data in virtual reality environments? HOT 10
- How to find the peak pupil size and a possible bug in remove missing data? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gazer.