Skip to content

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

Closed

Description

@GegznaV

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)

Activity

  1. cbeleites commented on Dec 24, 2020

    @cbeleites
    Owner

    This is a very good point. +1

  2. GegznaV commented on Jul 27, 2021

    @GegznaV
    CollaboratorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions