Skip to content

Commit 0386f7e

Browse files
author
Shawn P. Serbin
committed
Quick patch to call correct mApply from Hmisc
1 parent 9fd7c1d commit 0386f7e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: FieldSpectra
22
Type: Package
33
Title: Functions for processing field spectroscopy data. Current supported instruments include ADS FieldSpec, Spectral Evolution, and Spectra Vista Corporation
4-
Version: 0.9.6
4+
Version: 0.9.7
55
Date: 2021-02-18
66
Author: Shawn P. Serbin
77
Authors@R:
@@ -10,6 +10,7 @@ Authors@R:
1010
role = c("aut", "cre", "ctb"),
1111
email = "sserbin@bnl.gov",
1212
comment = c(ORCID = "0000-0003-4136-8971")))
13+
Maintainer: Shawn P. Serbin <sserbin@bnl.gov>
1314
Description: A field spectroscopy package containing functions to process
1415
spectral files collected using an Analytical Spectral Devices (ASD),
1516
Spectral Evolution, or Spectra Vista Corporation (SVS) instruments. The goal
@@ -33,5 +34,4 @@ Copyright: Authors
3334
LazyLoad: yes
3435
LazyData: FALSE
3536
Encoding: UTF-8
36-
RoxygenNote: 7.1.1
37-
VignetteBuilder: knitr
37+
RoxygenNote: 7.1.2

FieldSpectra_0.9.6.pdf

-107 KB
Binary file not shown.

FieldSpectra_0.9.7.pdf

108 KB
Binary file not shown.

R/average.spec.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ average.spec <- function(file.dir=NULL,out.dir=NULL,spec.type="Reflectance",star
255255
stop("******** ERROR: Bias threshold too strict, no remaining spectra to average. Please correct ********")
256256
}
257257
### Get spectra averages
258-
spec.avg <- mApply(mat.data,ind,colMeans,simplify=TRUE)
258+
spec.avg <- Hmisc::Apply(mat.data,ind,colMeans,simplify=TRUE)
259259
### Reformat data for further processing
260260
if (is.null(dim(spec.avg)[1])) {
261261
spec.avg <- data.frame(Spectra=unique(good.spec$Spectra), t(as.vector(spec.avg)))
@@ -343,7 +343,7 @@ average.spec <- function(file.dir=NULL,out.dir=NULL,spec.type="Reflectance",star
343343
#ind <- factor(as.numeric(good.spec$Spectra))
344344
ind <- factor(good.spec$Spectra)
345345
mat.data <- as.matrix(good.spec[,2:dim(good.spec)[2]])
346-
spec.avg <- mApply(mat.data,ind,colMeans,simplify=TRUE)
346+
spec.avg <- Hmisc::mApply(mat.data,ind,colMeans,simplify=TRUE)
347347
### Reformat spectral data for output
348348
if (is.null(dim(spec.avg)[1])){
349349
spec.avg <- data.frame(Spectra=unique(good.spec$Spectra), t(as.vector(spec.avg)))

0 commit comments

Comments
 (0)