Skip to content

Commit

Permalink
fix URLs from r cmd check NOTE
Browse files Browse the repository at this point in the history
  • Loading branch information
jgabry committed Jan 7, 2021
1 parent ede30d3 commit 395571f
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 36 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: bayesplot
Type: Package
Title: Plotting for Bayesian Models
Version: 1.8.0
Date: 2021-01-06
Date: 2021-01-07
Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"), email = "[email protected]"),
person("Tristan", "Mahr", role = "aut"),
person("Paul-Christian", "Bürkner", role = "ctb"),
Expand All @@ -22,7 +22,7 @@ Description: Plotting functions for posterior analysis, MCMC diagnostics,
particularly (but not exclusively) packages interfacing with 'Stan'.
License: GPL (>= 3)
LazyData: TRUE
URL: https://mc-stan.org/bayesplot
URL: https://mc-stan.org/bayesplot/
BugReports: https://github.com/stan-dev/bayesplot/issues/
SystemRequirements: pandoc (>= 1.12.3), pandoc-citeproc
Depends:
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ matrices also inheriting from "array" in R 4.0.
* Added `mcmc_trace_data()`, which returns the data used for plotting the trace
plots and rank histograms. (Advances #97)

* [ColorBrewer](http://colorbrewer2.org) palettes are now available as color
* [ColorBrewer](https://colorbrewer2.org/) palettes are now available as color
schemes via
[`color_scheme_set()`](https://mc-stan.org/bayesplot/reference/bayesplot-colors.html).
For example, `color_scheme_set("brewer-Spectral")` will use the Spectral
Expand Down
2 changes: 1 addition & 1 deletion R/bayesplot-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#'
#' @section Resources:
#' * __Online documentation and vignettes__: Visit the __bayesplot__ website at
#' <https://mc-stan.org/bayesplot>
#' <https://mc-stan.org/bayesplot/>
#' * __Bug reports and feature requests__: If you would like to request a new
#' feature or if you have noticed a bug that needs to be fixed please let us
#' know at the **bayesplot** issue tracker at
Expand Down
24 changes: 9 additions & 15 deletions R/ppc-censoring.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
#' predictive distribution. See the **Plot Descriptions** section, below, for
#' details.
#'
#' Although some of the other plots can be used with censored data,
#' `ppc_km_overlay()` is currently the only plotting function designed
#' Although some of the other \pkg{bayesplot} plots can be used with censored
#' data, `ppc_km_overlay()` is currently the only plotting function designed
#' *specifically* for censored data. We encourage you to suggest or contribute
#' additional plots at [https://github.com/stan-dev/bayesplot](github.com/stan-dev/bayesplot).
#'
#'
#' additional plots at
#' [https://github.com/stan-dev/bayesplot](github.com/stan-dev/bayesplot).
#'
#' @name PPC-censoring
#' @family PPCs
Expand All @@ -26,10 +25,10 @@
#' \describe{
#' \item{`ppc_km_overlay()`}{
#' Empirical CCDF estimates of each dataset (row) in `yrep` are overlaid,
#' with the Kaplan-Meier estimate (Kaplan and Meier, 1958) for `y` itself
#' on top (and in a darker shade). This is a PPC suitable for
#' right-censored `y`. Note that the replicated data from `yrep` is assumed
#' to be uncensored.
#' with the Kaplan-Meier estimate (Kaplan and Meier, 1958) for `y` itself on
#' top (and in a darker shade). This is a PPC suitable for right-censored
#' `y`. Note that the replicated data from `yrep` is assumed to be
#' uncensored.
#' }
#' }
#'
Expand Down Expand Up @@ -74,11 +73,9 @@ ppc_km_overlay <-
abort("Package 'ggfortify' required.")
}

# Checks for 'status_y':
stopifnot(is.numeric(status_y))
stopifnot(all(status_y %in% c(0, 1)))

# Create basic PPC dataset:
data <- ppc_data(y, yrep, group = status_y)

# Modify the status indicator:
Expand All @@ -93,23 +90,20 @@ ppc_km_overlay <-
as.numeric(as.character(.data$group)),
1))

# Create 'survfit' object and 'fortify' it
sf <- survival::survfit(
survival::Surv(value, group) ~ rep_label,
data = data
)
fsf <- fortify(sf)

# Add variables specifying color, size, and alpha:
fsf$is_y_color <- as.factor(sub("\\[rep\\] \\(.*$", "rep", sub("^italic\\(y\\)", "y", fsf$strata)))
fsf$is_y_size <- ifelse(fsf$is_y_color == "yrep", size, 1)
fsf$is_y_alpha <- ifelse(fsf$is_y_color == "yrep", alpha, 1)

# Ensure that the observed data gets plotted last by reordering the
# levels of the factor "strata":
# levels of the factor "strata"
fsf$strata <- factor(fsf$strata, levels = rev(levels(fsf$strata)))

# Plot:
ggplot(data = fsf,
mapping = aes_(x = ~ time,
y = ~ surv,
Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bibentry(bibtype = "Misc",
),
year = year,
note = note,
url = c("https://mc-stan.org/bayesplot"),
url = c("https://mc-stan.org/bayesplot/"),
header = "To cite the bayesplot R package:"
)

Expand Down
2 changes: 1 addition & 1 deletion man-roxygen/reference-loo.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#' Bayesian model evaluation using leave-one-out cross-validation and WAIC.
#' *Statistics and Computing*. 27(5), 1413--1432.
#' doi:10.1007/s11222-016-9696-4. arXiv preprint:
#' <https://arxiv.org/abs/1507.04544/>
#' <https://arxiv.org/abs/1507.04544>
15 changes: 8 additions & 7 deletions man/PPC-censoring.Rd

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

2 changes: 1 addition & 1 deletion man/PPC-loo.Rd

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

2 changes: 1 addition & 1 deletion man/bayesplot-package.Rd

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

2 changes: 1 addition & 1 deletion vignettes/graphical-ppcs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ version 1.7.0. https://CRAN.R-project.org/package=brms

Gabry, J., and Goodrich, B. (2017). rstanarm: Bayesian Applied Regression
Modeling via Stan. R package version 2.15.3.
https://mc-stan.org/rstanarm, https://CRAN.R-project.org/package=rstanarm
https://mc-stan.org/rstanarm/, https://CRAN.R-project.org/package=rstanarm

Gabry, J. , Simpson, D. , Vehtari, A. , Betancourt, M. and Gelman, A. (2019),
Visualization in Bayesian workflow. _J. R. Stat. Soc. A_, 182: 389-402.
Expand Down
2 changes: 1 addition & 1 deletion vignettes/plotting-mcmc-draws.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ mcmc_trace_highlight(posterior, pars = "sigma", highlight = 3)

Gabry, J., and Goodrich, B. (2017). rstanarm: Bayesian Applied Regression
Modeling via Stan. R package version 2.15.3.
https://mc-stan.org/rstanarm, https://CRAN.R-project.org/package=rstanarm
https://mc-stan.org/rstanarm/, https://CRAN.R-project.org/package=rstanarm

Gabry, J., Simpson, D., Vehtari, A., Betancourt, M. and Gelman, A. (2019),
Visualization in Bayesian workflow. _J. R. Stat. Soc. A_, 182: 389-402.
Expand Down
8 changes: 4 additions & 4 deletions vignettes/visual-mcmc-diagnostics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ us diagnose divergences. We may however zoom in to investigate, using the

```{r echo=FALSE}
#A check that the chosen window still relevant
n_divergent_in_window <- np_cp %>% filter(Parameter == "divergent__" & Value == 1 & Iteration >= 700 & Iteration <= 900) %>% nrow()
n_divergent_in_window <- np_cp %>% filter(Parameter == "divergent__" & Value == 1 & Iteration >= 300 & Iteration <= 500) %>% nrow()
if(n_divergent_in_window < 6) {
divergences <- np_cp %>% filter(Parameter == "divergent__" & Value == 1) %>% select(Iteration) %>% get("Iteration", .) %>% sort() %>% paste(collapse = ",")
Expand All @@ -457,7 +457,7 @@ if(n_divergent_in_window < 6) {
```

```{r mcmc_trace_zoom}
mcmc_trace(posterior_cp, pars = "tau", np = np_cp, window = c(700,900)) +
mcmc_trace(posterior_cp, pars = "tau", np = np_cp, window = c(300,500)) +
xlab("Post-warmup iteration")
```

Expand Down Expand Up @@ -783,7 +783,7 @@ models. https://arxiv.org/abs/1312.0906

Gabry, J., and Goodrich, B. (2018). rstanarm: Bayesian Applied Regression
Modeling via Stan. R package version 2.17.4.
https://mc-stan.org/rstanarm
https://mc-stan.org/rstanarm/

Gabry, J., Simpson, D., Vehtari, A., Betancourt, M. and Gelman, A. (2019),
Visualization in Bayesian workflow. _J. R. Stat. Soc. A_, 182: 389-402.
Expand All @@ -810,4 +810,4 @@ Stan Development Team. _Stan Modeling Language Users
Guide and Reference Manual_. https://mc-stan.org/users/documentation/

Stan Development Team. (2018). RStan: the R interface to Stan. R package version 2.17.3.
https://mc-stan.org/rstan
https://mc-stan.org/rstan/

0 comments on commit 395571f

Please sign in to comment.