Skip to content
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

lr_get_spec values all NAs #30

Closed
itamshab opened this issue Oct 31, 2020 · 6 comments
Closed

lr_get_spec values all NAs #30

itamshab opened this issue Oct 31, 2020 · 6 comments

Comments

@itamshab
Copy link

I'm trying to convert multiple .csv files to a matrix for downstream analysis, using lr_get_spec, however all values are returned NAs.

Script used
spec <- lr_get_spec( where = getwd(), ext = "csv", lim = c(450,4500), sep = ",", subdir = FALSE, subdir.names = FALSE, ignore.case = TRUE, interpolate = TRUE )

Attaching zip of .csv files.
a4_bulk(12).zip

Thanks!

@Bisaloo Bisaloo closed this as completed in 8a00507 Nov 1, 2020
@Bisaloo
Copy link
Member

Bisaloo commented Nov 1, 2020

Thank you very much for the report! It should be now fixed.

You can install the development version with the fix by running:

install.packages("lightr", repos = "https://dev.ropensci.org")

The problem was that the data in your file is stored with decreasing wavelengths where all the examples I had until now have increasing wavelengths. So I didn't take this case into account. Out of curiosity where does this data come from? Do you have raw files from your spectrometer or does it only return csv?

@itamshab
Copy link
Author

itamshab commented Nov 1, 2020 via email

@Bisaloo
Copy link
Member

Bisaloo commented Nov 1, 2020

It does sound painful indeed. I don't know a better way right now since I'm not familiar with this format but if you can send me an example OPUS file, I can try to add a parser in lightr. Then you would be able to run lr_get_spec() directly on these files. This is precisely the use case I have in mind for lightr.

@itamshab
Copy link
Author

itamshab commented Nov 1, 2020 via email

@Bisaloo
Copy link
Member

Bisaloo commented Nov 2, 2020

@itamshab I didn't receive the attached files. I think you need to connect on GitHub (and not answer by email) to share them.

Alternatively, you can send them at the email address listed here: https://www.normalesup.org/~hgruson/contact.html

@Bisaloo
Copy link
Member

Bisaloo commented Dec 20, 2020

FYI, the request to parse OPUS files is now tracked in #31. I'll try to get on it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants