Skip to content

Commit

Permalink
Documented more srr standards
Browse files Browse the repository at this point in the history
  • Loading branch information
japilo committed Apr 18, 2024
1 parent 5c9447e commit cd526ea
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 28 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Imports:
R6 (>= 2.5.0),
raster (>= 3.6),
trend (>= 1.1.4),
truncnorm (>= 1.0)
truncnorm (>= 1.0),
qs
Collate:
'GenericClass.R'
'Region.R'
Expand Down
4 changes: 3 additions & 1 deletion R/DispersalFriction.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#' R6 class representing a dispersal friction.
#'
#' @srrstats {G4.0} WHen it writes to disk, this function writes .RData files
#' only and does not accept any other specification of file type/suffix.
#'
#' @description
#' \code{\link[R6:R6Class]{R6}} class functionality for modeling sea, ice and other
#' frictional barriers to dispersal within a spatially-explicit population model. The
Expand Down
4 changes: 3 additions & 1 deletion R/GenericManager.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#' R6 class representing a generic manager.
#'
#' @srrstats {G4.0} When a results file suffix is not provided, this class
#' defaults to .RData.
#'
#' @description
#' \code{\link[R6:R6Class]{R6}} class to represent a generic (abstract) manager for
#' generating or processing simulation results, as well as optionally generating values
Expand Down
2 changes: 2 additions & 0 deletions R/ResultsManager.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#' R6 class representing a results manager.
#' @srrstats {G4.0} When a results file suffix is not provided, this class
#' fills it in with .RData.
#'
#' @description
#' \code{\link[R6:R6Class]{R6}} class to represent a manager for generating summary
Expand Down
2 changes: 2 additions & 0 deletions R/SimulationManager.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#' R6 class representing a simulation manager.
#' @srrstats {G4.0} When a results file suffix is not provided, this class
#' fills it in with .RData.
#'
#' @description
#' \code{\link[R6:R6Class]{R6}} class to represent a manager for running multiple model
Expand Down
2 changes: 2 additions & 0 deletions R/Validator.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#' R6 class representing a pattern-oriented validator.
#'
#' @srrstats {G1.3} We clearly define here what pattern-oriented validation is.
#' @srrstats {G4.0} When validation diagnostics are written to disk, they are
#' always written as .pdf files. No alternative file suffix is accepted.
#'
#' @description
#' \code{\link[R6:R6Class]{R6}} class for pattern-oriented validation and simulation
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ knitr::opts_chunk$set(
#' @srrstats {G1.3} Here we define the statistical term "pattern-oriented modeling."
#' @srrstats {G1.4} All documentation of functions and classes is done with roxygen2 tags.
#' There are no non-exported functions or classes.
#'
#' @srrstats {SP2.1} `poems` uses `sf` and not `sp`.
```

# poems: Pattern-oriented ensemble modeling system (for spatially explicit populations) <img src='man/figures/logo.svg' align="right" height="125" />
Expand Down
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<!-- badges: start -->

[![Paper_doi](https://img.shields.io/badge/doi-10.1111/2041--210X.13720-orange.svg)](https://doi.org/10.1111/2041-210X.13720)
[![CRAN_version](https://www.r-pkg.org/badges/version/poems)](https://cran.r-project.org/package=poems)
[![Codecov test
coverage](https://codecov.io/gh/GlobalEcologyLab/poems/branch/main/graph/badge.svg)](https://app.codecov.io/gh/GlobalEcologyLab/poems?branch=main)
[![Last
Expand Down Expand Up @@ -110,47 +111,47 @@ results <- population_simulator(pop_model)
results # examine
#> $all
#> $all$abundance
#> [1] 1031 1226 1249 1409 1358
#> [1] 977 1090 1238 1256 1341
#>
#> $all$abundance_stages
#> $all$abundance_stages[[1]]
#> [1] 603 748 724 868 789
#> [1] 574 643 755 731 847
#>
#> $all$abundance_stages[[2]]
#> [1] 428 478 525 541 569
#> [1] 403 447 483 525 494
#>
#>
#>
#> $abundance
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 55 118 191 202 186
#> [2,] 105 159 171 204 187
#> [3,] 114 157 164 183 163
#> [4,] 172 205 195 219 223
#> [5,] 177 198 183 213 216
#> [6,] 204 197 197 197 194
#> [7,] 204 192 148 191 189
#> [1,] 59 134 157 147 173
#> [2,] 90 102 157 169 197
#> [3,] 133 156 192 202 191
#> [4,] 168 149 154 180 168
#> [5,] 163 180 178 193 192
#> [6,] 171 181 192 189 219
#> [7,] 193 188 208 176 201
#>
#> $abundance_stages
#> $abundance_stages[[1]]
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 31 74 111 128 111
#> [2,] 65 94 95 121 104
#> [3,] 68 104 95 133 81
#> [4,] 97 113 118 120 142
#> [5,] 100 134 106 125 118
#> [6,] 120 116 110 122 114
#> [7,] 122 113 89 119 119
#> [1,] 28 76 100 83 108
#> [2,] 55 56 103 94 133
#> [3,] 83 91 108 121 115
#> [4,] 101 96 82 129 86
#> [5,] 95 109 113 102 141
#> [6,] 103 105 115 93 132
#> [7,] 109 110 134 109 132
#>
#> $abundance_stages[[2]]
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 24 44 80 74 75
#> [2,] 40 65 76 83 83
#> [3,] 46 53 69 50 82
#> [4,] 75 92 77 99 81
#> [5,] 77 64 77 88 98
#> [6,] 84 81 87 75 80
#> [7,] 82 79 59 72 70
#> [1,] 31 58 57 64 65
#> [2,] 35 46 54 75 64
#> [3,] 50 65 84 81 76
#> [4,] 67 53 72 51 82
#> [5,] 68 71 65 91 51
#> [6,] 68 76 77 96 87
#> [7,] 84 78 74 67 69
raster::plot(region$raster_from_values(results$abundance[, 5]),
main = "Final abundance", xlab = "Longitude (degrees)",
ylab = "Latitude (degrees)", zlim = c(0, 300), colNA = "blue"
Expand Down
Binary file modified man/figures/README-example-2.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 cd526ea

Please sign in to comment.