Skip to content

Commit e23d716

Browse files
committed
fix #2 resid and mkTrend return docs
1 parent b68278f commit e23d716

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

R/mkTrend_r.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mkTrend_r <- function(y, ci = 0.95, IsPlot = FALSE) {
3030
}
3131

3232
S <- Sf_r(y)
33-
ro <- acf(rank(lm(y ~ I(1:n))$resid), lag.max = (n - 1), plot = FALSE)$acf[-1]
33+
ro <- acf(rank(lm(y ~ I(1:n))$residuals), lag.max = (n - 1), plot = FALSE)$acf[-1]
3434
sig <- qnorm((1 + ci) / 2) / sqrt(n)
3535
rof <- ifelse(abs(ro) > sig, ro, 0) # modified by dongdong Kong, 2017-04-03
3636

R/mkTrend_rcpp.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#' @param IsPlot boolean
1212
#'
1313
#' @return
14-
#' * `Z0` : The original (non corrected) Mann-Kendall test Z statistic.
14+
#' * `z0` : The original (non corrected) Mann-Kendall test Z statistic.
1515
#' * `pval0`: The original (non corrected) Mann-Kendall test p-value
16-
#' * `Z` : The new Z statistic after applying the correction
16+
#' * `z` : The new Z statistic after applying the correction
1717
#' * `pval` : Corrected p-value after accounting for serial autocorrelation
1818
#' `N/n*s` Value of the correction factor, representing the quotient of the number
1919
#' of samples N divided by the effective sample size `n*s`
@@ -75,7 +75,7 @@ mkTrend <- function(y, x = seq_along(y), ci = 0.95, IsPlot = FALSE) {
7575

7676
resid <- .lm.fit(cbind(x, 1), y)$residuals
7777
resid %<>% rank()
78-
# resid = lm(x ~ I(1:n))$resid
78+
# resid = lm(x ~ I(1:n))$residuals
7979
# ro <- acf(resid, lag.max = (n - 1), plot = FALSE)$acf[-1]
8080
ro <- acf.fft(resid, lag.max = (n - 1))[-1]
8181
sig <- qnorm((1 + ci) / 2) / sqrt(n)

man/mkTrend.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)