Skip to content

Commit

Permalink
Merge pull request #71 from r-hyperspec/feature-38/preparation
Browse files Browse the repository at this point in the history
Preparation to rename functions
  • Loading branch information
GegznaV authored Dec 14, 2021
2 parents 60ea9cc + ef2b2d0 commit 8fcb557
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 24 deletions.
21 changes: 10 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Collate:
'as_hyperSpec.R'
'barbiturates.R'
'bind.R'
'calculate_stacked_offsets.R'
'colMeans.R'
'collapse.R'
'cov_pooled.R'
Expand All @@ -168,13 +169,12 @@ Collate:
'paracetamol.R'
'laser.R'
'hyperspec-package.R'
'identify_spc.R'
'labels.R'
'plotmap.R'
'plot_map.R'
'levelplot.R'
'makeraster.R'
'map_identify.R'
'map_sel_poly.R'
'mark_dendrogram.R'
'mark_groups_in_dendrogram.R'
'mark_peak.R'
'mean_sd.R'
'merge.R'
Expand All @@ -183,11 +183,12 @@ Collate:
'palette_colorblind.R'
'palette_matlab.R'
'plot.R'
'plotc.R'
'plotmat.R'
'plotspc.R'
'plotvoronoi.R'
'plot_and_get.R'
'plot_c.R'
'plot_mat.R'
'plot_voronoi.R'
'quantile.R'
'raster.R'
'rbind.fill.R'
'read_txt_long.R'
'read_txt_wide.R'
Expand All @@ -199,14 +200,13 @@ Collate:
'show.R'
'spc_bin.R'
'spc_fix_colnames.R'
'spc_identify.R'
'spc_loess.R'
'spc_na_approx.R'
'spc_spline.R'
'split.R'
'subset.R'
'sweep.R'
'trellis.factor.key.R'
'trellis_factor_key.R'
'vandermonde.R'
'wl.R'
'wl_fix_unit_name.R'
Expand All @@ -216,4 +216,3 @@ Collate:
'write_txt_long.R'
'write_txt_wide.R'
'zzz.R'

2 changes: 1 addition & 1 deletion R/plotspc.R → R/calculate_stacked_offsets.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#' accidentally plotting of large numbers of spectra).
#' @param func a function to apply to each wavelength in order to calculate
#' summary spectra such as mean, min, max, etc.
#' @param func.args `list` with furter arguments for `func`
#' @param func.args `list` with further arguments for `func`
#' @param add if `TRUE`, the output is added to the existing plot
#' @param bty see [graphics::par()]
#' @param col see [graphics::par()]. `col` might be a vector giving individual
Expand Down
14 changes: 7 additions & 7 deletions R/spc_identify.R → R/identify_spc.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' Function [spc.identify()] allows to identify the spectrum and the wavelength
#' of a point in a plot produced by [plotspc()].
#'
#' @rdname spc_identify
#' @rdname identify_spc
#'
#' @aliases spc.identify
#' spc.label.default
Expand Down Expand Up @@ -267,7 +267,7 @@ spc.identify <- function(x, y = NULL,

# Function -------------------------------------------------------------------

#' @rdname spc_identify
#' @rdname identify_spc
#'
#' @param wl The wavelength to label.
#' @param spc The intensity to label.
Expand All @@ -279,21 +279,21 @@ spc.point.max <- function(wl, spc, wlclick) {
c(wl = wl[i], spc = spc[i])
}

#' @rdname spc_identify
#' @rdname identify_spc
#' @export
spc.point.default <- function(wl, spc, wlclick) {
i <- round(approx(wl, seq_along(wl), wlclick, rule = 2)$y)
c(wl = wl[], spc = spc[i])
}

#' @rdname spc_identify
#' @rdname identify_spc
#' @export
spc.point.min <- function(wl, spc, wlclick) {
i <- which.min(spc)
c(wl = wl[i], spc = spc[i])
}

#' @rdname spc_identify
#' @rdname identify_spc
#' @export
spc.point.sqr <- function(wl, spc, wlclick, delta = 1L) {
i <- which.max(spc)
Expand All @@ -318,7 +318,7 @@ spc.point.sqr <- function(wl, spc, wlclick, delta = 1L) {

# Function -------------------------------------------------------------------

#' @rdname spc_identify
#' @rdname identify_spc
#'
#' @param ispc If a selection of spectra was plotted, their indices can be
#' given in `ispc`. In this case `ispc[i]` is returned rather than `i`.
Expand All @@ -329,7 +329,7 @@ spc.label.default <- function(ispc, wl, spc, digits = 3) {
sprintf(" %i, %s ", ispc, format(wl, digits = digits))
}

#' @rdname spc_identify
#' @rdname identify_spc
#' @export
spc.label.wlonly <- function(ispc, wl, spc, digits = 3) {
sprintf(" %s ", format(wl, digits = digits))
Expand Down
2 changes: 1 addition & 1 deletion R/levelplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ setMethod("levelplot",
#' legend?
#' @param contour,useRaster see [lattice::levelplot()]
#'
#' @include plotmap.R
#' @include plot_map.R
#' @importFrom lattice levelplot
#' @export
#'
Expand Down
2 changes: 1 addition & 1 deletion R/map_identify.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @aliases levelplot,hyperSpec,missing-method
#' @include plotmap.R
#' @include plot_map.R
#' @rdname levelplot
#'
#' @export
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion R/map_sel_poly.R → R/plot_and_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' [grid::grid.locator()]). Polygon will be drawn closed.
#'
#' `map.sel.poly` is a convenience wrapper for [plotmap()], `sel.poly`,
#' and [sp::point.in.polygon()]. For custiomized plotting, the plot can be produced by
#' and [sp::point.in.polygon()]. For customized plotting, the plot can be produced by
#' [plotmap()], [plotvoronoi()] or [levelplot()], and the result of
#' that plot command handed over to `map.sel.poly`, see the example below.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/plotc.R → R/plot_c.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### -----------------------------------------------------------------------------
### --------------------------------------------------------------------------
###
### plotc - plot timeseries, concentration, ...
###
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion R/makeraster.R → R/raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' `x` values: The differences between the values of `x` are calculated (possible step
#' sizes). For each of those step sizes, different points are tried (until all points have been
#' covered by a raster) and the parameter combination leading to the best coverage (i.e. most points
#' on the grid) ist used.
#' on the grid) is not used.
#'
#' Note that only differences between the sorted values of x are considered as step size.
#' @param x numeric to be fitted with a raster
Expand Down
File renamed without changes.

0 comments on commit 8fcb557

Please sign in to comment.