Coder Social home page Coder Social logo

cyclingpotential-hack's Issues

Reproducible example issue tmap

Running into an issue with the reproducible example (using R v3.6).

While package 'tmap' is successfully installed and unpacked, I'm not managing to get it loaded successfully:

install.packages("tmap")
"package ‘tmap’ successfully unpacked and MD5 sums checked"
library(tmap)
"Error: package or namespace load failed for ‘tmap’ in namespaceExport(ns, exports):
undefined exports: providers"

Tried to add 'dependencies = TRUE' to the install.packages command, but didn't solve the issue.

Possible to participate using Python?

Is it okay to participate as a Python-user?

Note: I understand that it would likely imply:

  • having to be able to transpose the learning from the materials to the Pythons setup,
  • not getting any Python-related support from the organizers

Add synthetic dataset at district level

The municipality-to-municipality OD data contains desire that are far apart. Reproducible example showing issues when using it to model cycling potential:

# from code/reproducible-example.R

remotes::install_github("itsleeds/pct")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'pct' from a github remote, the SHA1 (63ee1f7e) has not changed since last install.
#>   Use `force = TRUE` to force installation

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

u3 = "https://github.com/U-Shift/cyclingpotential-hack/releases/download/1.0/routes_integers_cs_balanced.geojson"
route_segments_balanced = sf::read_sf(u3)
routes_balanced = route_segments_balanced %>% 
  group_by(Origem, Destino) %>% 
  summarise(
    Origem = first(Origem),
    Destino = first(Destino),
    Bike = mean(Bike),
    All = mean(Bike) + mean(Car) + mean(Motorcycle) + mean(Transit) + mean(Walk) + mean(Other),
    Length_balanced_m = sum(distances),
    Hilliness_average = mean(gradient_segment),
    Hilliness_90th_percentile = quantile(gradient_segment, probs = 0.9)
  ) 
#> `summarise()` regrouping output by 'Origem' (override with `.groups` argument)
  # %>% 
  # sf::st_cast("LINESTRING")
# how to make them linestrings (not multilinestrings) without duplicating every segment?
unique(sf::st_geometry_type(routes_balanced))
#> [1] MULTILINESTRING
#> 18 Levels: GEOMETRY POINT LINESTRING POLYGON MULTIPOINT ... TRIANGLE
nrow(routes_balanced)
#> [1] 46
routes_balanced$pcycle_current = routes_balanced$Bike / routes_balanced$All
plot(routes_balanced["pcycle_current"])

m1 = lm(pcycle_current ~ Length_balanced_m, data = routes_balanced)
m2 = lm(pcycle_current ~ Length_balanced_m, data = routes_balanced, weights = All)
m3 = lm(pcycle_current ~ Length_balanced_m + Hilliness_average, data = routes_balanced)

m_pct = pct::model_pcycle_pct_2020(
  pcycle = routes_balanced$pcycle_current,
  distance = routes_balanced$Length_balanced_m,
  # gradient = routes_balanced$Hilliness_average,
  gradient = rep(1, nrow(routes_balanced)),
  weights = routes_balanced$All
  )

m_pct_govtarget_uk = pct::uptake_pct_govtarget_2020(
  distance = routes_balanced$Length_balanced_m,
  gradient = rep(1, nrow(routes_balanced))
)
#> Distance assumed in m, switching to km

plot(routes_balanced$Length_balanced_m, routes_balanced$pcycle_current, cex = routes_balanced$All / mean(routes_balanced$All), ylim = c(0, 0.1))
lines(routes_balanced$Length_balanced_m, m1$fitted.values)
lines(routes_balanced$Length_balanced_m, m2$fitted.values)
points(routes_balanced$Length_balanced_m, m3$fitted.values, col = "red")
points(routes_balanced$Length_balanced_m, m_pct$fitted.values, col = "green")
points(routes_balanced$Length_balanced_m, m_pct_govtarget_uk, col = "grey")

Created on 2020-08-24 by the reprex package (v0.3.0)

Use of counting points data

This is an open issue to discuss the "Use of counting points data".
Comments, approaches, and suggestions are welcome!

Cycling uptake functions

This is an open issue to discuss the "Cycling uptake functions".

Comments, approaches, and suggestions are welcome!

Team-making procedure

Are the applicants expected (or allowed) to form a team prior to the day of the event?

OD data count values

There don't seem to be many flows in od_data_final.csv, checking is this correct (i.e. it's just a test data set, doesn't contain real intra zonal flows)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.