-
Notifications
You must be signed in to change notification settings - Fork 3
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
read.spc cannot handle spectra files with only one line in the audit log that ends with "\r\n" #64
Comments
Hello, Patric (@PAAC1984), Thanks for contacting us. It seems that the issue is OS-specific, as you indicate that it is related to
|
3.6.0 (2019-04-26)
hyperSpec_0.100.0
Windows 10 x64
Windows 10 x64
library(hyperSpec)
In the function "hyperSpec:::string.split" adjust the following line: To include a check whether the variable "pos" is a matrix(which has dimensions), otherwise it should be an array according on how the script acts: |
Thank you @PAAC1984. @cbeleites, could you look into this? |
I can reproduce the issue with hySpc.read.spc package: hySpc.read.spc::read.spc("Example_spectra.spc")
## Error in apply(pos, 1, function(p, x) substr(x, p[1], p[2]), x) :
## dim(X) must have a positive length It seems that function |
GitHub does not allow transferring the issue to the particular |
Hi,
I'm using hyperSpec to process Grams spectral data(*.spc files) and recently I received the following error:
After tracing down the function in the code, it looks like the origin is in the "hyperSpec:::split.string" function.
What happens is when variable "x" only has one line and ends with "\r\n\" (for example "myString\r\n\"), the pos matrix will turn into an array rather then a matrix and cause the error above.
Alternate versions of strings using "r\n\" like:
Do seem to work.
Let me know if there are further questions on this.
Best regards,
Patrick
The text was updated successfully, but these errors were encountered: