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

Creating hyperSpec object without wavelengths #296

Closed
cbeleites opened this issue Dec 23, 2020 · 4 comments
Closed

Creating hyperSpec object without wavelengths #296

cbeleites opened this issue Dec 23, 2020 · 4 comments
Labels
Type: enhancement 🎈 asking for a new feature.

Comments

@cbeleites
Copy link
Owner

cbeleites commented Dec 23, 2020

This is the "transpose" of issue #288: creating a hyperSpec object where the spectra do not (yet) exist.

Suggested:

new("hyperSpec", data = data.frame(c = 1:5))

this works:

new("hyperSpec",
     wavelength = numeric(0),
     spc = matrix(NA_real_, ncol = 0, nrow = 5), 
     data = data.frame(c = 1:5)
)
@GegznaV
Copy link
Collaborator

GegznaV commented Dec 23, 2020

I've solved this on my PC, just did not want to create too many PR before the current ones are reviewed.

@cbeleites cbeleites added the Type: enhancement 🎈 asking for a new feature. label Dec 23, 2020
@GegznaV
Copy link
Collaborator

GegznaV commented Dec 23, 2020

To clarify, I have suggestion for:

new("hyperSpec", data = data.frame(c = 1:5))

@GegznaV
Copy link
Collaborator

GegznaV commented Dec 23, 2020

I ran unit tests on my implementation and understood that the issue is more complex than it seemed at first glance.

Currently, the official solution to this issue in hyperSpec is to use as.hyperSpec():

as.hyperSpec(data.frame(c = 1:5))
as.hyperSpec(as.matrix(data.frame(c = 1:5)))
as.hyperSpec(matrix(1:5))

@GegznaV
Copy link
Collaborator

GegznaV commented Aug 6, 2022

Issue reopened as r-hyperspec/hyperSpec#99

@GegznaV GegznaV closed this as completed Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement 🎈 asking for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants