Skip to content

Commit

Permalink
add document for new ridgePlot extension
Browse files Browse the repository at this point in the history
  • Loading branch information
richardli committed Sep 17, 2024
1 parent adc694e commit 1eae5d5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ License: GPL (>= 2)
Imports: survey, stats, spdep, survival, ggplot2, scales, utils, Matrix, reshape2, viridis, sp, sf, shadowtext, ggridges, methods, data.table, RColorBrewer, grDevices, fields, terra, haven
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Additional_repositories: https://inla.r-inla-download.org/R/testing/
Suggests: INLA, knitr, rmarkdown, readstata13, patchwork, rdhs, R.rsp, sae, dplyr, tidyr, raster
VignetteBuilder: R.rsp, knitr
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ importFrom(stats,na.pass)
importFrom(stats,qnorm)
importFrom(stats,quantile)
importFrom(stats,rbinom)
importFrom(stats,rnorm)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,setNames)
Expand Down
21 changes: 21 additions & 0 deletions R/getSmoothedDensity.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#' @return ridge plot of the density, and if \code{save.density = TRUE}, also a data frame of the calculated densities
#' @seealso \code{\link{plot.SUMMERproj}}
#' @importFrom methods as
#' @importFrom stats rnorm
#' @author Zehang Richard Li
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -70,6 +71,26 @@
#' ncol = 4, by.year=FALSE, per1000 = TRUE)
#'
#'
#' # Example using surveyPrev package output
#'
#' library(surveyPrev)
#' dhsData <- getDHSdata(country = "Rwanda", indicator = "nmr", year = 2019)
#' data <- getDHSindicator(dhsData, indicator = "nmr")
#' geo <- getDHSgeo(country = "Rwanda", year = 2019)
#' poly.adm1 <- geodata::gadm(country="RWA", level=1, path=tempdir())
#' poly.adm1 <- sf::st_as_sf(poly.adm1)
#' poly.adm2 <- geodata::gadm(country="RWA", level=2, path=tempdir())
#' poly.adm2 <- sf::st_as_sf(poly.adm2)
#' cluster.info <- clusterInfo(geo = geo,
#' poly.adm1 = poly.adm1,
#' poly.adm2 = poly.adm2,
#' by.adm1 = "NAME_1",
#' by.adm2 = "NAME_2")
#'
#' fit1 <- directEST(data = data, cluster.info = cluster.info, admin = 1)
#' fit2 <- directEST(data = data, cluster.info = cluster.info, admin = 2)
#' ridgePlot(fit1, direction = -1)
#' ridgePlot(fit2, direction = -1)
#'
#' }
#'
Expand Down
20 changes: 20 additions & 0 deletions man/ridgePlot.Rd

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

0 comments on commit 1eae5d5

Please sign in to comment.