Skip to content

Instantly share code, notes, and snippets.

View dhersz's full-sized avatar

Daniel Herszenhut dhersz

View GitHub Profile
library(data.table)
library(Hmisc)

set.seed(1)

# create data.table
n <- 100000
dt <- data.table(pop=runif(n), income=runif(n))
dt$group <- c(rep('A', n/2), rep('B', n/2))
for_loop <- function(n = 100L) {
  
  result <- vector(mode = "integer", length = n)
  
  for (i in 1L:n) {
    
    result[i] = i * 17L
    
  }
library(accessibility)
library(ggplot2)
data_dir <- system.file("extdata", package = "accessibility")
travel_matrix <- readRDS(file.path(data_dir, "travel_matrix.rds"))
land_use_data <- readRDS(file.path(data_dir, "land_use_data.rds"))
access <- cumulative_cutoff(
travel_matrix,
land_use_data,