knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Travis build status Coverage status AppVeyor Build Status

imthcm

Introduction

REMEDIO stands for “REgenerating mixed-use MED urban communities congested by traffic through Innovative low carbon mobility sOlutions”.

REMEDIO is funded by Interreg MED Program 2014-2020 through the European Regional Developed Fund (ERDF) (https://remedio.interreg-med.eu/)

REMEDIO implements concrete actions to relieve traffic congestion in middle-size Mediterranean cities where territorial institutions, supported by research/technical partners, are involved as beneficiary partners.

REMEDIO is a testing project and is developed in 3 steps.

The goal of imthcm is to provide the health and cost modules for the Integrated Modelling Tool of REMEDIO project.

Installation

You can install the development version from GitHub with the following procedure:

install.packages("devtools", dependencies = TRUE)
devtools::install_github("UBESP-DCTV/imthcm")
library(imthcm)
check_pkg()

## Furter check for a particouar version of mgcv
if (packageVersion('mgcv') < 1.8.23) {
  please_install('mgcv', dependencies = TRUE)
}

Now you have installed and loaded all the necessary package for the modules. The modules and the example files are in the package folder inst/modules/ and inst/test_xml/ respectively. Once installed, those folder where put one level up, i.e. out of the inst/ folder. You can have a direct access to those going into the corresponding system folder:

system.file('modules', 'hm.R', package = 'imthcm')
system.file('modules', 'cm.R', package = 'imthcm')

system.file('test_xml', 'test_event_history.xml',   package = 'imthcm')
system.file('test_xml', 'test_weather_history.xml', package = 'imthcm')
system.file('test_xml', 'test_weather_new.xml',     package = 'imthcm')
system.file('test_xml', 'test_cost_data.xml',       package = 'imthcm')

To run the modules on a linux machine, you have to let the system know that they are "executable" by

chmod +x path/to/modules/folder/hm.R
chmod +x path/to/modules/folder/cm.R

Note, you can copy those files and run them everywhere you prefer: the modules automatically load the package and find inside every function they need. So suppose you have the Health Module in ./ and the examples XML files in ./test_xml/ folder respectively. So, e.g., you can run the module with italian defaults training data and models by the following command

./hm.R -d -n ./test_xml/test_weather_new.xml -o my_hm_output.xml -f my_hm_figure.png

Or using the test XML history files (and also changing the figure device) by

./hm.R -w ./test_xml/test_weather_history.xml -e ./test_xml/test_event_history.xml -n ./test_xml/test_weather_new.xml -o my_hm_output.xml -f my_hm_figure.pdf

The same for the cost module, which should recieve in imput the output of the health modules. Hence, continuing our examples, cm can be run using default cost data by

./cm.R -e my_hm_output.xml -d -o my_cm_output.xml -f my_cm_figure.png

or providing custom cost data by

./cm.R -e my_hm_output.xml -c ./test_xml/test_cost_data.xml -o my_cm_output.xml -f my_cm_figure.png

(Please note that the last to command line will provide exactly the same output because the default cost data are the ones stored in ./test_xml/test_cost_data.xml)

Bug reports

If you encounter a bug, please file a reprex (minimal reproducible example) to



UBESP-DCTV/imthcm documentation built on Dec. 2, 2019, 9:26 a.m.