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

Use more consistent signature for methods of as.hyperSpec() #297

Closed
GegznaV opened this issue Dec 23, 2020 · 2 comments
Closed

Use more consistent signature for methods of as.hyperSpec() #297

GegznaV opened this issue Dec 23, 2020 · 2 comments

Comments

@GegznaV
Copy link
Collaborator

GegznaV commented Dec 23, 2020

Currently, each method of as.hyperSpec() uses its own order, default values and number of arguments:

.as.hyperSpec.matrix <- function(X, wl = guess.wavelength(colnames(X)), ...)

.as.hyperSpec.data.frame <- function(X, spc = NULL, wl = guess.wavelength(spc), labels = attr(X, "labels"), ...)

.as.hyperSpec.hyperSpec <- function(X)

This makes it more difficult to use in other functions as each case should be addressed separately.
My suggestions would be to:

  • use NULL for the default values in the signature and perform calculations or real initial values inside the methods;
  • use consistent order of arguments;
  • rename argument wl into the name that will be suggested in consistent naming of wavelength parameters #90.

May also be related: #144 (comment)

@cbeleites
Copy link
Owner

This is a very good point. +1

@GegznaV
Copy link
Collaborator Author

GegznaV commented Jul 27, 2021

@GegznaV GegznaV closed this as completed Jul 27, 2021
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