knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
You can install the released version of rtrend from CRAN with:
install.packages("rtrend")
library(rtrend) set.seed(1) y = rnorm(100) # y <- c(4.81, 4.17, 4.41, 3.59, 5.87, 3.83, 6.03, 4.89, 4.32, 4.69) (r <- slope(y)) microbenchmark::microbenchmark( summary(lm(y~seq_along(y)))$coefficients[2, c(1, 4)], # traditional slope and pvalue r_p <- slope_p(y) # fast linear regression )
set.seed(1) x <- rnorm(2e2) microbenchmark::microbenchmark( mkTrend_r(x), # traditional in MK fume mkTrend(x) # in Rcpp version )
x <- c(4.81,4.17,4.41,3.59,5.87,3.83, 6.03,4.89,4.32,10,4.69) par(mar = c(3, 3, 1, 1), mgp = c(2, 0.6, 0)) r_cpp <- mkTrend(x, IsPlot = TRUE)
(r_boot <- slope_boot(y))
Kong, D., Gu, X., Li, J., Ren, G., & Liu, J. (2020). Contributions of Global Warming and Urbanization to the Intensification of Human‐Perceived Heatwaves Over China. Journal of Geophysical Research: Atmospheres, 125(18), 1–16. https://doi.org/10.1029/2019JD032175.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.