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

decomposition does not work properly with hyperSpec objects containing no spectra #289

Open
galaxismad opened this issue Dec 18, 2020 · 4 comments
Assignees
Labels
Type: bug 💣 something is not working as it should

Comments

@galaxismad
Copy link

Using the decomposition function with an hyperSpec function containing no spectra leads to an error with out of bounds description.

Error in xj[i, , drop = FALSE] : Indexing out of bounds

related issue: #288

@cbeleites cbeleites added the Type: bug 💣 something is not working as it should label Dec 18, 2020
@GegznaV
Copy link
Collaborator

GegznaV commented Dec 21, 2020

@galaxismad could you provide a minimal reproducible example to test this behavior?

@galaxismad
Copy link
Author

galaxismad commented Dec 21, 2020

spc <- new("hyperSpec", wavelength = 1:20, spc = matrix(NA, ncol = 20, nrow = 0))
decomposition(spc, matrix(20:1, ncol = 20, nrow = 1), scores = FALSE)

It would be expected, that the matrix is replacing the empty spc column, as a valid wavelength axis is available.

@GegznaV
Copy link
Collaborator

GegznaV commented Dec 21, 2020

@galaxismad thank you for the clarification.

@GegznaV
Copy link
Collaborator

GegznaV commented Dec 21, 2020

Possibly related: #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug 💣 something is not working as it should
Projects
None yet
Development

No branches or pull requests

3 participants