tests/testthat/test-objects.R

# test_that("multiplication works", {
#   expect_equal(2 * 2, 4)
# })
#
# sc <- sf::st_geometry(uitk::suffolk_county)
#
# sc
#
#
# nb <- st_contiguity(sc)
#
# wt <- st_weights(nb)
#
#
# x <- uitk::acs_raw$bach
#
#
# # Missing values ----------------------------------------------------------
# library(spdep)
# library(dplyr)
# devtools::load_all()
#
# acs <- select(uitk::acs_raw,
#               fips = ct_id_10, med_house_income,
#               by_pub_trans, bach) %>%
#   mutate(fips = as.character(fips))
#
# acs_sf <- left_join(uitk::suffolk_county, acs, by = "fips")
#
# x <- acs_sf$med_house_income
#
# nb <- st_contiguity(st_geometry(acs_sf))
#
# wt <- st_weights(nb)
#
# listw <- recreate_listw(nb, wt)
#
# lag.listw(listw, x, NAOK = F)

Try the sfdep package in your browser

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

sfdep documentation built on Jan. 11, 2023, 9:08 a.m.