dabreegster / odjitter

Disaggregate zone-based origin/destination data to specific points
Apache License 2.0
12 stars 6 forks source link

Example code fails #37

Open blackburnstat opened 2 years ago

blackburnstat commented 2 years ago

Hi. The code given in the vignette is not working for me (running R 4.2.0, RStudio 2022.07.1).

> library(odjitter)
Attaching package: ‘odjitter’
The following object is masked from ‘package:base’:
    jitter
> od <- readr::read_csv("https://github.com/dabreegster/odjitter/raw/main/data/od.csv")
Rows: 49 Columns: 11                                                                                                                     
── Column specification ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (2): geo_code1, geo_code2
dbl (9): all, from_home, train, bus, car_driver, car_passenger, bicycle, foot, other
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
> zones = sf::read_sf("https://github.com/dabreegster/odjitter/raw/main/data/zones.geojson")
> names(zones)[1] = "geo_code"
> road_network = sf::read_sf("https://github.com/dabreegster/odjitter/raw/main/data/road_network.geojson")
> od_unjittered = od::od_to_sf(od, zones)
0 origins with no match in zone ids
0 destinations with no match in zone ids
 points not in od data removed.
> set.seed(42) # for reproducibility
> od_jittered <- jitter(od, zones, subpoints = road_network)
Error in system(paste0(odjitter_location, " --help"), intern = TRUE) : 
  'odjitter' not found

Thanks for any help.

Robinlovelace commented 2 years ago

Hi @blackburnstat it looks like you need to install the odjitter Rust crate. You can verify that it is installed by entering the following command in your system command line console, e.g. Poweshell or ideally a Linux terminal:

odjitter

You should see something like this:

odjitter
odjitter 0.1.0
Dustin Carlino <dabreegster@gmail.com
Disaggregate origin/destination data from zones to points

USAGE:
    odjitter <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    disaggregate    Fully disaggregate input desire lines into output representing one trip
                        each, with a `mode` column
    help            Print this message or the help of the given subcommand(s)
    jitter          Import raw data and build an activity model for a region

I know others have had issues installing it on Windows so any feedback on how you get on would be very welcome.