[Dplr-commits] r673 - branches/redfit/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 29 19:39:48 CEST 2013
Author: mvkorpel
Date: 2013-08-29 19:39:47 +0200 (Thu, 29 Aug 2013)
New Revision: 673
Modified:
branches/redfit/R/redfit.R
Log:
* do not overwrite 'ofac' in redfit()
* removed unused local variables 'rhosum' and 'tp' from redfitGetrho()
and redfitSetdim(), respectively
* removed unused parameter 'x' from redfitInitarrays()
Modified: branches/redfit/R/redfit.R
===================================================================
--- branches/redfit/R/redfit.R 2013-08-29 17:24:22 UTC (rev 672)
+++ branches/redfit/R/redfit.R 2013-08-29 17:39:47 UTC (rev 673)
@@ -211,10 +211,9 @@
fnyq <- params[["fnyq"]]
nfreq <- params[["nfreq"]]
df <- params[["df"]]
- ofac <- params[["ofac"]]
segskip <- params[["segskip"]]
freq <- seq(from = 0, to = fnyq, length.out = nfreq)
- ia <- redfitInitArrays(t, x, freq, params)
+ ia <- redfitInitArrays(t, freq, params)
## determine autospectrum of input data
dn50 <- as.numeric(n50)
cbindfun <- match.fun("cbind")
@@ -565,7 +564,7 @@
invisible(x)
}
-redfitInitArrays <- function(t, x, freq, params) {
+redfitInitArrays <- function(t, freq, params) {
np <- params[["np"]]
nseg <- params[["nseg"]]
nfreqM1 <- length(freq) - 1
@@ -612,7 +611,6 @@
## original Fortran version because it would not use all of the
## data (t[np]) with some combinations of np and n50.
avgdt <- (t[np] - t[1]) / (np - 1) # avg. sampling interval
- tp <- avgdt * nseg # average period of a segment
fnyq <- hifac / (2 * avgdt) # average Nyquist freq.
nfreq <- floor(hifac * ofac * nseg / 2 + 1) # f[1] == f0; f[nfreq] == fNyq
df <- fnyq / (nfreq - 1) # freq. spacing
@@ -719,7 +717,6 @@
## dplR: was gettau, converted to return rho only
redfitGetrho <- function(t, x, n50, nseg, segskip) {
- rhosum <- 0
np <- as.numeric(length(x))
nseg2 <- as.numeric(nseg)
segskip2 <- as.numeric(segskip)
More information about the Dplr-commits
mailing list