MatthiasPucher / staRdom

staRdom is a package for R to analyse fluorescence and absorbance data of dissolved organic matter (DOM).
21 stars 2 forks source link

Problem in importing EEMs by the "important_function = csv2" #21

Closed GuoZhongyuPhD closed 2 years ago

GuoZhongyuPhD commented 2 years ago

Hi, I imported my EEMs data by the following codes. I have to use the important_function = csv2 because the column is emission.

folder <- system.file("EEMs_data",package = "staRdom") eem_list <- eem_read(folder, recursive = TRUE, import_function = eem_csv2) #Import EEMs files

But error occurred which was "Error in x[!is.na(em), !is.na(ex)] : (subscript) logical subscript too long"

I also tried those codes with the example data and the same error occurred. But we I replace csv2 by csv, it succeeded. But that means the column is excitation which is opposite compared with my EEMs.

Could anyone help me?

MatthiasPucher commented 2 years ago

This issue will be fixed a the next version.

RolandoSanGu commented 2 years ago

Dear Matthias First I want to say thank you for the great work that you have been doing with this package. It has been helping me a lot for the last two years. Nevertheless, I recently experienced an issue with the package because I can´t run the ´eem_read´ function, even with the examples that are given on the vignettes.

I am really ashamed because probably could be a simple error, however, I am not doing this for the first time and I have already tried with several procedures but the error is the same:

Error in .eem_csv(file) : argument "file" is missing, with no default or

Error in file.info(file) : invalid filename argument

In advance, I would appreciate your help.

Regards

MatthiasPucher commented 2 years ago

Dear Rolandu, I just tried to read the example EEMs and had no problem, could you please provide me with more information: Which versions of staRdom and eemR are you using? Could you please send me some of your code, so I can better understand, what the issue is. best wishes Matthias

RolandoSanGu commented 2 years ago

Dear Mathias

Probably it could be associated with a newer package version because yesterday I´ve tried it on another computer (with R version 3.6.1 and a version of the staRdom that is not updated since January 2020) and I do not replicate any problem at all, in fact, I was able to run all the analysis for some samples.

However, on my personal computer, I can´t even run the examples. I have these versions: R 4.1.3, eemR 1.0.1, and for staRDOM 1.1.26.

The code that I´m trying to run is very simple

`` LDM<- system.file("extdata/EEMs", package = "staRdom") # folder containing example EEMs eem_list <- eem_read(LDM, recursive = TRUE, import_function = eem_csv) # in case you use your own data, just replace folder by a path. e.g. "C:/folder/another folder" and change import_function according to instrument.

eem_LMD

eem_list `` The error is the following: Error in file.info(file): invalid filename argument

As I said earlier, this code works on another computer with an older version of the packages I am used to putting my data in the extdata folder and I only replace "exdata/EEMs" for "extdata/mydata/fluorescence" or "extdata/mydata/absorbance" for the case of the correction and slope parameters.

Regards

MatthiasPucher commented 2 years ago

I just rerun reading the EEMs with the exact versions, you mentioned (R 4.1.3, eemR 1.0.1, staRdom 1.1.26) and I unfortunately could still not reproduce the issue. I would advise you, not to put your data into the extdata folder of the package, staRdom is perfectly able to access any folder you want to and I cannot guarantee, there is no problem with this practice. I am happy to help you, if you could provide more information and please check, if there are still problems when you use folders outside the package.

MatthiasPucher commented 2 years ago

Is there any more information on this issue? Does the problem still persist?