diff --git a/DESCRIPTION b/DESCRIPTION index 9b86f9e..88cadad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: spacejamr Title: Simulate Spatial Bernoulli Networks -Version: 1.0.0 +Version: 0.1 Authors@R: person(given = "Darren", family = "Colby", @@ -19,7 +19,7 @@ Description: Social network analysis is becoming increasingly popular in many law or attenuated power law spatial interaction function; and generate a network object. Additionally, the package provides simple to use plotting methods for its classes that return plots which can be - further refined with the ggplot2 package. + further refined with the 'ggplot2' package. License: MIT + file LICENSE Encoding: UTF-8 LazyData: true diff --git a/R/NetSim.R b/R/NetSim.R index 32543f5..9344bbd 100644 --- a/R/NetSim.R +++ b/R/NetSim.R @@ -128,20 +128,20 @@ new_PowerLawNetwork <- function(point_sim, base_prob, scale, threshold, power) { #' #' @example \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' power_law <- PowerLawNetwork(mex_points, base_prob = 0.92, scale = 1, +#' ri_points <- PointProcess(1000, ri, 42) +#' power_law <- PowerLawNetwork(ri_points, base_prob = 0.92, scale = 1, #' threshold = 0.5, power = -2.4) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' power_law <- PowerLawNetwork(mex_seq, base_prob = 0.98, scale = 100, +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' power_law <- PowerLawNetwork(ri_seq, base_prob = 0.98, scale = 100, #' threshold = 0.5, power = -1.87) #' } #' @@ -287,20 +287,20 @@ new_APLNetwork <- function(point_sim, base_prob, scale, threshold, power) { #' #' @example \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' mex <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +#' ri_points <- PointProcess(1000, ri, 42) +#' apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, #' threshold = 0.5, power = -2.4) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +#' mex_seq <- HaltonSeq(1000, ri, 42) +#' apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, #' threshold = 0.5, power = -1.87) #' } #' @@ -345,21 +345,21 @@ APLNetwork <- function(point_sim, base_prob = 0.9, scale = 1, #' #' @examples \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +#' ri_points <- PointProcess(1000, ri, 42) +#' apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, #' threshold = 0.5, power = -2.4) #' plot(apl_points) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, #' threshold = 0.5, power = -1.87) #' plot(apl_seq) #' } @@ -397,21 +397,21 @@ plot.NetSim <- function(x, y, ..., layout = "stress", #' #' @examples \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +#' ri_points <- PointProcess(1000, ri, 42) +#' apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, #' threshold = 0.5, power = -2.4) #' print(apl_points) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, #' threshold = 0.5, power = -1.87) #' print(apl_seq) #' } @@ -438,21 +438,21 @@ print.NetSim <- function(x, ...) { #' #' @examples \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +#' ri_points <- PointProcess(1000, ri, 42) +#' apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, #' threshold = 0.5, power = -2.4) #' summary(apl_points) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, #' threshold = 0.5, power = -1.87) #' summary(apl_seq) #' } diff --git a/R/PointSim.R b/R/PointSim.R index 6348a54..e717f68 100644 --- a/R/PointSim.R +++ b/R/PointSim.R @@ -74,8 +74,8 @@ new_PointProcess <- function(points, window, seed) { #' #' @example \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") -#' mex_points <- PointProcess(1000, mex, 42) +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") +#' ri_points <- PointProcess(1000, ri, 42) #' } #' #' @author Darren Colby \cr @@ -164,8 +164,8 @@ new_HaltonSeq <- function(points, window, seed) { #' #' @example \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") -#' mex_seq <- HaltonSeq(1000, mex, 42) +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") +#' ri_seq <- HaltonSeq(1000, ri, 42) #' } #' #' @author Darren Colby \cr @@ -200,18 +200,18 @@ HaltonSeq <- function(points, window, seed = NULL) { #' #' @examples \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' plot(mex_points)} +#' ri_points <- PointProcess(1000, ri, 42) +#' plot(ri_points)} #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' plot(mex_seq) +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' plot(ri_seq) #' } #' #' @author Darren Colby \cr @@ -246,19 +246,19 @@ plot.PointSim <- function(x, y, ..., title = "Simulated Points", color = "red") #' #' @examples \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' print(mex_points) +#' ri_points <- PointProcess(1000, ri, 42) +#' print(ri_points) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' print(mex_seq) +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' print(ri_seq) #' } #' #' @author Darren Colby \cr @@ -284,19 +284,19 @@ print.PointSim <- function(x, ...) { #' #' @examples \dontrun{ #' # Create spacejamr object -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' \dontrun{ #' # With PointProcess -#' mex_points <- PointProcess(1000, mex, 42) -#' summary(mex_points) +#' ri_points <- PointProcess(1000, ri, 42) +#' summary(ri_points) #' } #' #' \dontrun{ #' # With HaltonSeq -#' mex_seq <- HaltonSeq(1000, mex, 42) -#' summary(mex_seq) +#' ri_seq <- HaltonSeq(1000, ri, 42) +#' summary(ri_seq) #' } #' #' @author Darren Colby \cr diff --git a/R/compare.R b/R/compare.R index 7138d1b..dc41a55 100644 --- a/R/compare.R +++ b/R/compare.R @@ -26,14 +26,14 @@ #' #' @example \dontrun{ #' # load data -#' data("mexico) +#' data("RI") #' #' # Simulate point process -#' mex_points <- PointProcess(50, mexico) +#' ri_points <- PointProcess(50, RI) #' #' # Create two networks -#' pl <- PowerLawNetwork(mex_points) # Standard power law -#' apl <- APLNetwork(mex_points) # Attenuated power law +#' pl <- PowerLawNetwork(ri_points) # Standard power law +#' apl <- APLNetwork(ri_points) # Attenuated power law #' #' compare_networks(pl, apl) #' } diff --git a/R/package.R b/R/package.R index 616551a..b181916 100644 --- a/R/package.R +++ b/R/package.R @@ -11,7 +11,7 @@ #' APLNetwork \cr #' compare_networks \cr #' HaltonSeq \cr -#' mexico \cr +#' RI \cr #' plot.NetSim \cr #' plot.PointSim \cr #' plot.spacejamr \cr diff --git a/R/mexico.R b/R/ri.R similarity index 52% rename from R/mexico.R rename to R/ri.R index 98edda5..8d379e0 100644 --- a/R/mexico.R +++ b/R/ri.R @@ -1,16 +1,16 @@ -#' Geographical administrative level 0 boundary of Mexico. +#' Geographical boundary of Rhode Island. #' #' A dataset containing Mexico's border and the coordinate reference system in -#' which Mexico's border is projected. +#' which RHode Island's border is projected. #' #' @format A spacejamr object with an owin window object and an integer denoting #' the projected coordinate reference system: #' \describe{ -#' \item{window}{geographical boundary of Mexico} +#' \item{window}{geographical boundary of Rhode Island} #' \item{crs}{the EPSG code for the coordinate reference system of the window} #' ... #' } -#' @source \url{https://data.humdata.org/dataset/mexican-administrative-level-0-country-1-estado-and-2-municipio-boundary-polygons} -"mexico" +#' @source \url{https://www.rigis.org/datasets/edc::state-boundary-1989/about} +"RI" diff --git a/R/spacejamr.R b/R/spacejamr.R index d1a5559..91fbe3f 100644 --- a/R/spacejamr.R +++ b/R/spacejamr.R @@ -80,7 +80,7 @@ new_spacejamr <- function(path) { #' @return a spacejamr object #' #' @example \dontrun{ -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") #' } #' #' @author Darren Colby \cr @@ -114,8 +114,8 @@ as.spacejamr <- function(path) { #' @return A ggplot2 object #' #' @example \dontrun{ -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") -#' plot(mex) +#' ri <- as.spacejamr("Z:shapefiles/ri.shp") +#' plot(ri) #' } #' #' @author Darren Colby \cr @@ -148,8 +148,8 @@ plot.spacejamr <- function(x, y, ..., title = "Spatial Window", fill = "blue") { #' package. #' #' @example \dontrun{ -#' mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") -#' print(mex) +#' mex <- as.spacejamr("Z:shapefiles/ri.shp") +#' print(ri) #' } #' #' @author Darren Colby \cr @@ -174,8 +174,8 @@ print.spacejamr <- function(x, ...) { #' package. #' #' @example \dontrun{ -#' mex <- spacejamr("Z:shapefiles/mexico_adm0.shp") -#' summary(mex) +#' mex <- spacejamr("Z:shapefiles/ri.shp") +#' summary(ri) #' } #' #' @author Darren Colby \cr diff --git a/README.md b/README.md index 71ab4cf..764b15a 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,17 @@ Simulate a Poisson point process and use it to generate a power law network: library(spacejamr) ## load mexico dataset -data(mexico) +data(RI) ## Simulate a spatial Poisson point process -mex_points <- PointProcess(points = 5000, window = mexico, seed = 88) +ri_points <- PointProcess(points = 5000, window = RI, seed = 88) ## Generate a standard power law network -mexnet <- PowerLawNetwork(point_process = mex_points, base_prob = 0.95, - scale = 1000, threshold = 0.5, power = -2.3) +rinet <- PowerLawNetwork(point_process = ri, base_prob = 0.95, scale = 100, + threshold = 0.5, power = -2.3) ## Visualize the new network -plot(mexnet) +plot(rinet) ``` diff --git a/cran-comments.md b/cran-comments.md index 8a2273c..4318169 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,19 +1,10 @@ ## Resubmission This is a resubmission. In this version I have: -* Changed the spelling of "ggplot" to "ggplot2" in the description file. +* Changed the spelling of "ggplot" to 'ggplot2' in the description file. -* Changed "orignially" to "originally" in the description file. +* Replaced the sample dataset with a smaller dataset to save space. -* Changed "possiblt" to "possibly" in the description file. - -* Replaced "spacejamr" with "this package." - -* Removed the package name from the title field. - -* Changed the title from sentence case to title case in the description file. - -* Created a cran-comments.md file in the correct directory. ## Test environments * local R installation, R 4.1.0 diff --git a/data/RI.rda b/data/RI.rda new file mode 100644 index 0000000..3149e6a Binary files /dev/null and b/data/RI.rda differ diff --git a/data/mexico.rda b/data/mexico.rda deleted file mode 100644 index caee6ae..0000000 Binary files a/data/mexico.rda and /dev/null differ diff --git a/inst/extdata/points.rds b/inst/extdata/points.rds index 069822e..0d92907 100644 Binary files a/inst/extdata/points.rds and b/inst/extdata/points.rds differ diff --git a/man/mexico.Rd b/man/RI.Rd similarity index 54% rename from man/mexico.Rd rename to man/RI.Rd index 2557491..8b611d2 100644 --- a/man/mexico.Rd +++ b/man/RI.Rd @@ -1,26 +1,26 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/mexico.R +% Please edit documentation in R/ri.R \docType{data} -\name{mexico} -\alias{mexico} -\title{Geographical administrative level 0 boundary of Mexico.} +\name{RI} +\alias{RI} +\title{Geographical boundary of Rhode Island.} \format{ A spacejamr object with an owin window object and an integer denoting the projected coordinate reference system: \describe{ -\item{window}{geographical boundary of Mexico} +\item{window}{geographical boundary of Rhode Island} \item{crs}{the EPSG code for the coordinate reference system of the window} ... } } \source{ -\url{https://data.humdata.org/dataset/mexican-administrative-level-0-country-1-estado-and-2-municipio-boundary-polygons} +\url{https://www.rigis.org/datasets/edc::state-boundary-1989/about} } \usage{ -mexico +RI } \description{ A dataset containing Mexico's border and the coordinate reference system in -which Mexico's border is projected. +which RHode Island's border is projected. } \keyword{datasets} diff --git a/man/plot.NetSim.Rd b/man/plot.NetSim.Rd index 0b42fd5..2f7c8cb 100644 --- a/man/plot.NetSim.Rd +++ b/man/plot.NetSim.Rd @@ -44,21 +44,21 @@ using standard ggraph and ggplot facilities. \examples{ \dontrun{ # Create spacejamr object -mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +ri <- as.spacejamr("Z:shapefiles/ri.shp") } \dontrun{ # With PointProcess -mex_points <- PointProcess(1000, mex, 42) -apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +ri_points <- PointProcess(1000, ri, 42) +apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, threshold = 0.5, power = -2.4) plot(apl_points) } \dontrun{ # With HaltonSeq -mex_seq <- HaltonSeq(1000, mex, 42) -apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +ri_seq <- HaltonSeq(1000, ri, 42) +apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, threshold = 0.5, power = -1.87) plot(apl_seq) } diff --git a/man/plot.PointSim.Rd b/man/plot.PointSim.Rd index d8360ec..c3a9ca1 100644 --- a/man/plot.PointSim.Rd +++ b/man/plot.PointSim.Rd @@ -30,18 +30,18 @@ The returned plot can be refined with standard ggplot2 functions \examples{ \dontrun{ # Create spacejamr object -mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +ri <- as.spacejamr("Z:shapefiles/ri.shp") } \dontrun{ # With PointProcess -mex_points <- PointProcess(1000, mex, 42) -plot(mex_points)} +ri_points <- PointProcess(1000, ri, 42) +plot(ri_points)} \dontrun{ # With HaltonSeq -mex_seq <- HaltonSeq(1000, mex, 42) -plot(mex_seq) +ri_seq <- HaltonSeq(1000, ri, 42) +plot(ri_seq) } } diff --git a/man/print.NetSim.Rd b/man/print.NetSim.Rd index a917308..09a6055 100644 --- a/man/print.NetSim.Rd +++ b/man/print.NetSim.Rd @@ -20,21 +20,21 @@ Plots a NetSim object and returns a ggraph object \examples{ \dontrun{ # Create spacejamr object -mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +ri <- as.spacejamr("Z:shapefiles/ri.shp") } \dontrun{ # With PointProcess -mex_points <- PointProcess(1000, mex, 42) -apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +ri_points <- PointProcess(1000, ri, 42) +apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, threshold = 0.5, power = -2.4) print(apl_points) } \dontrun{ # With HaltonSeq -mex_seq <- HaltonSeq(1000, mex, 42) -apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +ri_seq <- HaltonSeq(1000, ri, 42) +apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, threshold = 0.5, power = -1.87) print(apl_seq) } diff --git a/man/print.PointSim.Rd b/man/print.PointSim.Rd index 17d8745..8f21faa 100644 --- a/man/print.PointSim.Rd +++ b/man/print.PointSim.Rd @@ -18,19 +18,19 @@ which inherit methods from the PointSim class. \examples{ \dontrun{ # Create spacejamr object -mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +ri <- as.spacejamr("Z:shapefiles/ri.shp") } \dontrun{ # With PointProcess -mex_points <- PointProcess(1000, mex, 42) -print(mex_points) +ri_points <- PointProcess(1000, ri, 42) +print(ri_points) } \dontrun{ # With HaltonSeq -mex_seq <- HaltonSeq(1000, mex, 42) -print(mex_seq) +ri_seq <- HaltonSeq(1000, ri, 42) +print(ri_seq) } } diff --git a/man/spacejamr.Rd b/man/spacejamr.Rd index dc5e03d..515a6ca 100644 --- a/man/spacejamr.Rd +++ b/man/spacejamr.Rd @@ -17,7 +17,7 @@ networks. APLNetwork \cr compare_networks \cr HaltonSeq \cr -mexico \cr +RI \cr plot.NetSim \cr plot.PointSim \cr plot.spacejamr \cr diff --git a/man/summary.NetSim.Rd b/man/summary.NetSim.Rd index 51c8c9c..08a75e9 100644 --- a/man/summary.NetSim.Rd +++ b/man/summary.NetSim.Rd @@ -20,21 +20,21 @@ Prints a summary of a NetSim object \examples{ \dontrun{ # Create spacejamr object -mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +ri <- as.spacejamr("Z:shapefiles/ri.shp") } \dontrun{ # With PointProcess -mex_points <- PointProcess(1000, mex, 42) -apl_points <- APLNetwork(mex_points, base_prob = 0.92, scale = 1, +ri_points <- PointProcess(1000, ri, 42) +apl_points <- APLNetwork(ri_points, base_prob = 0.92, scale = 1, threshold = 0.5, power = -2.4) summary(apl_points) } \dontrun{ # With HaltonSeq -mex_seq <- HaltonSeq(1000, mex, 42) -apl_seq <- APLNetwork(mex_seq, base_prob = 0.98, scale = 100, +ri_seq <- HaltonSeq(1000, ri, 42) +apl_seq <- APLNetwork(ri_seq, base_prob = 0.98, scale = 100, threshold = 0.5, power = -1.87) summary(apl_seq) } diff --git a/man/summary.PointSim.Rd b/man/summary.PointSim.Rd index b8f5718..8cf20fe 100644 --- a/man/summary.PointSim.Rd +++ b/man/summary.PointSim.Rd @@ -18,19 +18,19 @@ HaltonSeq object, whcih are both child classes of the PointSim class. \examples{ \dontrun{ # Create spacejamr object -mex <- as.spacejamr("Z:shapefiles/mexico_adm0.shp") +ri <- as.spacejamr("Z:shapefiles/ri.shp") } \dontrun{ # With PointProcess -mex_points <- PointProcess(1000, mex, 42) -summary(mex_points) +ri_points <- PointProcess(1000, ri, 42) +summary(ri_points) } \dontrun{ # With HaltonSeq -mex_seq <- HaltonSeq(1000, mex, 42) -summary(mex_seq) +ri_seq <- HaltonSeq(1000, ri, 42) +summary(ri_seq) } } diff --git a/tests/testthat/test-PointSim.R b/tests/testthat/test-PointSim.R index 2338f73..b144aac 100644 --- a/tests/testthat/test-PointSim.R +++ b/tests/testthat/test-PointSim.R @@ -1,20 +1,20 @@ library(spacejamr) # Data used for testing -data("mexico") +data("RI") test_that("we can simulate point processes", { - mex_points <- PointProcess(10, mexico) + ri_points <- PointProcess(10, RI) # Ensure correct class - expect_identical(class(mex_points), c("PointProcess", "PointSim")) + expect_identical(class(ri_points), c("PointProcess", "PointSim")) }) test_that("we can generate a Halton Sequence", { - mex_points <- HaltonSeq(10, mexico) + ri_points <- HaltonSeq(10, RI) # Ensure correct class - expect_identical(class(mex_points), c("HaltonSeq", "PointSim")) + expect_identical(class(ri_points), c("HaltonSeq", "PointSim")) }) diff --git a/tests/testthat/test-compare.R b/tests/testthat/test-compare.R index ceae617..9e43c42 100644 --- a/tests/testthat/test-compare.R +++ b/tests/testthat/test-compare.R @@ -3,10 +3,10 @@ library(spacejamr) test_that("we can compare summary statistics of two networks", { # Load data for the test - data("mexico") - mex_points <- PointProcess(10, mexico) - pl <- PowerLawNetwork(mex_points) - apl <- APLNetwork(mex_points) + data("RI") + ri_points <- PointProcess(3, RI) + pl <- PowerLawNetwork(ri_points) + apl <- APLNetwork(ri_points) # Ensure the output is the correct class expect_identical(class(compare_networks(pl, apl)), "data.frame")