tests/testthat/test-compare.R

library(spacejamr)

# Load data for the test
data("RI")
ri_points <- PointSim(3, RI)
pl <- NetSim(ri_points)
apl <- NetSim(ri_points)

test_that("we can compare summary statistics of two networks", {

    # Ensure the output is the correct class
    expect_equal(class(suppressWarnings(compare_networks(pl, apl))),
                 c("tbl_df", "tbl", "data.frame"))

    # Ensure the returned dataframe has the correct number of dimensions
    expect_equal(dim(suppressWarnings(compare_networks(pl, apl))), c(2, 5))

})

Try the spacejamr package in your browser

Any scripts or data that you put into this service are public.

spacejamr documentation built on April 2, 2022, 1:07 a.m.