Trying different methods to clean polygons to remove slivers
library(sf)
library(dplyr)
library(lwgeom)
# using planar geometry
sf::sf_use_s2(FALSE)
| library(r5r) | |
| library(mapview) | |
| # build transport network | |
| data_path <- system.file("extdata/spo", package = "r5r") | |
| r5r_core <- setup_r5(data_path) | |
| # load origin/destination points | |
| points <- read.csv(file.path(data_path, "spo_hexgrid.csv")) | |
| origin_1 <- subset(points, id =='89a8100c393ffff') | 
| library(flightsbr) | |
| library(ggplot2) | |
| library(data.table) | |
| # download data | |
| df <- flightsbr::read_flights(date = 2019:2023) | |
| # filters | |
| df <- df[ nr_ano_chegada_real >= 2019,] | |
| df_rj <- df[ sg_iata_origem %in% c('SDU', 'GIG') | | 
| library(sfdep) | |
| library(data.table) | |
| library(cppRouting) | |
| # get distance between neighbors | |
| geo <- sf::st_geometry(guerry) | |
| nb <- sfdep::st_contiguity(geo) | |
| dists <- sfdep::st_nb_dists(geo, nb) | 
| # Library | |
| library(ggplot2) | |
| library(viridis) | |
| # Dummy data | |
| set.seed(42) | |
| x <- LETTERS[1:20] | |
| y <- paste0("var", seq(1,20)) | |
| data <- expand.grid(X=x, Y=y) | |
| data$Z <- runif(400, 0, 10000) | 
| library(sf) | |
| library(terra) | |
| library(gdalio) | |
| library(geobr) | |
| ### Choose either a small or large area | |
| i = 49 # small area | |
| i = 1066 # large area | 
library(gtfstools)
# read gtfs
data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
gtfs <- read_gtfs(data_path)
# merge trips and freq
trip_df <- merge(gtfs$trips, gtfs$frequencies)
análise rápida dos dados de evolução diária do N. de bagagens pagas e gratuidas X Km
#' data downloaded from ANAC using flightsbr, https://github.com/ipeaGIT/flightsbr
#' data dictionary at https://www.gov.br/anac/pt-br/assuntos/regulados/empresas-aereas/envio-de-informacoes/descricao-de-variaveis
library(flightsbr)
library(data.table)
| #' Comparing air passenger demand over time in Brazil | |
| #' Reproducible code to create a figure visualizing how daily air passenger demand in Brazil has changed over time. | |
| ### Load libraries | |
| library(ggplot2) | |
| library(flightsbr) | |
| library(lubridate) | |
| library(data.table) | 
Quick reproducible example showing how to use the r5r package to estimate cycling, walking and driving routes in R.
options(java.parameters = "-Xmx4G")
library(r5r)
library(geobr)