bnicenboim / eeguana

A package for manipulating EEG data in R.
https://bnicenboim.github.io/eeguana/
Other
21 stars 9 forks source link

missleading error message in read_vhdr() #141

Closed jaromilfrossard closed 3 years ago

jaromilfrossard commented 3 years ago

Hello,

In the function read_vhdr, the error messages in line 70 is missleading. The message says that the .vhdr file cannot be found. However, it would be more informative if the error message cites the ".vmrk" files, as the function checks for the ".vmrk" files.

I would change

  if (!file.exists(file_vmrk)) stop(sprintf("File %s not found in %s",file, getwd()))

into

  if (!file.exists(file_vmrk)) stop(sprintf("File %s not found in %s",file_vmrk, getwd()))

It is both in the experimental and master branch.

My files were renamed and the filename info from the .vhdr did not match the file name in my computer. Maybe adding the option to let users specify the 3 files names would be useful to take into account when files are renamed.

Thanks!

bnicenboim commented 3 years ago

yeah, feel free to make the first change, and do a PR to the experimental branch.

Regarding the second issue, the idea (not mine, but from brainvision) is that the vhdr indicates all the relevant meta-information including the rest of the file names, I don't want to overwrite that from R. If you change a file name, you need to edit the vhdr.