Skip to content

Commit

Permalink
change devtools to remotes in README
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdolman committed Aug 22, 2023
1 parent 12be672 commit 861d449
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 17 deletions.
8 changes: 5 additions & 3 deletions R/AddConfInterval.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Add confidence interval
#'
#' Add a confidence interval to a spectral estimate assuming the uncertainty of
#' the spectral estimates follows a chi-squared distribution with the degress of
#' the spectral estimates follows a chi-squared distribution with the degrees of
#' the freedom from the spectral estimates.
#'
#' @param spec a spectral object of class \code{"spec"} or a list with the
Expand All @@ -16,7 +16,7 @@
#' respectively.
#' @author Thomas Laepple
#' @examples
#'
#'
#' N.R <- 1000
#' N.T <- 100
#' save.spec <- matrix(NA, N.T / 2, N.R)
Expand All @@ -33,7 +33,7 @@
#' legend("bottomleft", lwd = 2, col = c("black", "red"),
#' legend = c("one realization with chisq conf intervals",
#' "MC confidence intervals"))
#'
#'
#' @export
AddConfInterval <- function(spec, pval = 0.05, MINVALUE = 1e-10) {

Expand All @@ -44,6 +44,8 @@ AddConfInterval <- function(spec, pval = 0.05, MINVALUE = 1e-10) {
spec$lim.1[spec$lim.1 < MINVALUE] <- MINVALUE
spec$lim.2[spec$lim.2 < MINVALUE] <- MINVALUE

spec$pval <- pval

return(spec)

}
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ PaleoSpec is an R package to assist in the spectral analysis of timeseries, in p

You can install the development version of PaleoSpec from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("EarthSystemDiagnostics/paleospec")
```{r, eval=FALSE}
# install.packages("remotes")
remotes::install_github("EarthSystemDiagnostics/paleospec")
```


Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ You can install the development version of PaleoSpec from
[GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("EarthSystemDiagnostics/paleospec")
# install.packages("remotes")
remotes::install_github("EarthSystemDiagnostics/paleospec")
```

Please refer to function references here:
Expand All @@ -46,15 +46,15 @@ sunspot <- datasets::sunspot.month
plot(sunspot)
```

<img src="man/figures/README-unnamed-chunk-2-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-3-1.png" width="100%" />

``` r
library(PaleoSpec)
sp_sun <- SpecMTM(sunspot)
LPlot(sp_sun)
```

<img src="man/figures/README-unnamed-chunk-3-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />

Alternatively we can use the gg_spec() function to get a ggplot2

Expand All @@ -64,7 +64,7 @@ gg_spec(sp_sun)
#> Adding another scale for colour, which will replace the existing scale.
```

<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />

Appproximate confidence intervals can be added with the function
AddConfInterval()
Expand All @@ -76,7 +76,7 @@ gg_spec(sp_sun)
#> Adding another scale for colour, which will replace the existing scale.
```

<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-6-1.png" width="100%" />

### Simulating timeseries with given spectral properties

Expand All @@ -99,7 +99,7 @@ ts1 <- SimPLS(N = N, b = beta, a = alpha)
plot(ts1, type = "l")
```

<img src="man/figures/README-unnamed-chunk-6-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-7-1.png" width="100%" />

`SpecMTM` can again be used to estimate the power spectrum using the
multitaper method. If we convert the vector from SimPLS to a timeseries
Expand All @@ -113,7 +113,7 @@ LPlot(sp1)
abline(log10(alpha), -beta, col = "red")
```

<img src="man/figures/README-unnamed-chunk-7-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-8-1.png" width="100%" />

You can add confidence intervals to the spectral estimates with
`AddConfInterval`
Expand All @@ -124,7 +124,7 @@ LPlot(sp1)
abline(log10(alpha), -beta, col = "red")
```

<img src="man/figures/README-unnamed-chunk-8-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-9-1.png" width="100%" />

The `LogSmooth` function can be used to smooth power spectra with
equally spaced filter in log-space.
Expand All @@ -135,4 +135,4 @@ LPlot(sp1)
LLines(sp1_f, col = "green")
```

<img src="man/figures/README-unnamed-chunk-9-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-10-1.png" width="100%" />
2 changes: 1 addition & 1 deletion man/AddConfInterval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added man/figures/README-unnamed-chunk-10-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed man/figures/README-unnamed-chunk-2-1.png
Binary file not shown.
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed man/figures/README-unnamed-chunk-6-2.png
Binary file not shown.
Binary file removed man/figures/README-unnamed-chunk-6-3.png
Binary file not shown.
Binary file modified man/figures/README-unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 861d449

Please sign in to comment.