cbeleites / hyperSpec

R package hyperSpec can now be found at https://github.com/r-hyperspec/hyperSpec
http://r-hyperspec.github.io/hyperSpec/
GNU General Public License v3.0
22 stars 11 forks source link

Rename functions (5): decomposition #303

Closed GegznaV closed 3 years ago

GegznaV commented 3 years ago

This issue complements https://github.com/cbeleites/hyperSpec/issues/208#issuecomment-684085699.

These functions may also be renamed. But extension or modification of functionality should also be introduced.

Current name Suggested name Comment Note
decomposition as.hyperSpec(<matrix>), as_hyperSpec(<matrix>)
scores2hyperSpec()
loadings2hyperSpec()
Function can not only renamed bu also redefined as a method of as.hyperSpec(), as_hyperSpec(). See discussion in #144. Related #289 This issue moved to https://github.com/r-hyperspec/hyperSpec/issues/55
chk.hy is.hyperSpec(), is_hyperSpec() 1. May include the functionality of validObject() as well.
2. To keep current functionality (failure in case of non-hyperSpec object), argument fail = TRUE may be added. Default should be fail = FALSE to return FALSE.
Solved in https://github.com/r-hyperspec/hyperSpec/pull/35
bryanhanson commented 3 years ago

Regarding chk.hy also take a look at #130 and the cross-references there-in. I think all these concerns can be fixed at once.

Regarding decomposition I authored #144 so I agree this should be renamed.

Somewhat related: decomposition will create a hyperSpec object containing loadings or scores. If loadings, then plotspc should be used, but if scores, plotc should be used. plotc also has other uses. I have not looked at this in detail, but from a user-friendliness point of view, it would be nice if plotc and plotspc were merged, made generic and employed the formula interface like plotc does to specify what should be plotted. Some careful checking of dimensions would be needed to intercept user errors like calling for a plot that does not make sense with the matrix dimensions.

GegznaV commented 3 years ago

This discussion moved and reopen as: