Skip to content

Commit

Permalink
23.2.9.1
Browse files Browse the repository at this point in the history
Fix CRAN issues
  • Loading branch information
Sciurus365 committed Feb 9, 2023
1 parent a623ad9 commit a6bde82
Show file tree
Hide file tree
Showing 21 changed files with 130 additions and 45 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
^docs$
^pkgdown$
^cran-comments\.md$
^CRAN-SUBMISSION$
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Authors@R: c(
)
Description: A toolbox for constructing potential landscapes for Ising
networks. The parameters of the networks can be directly supplied by
users or estimated by the `IsingFit` package
<https://CRAN.R-project.org/package=IsingFit> from empirical data. The
Ising model's Boltzmann distribution is preserved for the potential
landscape function. The landscape functions can be used for
quantifying and visualizing the stability of network states, as well
as visualizing the simulation process.
users or estimated by the 'IsingFit' package by van Borkulo and
Epskamp (2016) <https://CRAN.R-project.org/package=IsingFit> from
empirical data. The Ising model's Boltzmann distribution is preserved
for the potential landscape function. The landscape functions can be
used for quantifying and visualizing the stability of network states,
as well as visualizing the simulation process.
License: GPL (>= 3)
URL: https://sciurus365.github.io/Isinglandr/,
https://github.com/Sciurus365/Isinglandr
Expand Down
2 changes: 2 additions & 0 deletions R/Ising_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ generator_control_seq <- function(type) {
#' and the original threshold value(s) or the original weight(ed
#' adjacency matrix)? `*` by default, which means the values supplied
#' in `seq` will be multiplied to the original value, vector, or matrix.
#'
#' @return An `ctrl_*` object specifying the varying parameters.
#' @name make_Ising_grid-control-functions
NULL

Expand Down
16 changes: 2 additions & 14 deletions R/imported_generic_function.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
#' Autolayer generic function
#'
#' See [ggplot2::autolayer()], [autolayer.resilience()] for details.
#'
#' @name autolayer
#' @keywords internal
#' @export
#' @importFrom ggplot2 autolayer
NULL
ggplot2::autolayer

#' Barrier calculation function
#'
#' See [calculate_barrier.Isingland()] for details.
#'
#' @name calculate_barrier
#' @keywords internal
#' @export
#' @importFrom simlandr calculate_barrier
NULL
simlandr::calculate_barrier
20 changes: 19 additions & 1 deletion R/landscape.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,17 @@ make_2d_Isingland <- function(thresholds, weiadj, beta = 1, transform = FALSE) {
#' distribution and the potential values for different states.
#' \item `Nvar` The number of variables (nodes) in the Ising network.
#' }
#'
#' @examples
#' Nvar <- 10
#' m <- rep(0, Nvar)
#' w <- matrix(0.1, Nvar, Nvar)
#' diag(w) <- 0
#' result4 <- make_Ising_grid(
#' all_thresholds(seq(-0.1, 0.1, 0.1), .f = `+`),
#' whole_weiadj(seq(0.5, 1.5, 0.5)),
#' m, w
#' ) %>% make_2d_Isingland_matrix()
#' plot(result4)
#' @export
make_2d_Isingland_matrix <- function(Ising_grid, transform = FALSE) {
dist_raw <- Ising_grid %>%
Expand Down Expand Up @@ -184,6 +194,14 @@ plot.2d_Isingland_matrix <- function(x, ...) {
#'
#' @seealso [make_2d_Isingland()] for the algorithm.
#'
#' @return A `3d_Isingland` object that contains the following components:
#' \itemize{
#' \item `dist_raw`,`dist` Two tibbles containing the probability
#' distribution and the potential values for different states.
#' \item `thresholds`,`weiadj`,`beta` The parameters supplied to the function.
#' \item `Nvar` The number of variables (nodes) in the Ising network.
#' }
#'
#' @export
make_3d_Isingland <- function(thresholds, weiadj, x, y, beta = 1, transform = FALSE) {
l_2d <- make_2d_Isingland(thresholds, weiadj, beta, transform)
Expand Down
2 changes: 2 additions & 0 deletions R/resilience.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ calculate_resilience.2d_Isingland <- function(l, split_value = 0.5*l$Nvar, ...)
#' @param ... Not in use.
#'
#' @export
#'
#' @inherit ggplot2::autolayer return
#' @name autolayer.resilience
autolayer.resilience_2d_Isingland <- function(object, point = TRUE, line = TRUE, split_value = TRUE, interval = TRUE, resilience_value = TRUE, ...) {
result <- list()
Expand Down
5 changes: 3 additions & 2 deletions R/shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ shiny_ui <- function() {

#' A shiny app that shows the landscape for
#' the Ising network of major depressive disorder
#' @param ... Not in use.
#'
#' @export
#'
shiny_Isingland_MDD <- function() {
#' @return This function opens a Shiny app session without a return value.
shiny_Isingland_MDD <- function(...) {
app <- shiny::shinyApp(shiny_ui, shiny_server)
shiny::runApp(app)
}
12 changes: 12 additions & 0 deletions R/simulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ U <- function(l, x) {
#' \item `landscape` The landscape object supplied to this function.
#' \item `mode` A character representing the mode of the simulation.
#' }
#'
#' @examplesIf interactive()
#' Nvar <- 10
#' m <- rep(0, Nvar)
#' w <- matrix(0.1, Nvar, Nvar)
#' diag(w) <- 0
#' result1 <- make_2d_Isingland(m, w)
#' plot(result1)
#'
#' set.seed(1614)
#' sim1 <- simulate_Isingland(result1, initial = 5)
#' plot(sim1)
#' @export
simulate_Isingland <- function(l, ...) {
UseMethod("simulate_Isingland", l)
Expand Down
9 changes: 8 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/Sciurus365/Isinglandr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Sciurus365/Isinglandr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

A toolbox for constructing potential landscapes for Ising networks. The parameters of the networks can be directly supplied by users or estimated by the `IsingFit` package <https://CRAN.R-project.org/package=IsingFit> from empirical data. The Ising model's Boltzmann distribution is preserved for the potential landscape function. The landscape functions can be used for quantifying and visualizing the stability of network states, as well as visualizing the simulation process.
A toolbox for constructing potential landscapes for Ising
networks. The parameters of the networks can be directly supplied by
users or estimated by the `IsingFit` package by van Borkulo and
Epskamp (2016) <https://CRAN.R-project.org/package=IsingFit> from
empirical data. The Ising model's Boltzmann distribution is preserved
for the potential landscape function. The landscape functions can be
used for quantifying and visualizing the stability of network states,
as well as visualizing the simulation process.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ status](https://www.r-pkg.org/badges/version/Isinglandr)](https://CRAN.R-project

A toolbox for constructing potential landscapes for Ising networks. The
parameters of the networks can be directly supplied by users or
estimated by the `IsingFit` package
estimated by the `IsingFit` package by van Borkulo and Epskamp (2016)
<https://CRAN.R-project.org/package=IsingFit> from empirical data. The
Ising model’s Boltzmann distribution is preserved for the potential
landscape function. The landscape functions can be used for quantifying
Expand Down
6 changes: 6 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- This is a re-submission, in which the following issues were solved:
- Used only undirected quotation marks in the description text.
- Added reference to the 'IsingFit' package.
- Added \value and \arguments fields to some functions.
- Added several examples.

## Test environments

- local R installation in Windows R 4.2.2
Expand Down
2 changes: 1 addition & 1 deletion man/Isinglandr-package.Rd

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

9 changes: 0 additions & 9 deletions man/autolayer.Rd

This file was deleted.

3 changes: 3 additions & 0 deletions man/autolayer.resilience.Rd

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

9 changes: 0 additions & 9 deletions man/calculate_barrier.Rd

This file was deleted.

12 changes: 12 additions & 0 deletions man/make_2d_Isingland_matrix.Rd

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

9 changes: 9 additions & 0 deletions man/make_3d_Isingland.Rd

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

3 changes: 3 additions & 0 deletions man/make_Ising_grid-control-functions.Rd

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

19 changes: 19 additions & 0 deletions man/reexports.Rd

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

8 changes: 7 additions & 1 deletion man/shiny_Isingland_MDD.Rd

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

14 changes: 14 additions & 0 deletions man/simulate_Isingland.Rd

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

0 comments on commit a6bde82

Please sign in to comment.