diff --git a/docs/articles/Exampleproject.html b/docs/articles/Exampleproject.html index 64d3b90..6fa2966 100644 --- a/docs/articles/Exampleproject.html +++ b/docs/articles/Exampleproject.html @@ -142,7 +142,7 @@

Plot a modal split plot_mainmode_barchart(output_trips)

The resulting bar chart looks like this:

-

Leipzig modal split

+

Leipzig modal split

@@ -162,7 +162,7 @@

Spatial filterUsing plot_mainmode_barchart() on the 507 originating trips, results in the following chart:

-

Leipzig modal split - trips originating in project +

Leipzig modal split - trips originating in project area

@@ -181,7 +181,7 @@

Comparison plots #creating the comparison plot plot_compare_mainmode_barchart(trips_originating, trips_scenario_originating) -

The resulting plot looks like this: Leipzig modal split comparison

+

The resulting plot looks like this: Leipzig modal split comparison

Maps diff --git a/docs/articles/Introduction.html b/docs/articles/Introduction.html index e3499f0..7856233 100644 --- a/docs/articles/Introduction.html +++ b/docs/articles/Introduction.html @@ -102,7 +102,7 @@

Overall concept
-

Data flow and concept of matsim r package

+

Data flow and concept of matsim r package

The package is organized into four categories, each serving a specific purpose:

diff --git a/docs/articles/Leipzig_modal_split.png b/docs/articles/Leipzig_modal_split.png new file mode 100644 index 0000000..be5e6b5 Binary files /dev/null and b/docs/articles/Leipzig_modal_split.png differ diff --git a/docs/articles/Leipzig_modalsplit_comparison.png b/docs/articles/Leipzig_modalsplit_comparison.png new file mode 100644 index 0000000..2de768b Binary files /dev/null and b/docs/articles/Leipzig_modalsplit_comparison.png differ diff --git a/docs/articles/Leipzig_modalsplit_originating.png b/docs/articles/Leipzig_modalsplit_originating.png new file mode 100644 index 0000000..32000b6 Binary files /dev/null and b/docs/articles/Leipzig_modalsplit_originating.png differ diff --git a/docs/articles/Namings.html b/docs/articles/Namings.html index 3f4f380..10749ab 100644 --- a/docs/articles/Namings.html +++ b/docs/articles/Namings.html @@ -79,21 +79,249 @@ -
-library(matsim)
-#> Warning: replacing previous import 'ggplot2::last_plot' by 'plotly::last_plot'
-#> when loading 'matsim'
-#> Warning: replacing previous import 'lubridate::stamp' by 'reshape::stamp' when
-#> loading 'matsim'
-#> Warning: replacing previous import 'plotly::rename' by 'reshape::rename' when
-#> loading 'matsim'
-#> Warning: replacing previous import 'purrr::discard' by 'scales::discard' when
-#> loading 'matsim'
-#> Warning: replacing previous import 'readr::col_factor' by 'scales::col_factor'
-#> when loading 'matsim'
-#> Warning: replacing previous import 'reshape::expand' by 'tidyr::expand' when
-#> loading 'matsim'
- +
+

Overview +

+

All function names are built using the same naming template. +Functions start with a specific verb (e.g. read, plot, process) that +describes their main usage. They are sorted into [function types] +according to this usage.

+

This, and all following naming elements are followed by an +underscore. The second element is optional. It further specifies the +type of action that is performed and can be used to distinguish similar +functions. In the following guide this element is called +[clarification]. An example for this element is [compare], which is used +in all functions that compare two data sets.

+

The next element specifies the data or the columns used. For example +the column [mainmode] or the MATSim file [output_trips].

+

If the data is going to be sorted or filtered it can be necessary to +specify how. This is done using [by]. An example is the function +[plot_arrtime_by_act]: it plots the column [arrtime], which contains the +arrival time, by [act] or activity. Several of these can be connected +using [and].

+

The last element can be used to specify the output type. This is +important for the plotting functions where it specifies the type of +plot.

+
+
+

Template +

+

So to summarize every naming template looks similar to:

+

[function_type]_{clarification}_[data]_{by}_{category}_{and}_…_{output_type}

+

[function_type]: Describes the type of the function, +indicating its primary purpose or operation. For example, “plot” to plot +functions, “process” for data processing functions, “read” for functions +that read data into the R environment.

+
    +
  • plot
  • +
  • read
  • +
  • process
  • +
+

{clarification}: This part is optional and provides +additional details or clarification about the function’s purpose and +behavior. It helps to distinguish similar functions and variations of +the same function. For example, “compare” to indicate that the function +performs a comparison, “append” to indicate that the function appends +data, etc.

+

For plotting functions:

+
    +
  • compare
  • +
  • map
  • +
+

For processing functions:

+
    +
  • get
  • +
  • rename
  • +
  • append
  • +
  • filter
  • +
  • convert
  • +
+

[data]: Refers to the file or column that the +function is handling or manipulating. Examples include “arrtime” +(arrival time), “distance” (distance traveled), “mainmode” (main +transportation mode). Can be read with the function +str()

+

{by}: This part is optional and indicates that the +data is filtered or grouped by a specific category or factor. It serves +as a connector between the [data] and [category] components.

+

{category}: Indicates a specific category or +grouping factor that is used to filter or categorize the data. Examples +include “act” (activity), “spatialcat” (spatial category), “mainmode” +(main transportation mode).

+

{and}: This part is optional and is used as a +connector if there are multiple categories involved in the function’s +operation.

+

{output_type}: Indicates the type of output or +result that the function generates. It indicates the format or form of +the data returned by the function. Examples include “barchart,” +“piechart,” “linechart,” “table”.

+
+
+

Examples +

+
    +
  • plot_arrtime_by_act +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • arrtime: Refers to “Arrival Time,” which is the key aspect being +visualized.
    • +
    • by_act: Indicates that the plot is grouped by “Activity.”
    • +
    +
  • +
  • plot_compare_count_by_spatialcat_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • compare_count: Refers to comparing the count of trips.
    • +
    • by_spatialcat: Indicates that the comparison is based on “Spatial +Categories.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_compare_distcat_by_mainmode_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • compare_distcat: Refers to comparing the distribution of trips based +on “Distance Categories.”
    • +
    • by_mainmode: Indicates that the comparison is based on different +“Main Modes.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_compare_mainmode_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • compare_mainmode: Refers to comparing different “Main Modes.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_compare_mainmode_sankey +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • compare_mainmode: Refers to comparing different “Main Modes.”
    • +
    • sankey: Specifies the type of plot used for visualization, which is +a “Sankey Diagram.”
    • +
    +
  • +
  • plot_compare_travelwaittime_by_mainmode +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • compare_travelwaittime: Refers to comparing the “Travel Time” and +“Wait Time.”
    • +
    • by_mainmode: Indicates that the comparison is based on different +“Main Modes.”
    • +
    +
  • +
  • plot_compare_travelwaittime_by_mainmode_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • compare_travelwaittime: Refers to comparing the “Travel Time” and +“Wait Time.”
    • +
    • by_mainmode: Indicates that the comparison is based on different +“Main Modes.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_deptime_by_act +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • deptime: Refers to “Departure Time,” which is the key aspect being +visualized.
    • +
    • by_act: Indicates that the plot is segmented or grouped by +“Activity.”
    • +
    +
  • +
  • plot_distance_by_mainmode_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • distance: Refers to “Distance,” which is the key aspect being +visualized.
    • +
    • by_mainmode: Indicates that the plot is segmented or grouped by +different “Main Modes.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_distance_by_spatialcat_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • distance: Refers to “Distance,” which is the key aspect being +visualized.
    • +
    • by_spatialcat: Indicates that the plot is segmented or grouped by +“Spatial Categories.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_distcat_by_mainmode_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • distcat: Refers to “Distance Categories,” which is the key aspect +being visualized.
    • +
    • by_mainmode: Indicates that the plot is segmented or grouped by +different “Main Modes.”
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_mainmode_barchart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • mainmode: Refers to “Main Modes,” which is the key aspect being +visualized.
    • +
    • barchart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_mainmode_piechart +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • mainmode: Refers to “Main Modes,” which is the key aspect being +visualized.
    • +
    • piechart: Specifies the type of plot used for visualization.
    • +
    +
  • +
  • plot_map_trips +
      +
    • plot: Indicates that this function is used to plot data.
    • +
    • map_trips: Refers to “Mapping of Trips,” which is the key aspect +being visualized.
    • +
    +
  • +
  • process_append_distcat +
      +
    • process: Indicates that this function is used to process data.
    • +
    • append_distcat: Refers to appending “Distance Categories” to the +trips_table.
    • +
    +
  • +
  • process_append_spatialcat +
      +
    • process: Indicates that this function is used to process data.
    • +
    • append_spatialcat: Refers to appending “Spatial Categories” to the +trips_table.
    • +
    +
  • +
  • process_convert_table_to_sf +
      +
    • process: Indicates that this function is used to process data.
    • +
    • convert_table_to_sf: Refers to converting the trips_table to a +spatial data frame (sf).
    • +
    +
  • +
  • process_convert_time +
      +
    • process: Indicates that this function is used to process data.
    • +
    • convert_time: Refers to converting time data in the trips_table to a +specified format.
    • +
    +
  • +
  • process_filter_by_shape +
      +
    • process: Indicates that this function is used to process data.
    • +
    • filter_by_shape: Refers to filtering trips in the trips_table based +on a shape.
    • +
    +
  • +
+
+

diff --git a/docs/articles/dataflow.png b/docs/articles/dataflow.png new file mode 100644 index 0000000..02f8cf1 Binary files /dev/null and b/docs/articles/dataflow.png differ diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 8dfbb35..cece50d 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -5,7 +5,7 @@ articles: Exampleproject: Exampleproject.html Introduction: Introduction.html Namings: Namings.html -last_built: 2023-07-21T13:28Z +last_built: 2023-08-22T10:56Z urls: reference: https://vsp.berlin/matsim-r/reference article: https://vsp.berlin/matsim-r/articles diff --git a/docs/reference/figures/dataflow.png b/docs/reference/figures/dataflow.png new file mode 100644 index 0000000..02f8cf1 Binary files /dev/null and b/docs/reference/figures/dataflow.png differ diff --git a/docs/reference/index.html b/docs/reference/index.html index 71ad4e0..aaa5844 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -61,11 +61,6 @@

All functionsboxplotScoreDifferences() - -
Boxplot of Score Differences
-
- createCountScatterPlot()
Creates a Via-Style scatterplot for each run
@@ -76,7 +71,7 @@

All functionsloadNetwork() plotModalSplitPieChart() plotModalSplitBarChart() readTripsTable() plotAverageTravelWait() compareAverageTravelWait() plotModalDistanceDistribution() compareModalDistanceDistribution() plotTripDistanceByMode() plotTripCountByDepTime() plotActivityEndTimes() plotArrivalTimesPerTripPurpose() plotDepartureTimesPerTripPurpose() plotTripDistancedByType() plotModalShiftSankey() plotModalShiftBar() plotMapWithFilteredTrips() plotMapWithTrips() plotTripTypesPieChart() compareTripTypesBarChart() plotMapWithTripsType() compareBasePolicyOutput() compareBasePolicyShapeOutput() appendDistanceCategory() filterByRegion() deriveODMatrix() getCrsFromConfig() transformToSf() + loadNetwork() readPersonsTable() boxplotScoreDifferences() plotModalSplitPieChart() plotModalSplitBarChart() readTripsTable() plotAverageTravelWait() compareAverageTravelWait() plotModalDistanceDistribution() compareModalDistanceDistribution() plotTripDistanceByMode() plotTripCountByDepTime() plotActivityEndTimes() plotArrivalTimesPerTripPurpose() plotDepartureTimesPerTripPurpose() plotTripDistancedByType() plotModalShiftSankey() plotModalShiftBar() plotMapWithFilteredTrips() plotMapWithTrips() plotTripTypesPieChart() compareTripTypesBarChart() plotMapWithTripsType() compareBasePolicyOutput() compareBasePolicyShapeOutput() appendDistanceCategory() filterByRegion() deriveODMatrix() getCrsFromConfig() transformToSf()
Load MATSim network into memory

@@ -99,7 +94,7 @@

All functionsplot_compare_distcat_by_mainmode_barchart()

Bar chart comparing distance traveled on x-axis and number of trips on y-axis for two different runs -Takes two data frames (from read_output_trips()), categorizes the traveled distances into pre-defined bins +Takes two data frames (from read_output_trips), categorizes the traveled distances into pre-defined bins and plots the difference in number of trips for each bin. (Bins: 1000,2000,5000,10000,20000,50000,100000 (m)) Using the parameter unite_modes, specific modes can be renamed into one with the name specified with united_name (by default 'united')
@@ -114,6 +109,11 @@

All functionsplot_compare_score_boxplot() +

+
Boxplot of Score Differences
+
+ plot_compare_travelwaittime_by_mainmode()
Bar Chart comparing two runs with main_mode on x-axis and average travel/wait time on y-axis
@@ -166,8 +166,7 @@

All functionsplot_spatialtype_by_shape_piechart() -
Plots distribution of every type of trips(inside, outside, origin and destinating) in Pie Chart -XXXX
+
Plots distribution of every type of trip(inside, outside, origin and destinating) as a pie chart

plot_travelwaittime_mean_barchart() @@ -222,17 +221,12 @@

All functionsprocess_convert_time()

-
Converts time column specified in time_column to numeric representation of minutes, hours or seconds -XXXX here minute, hour and second don't have an s? -Default output_trips table time columns(dep_time, trav_time, wait_time) are in 'hms' format. -To convert this type to numeric, specify time_column to be converted, -and the unit time_format. Acceptable units are "hour", "minute" and "second".
+
Converts time column specified in time_column to numeric representation of minutes, hours or seconds
process_filter_by_shape()
-
XXXX finish when code revision is done -Filters trips_table(from ,read_output_trips()) depending by location using a shapefile
+
Filters trips_table(from ,read_output_trips) depending by location using a shapefile
process_get_crs_from_config() @@ -281,11 +275,6 @@

All functionsreadPersonsTable() -

-
Load MATSim output_persons table into memory
-
- read_config()
Load MATSIM config file into Memory
@@ -296,6 +285,11 @@

All functionsread_output_persons() + +
Load MATSim output_persons table into memory
+

+ read_output_trips()
Load MATSim output_trips table into memory
diff --git a/docs/reference/matsimr-deprecated.html b/docs/reference/matsimr-deprecated.html index b267ef4..6b911d2 100644 --- a/docs/reference/matsimr-deprecated.html +++ b/docs/reference/matsimr-deprecated.html @@ -5,54 +5,60 @@ The links table is automatically joined with the nodes table so that node x/y coordinates (and any other node attributes) are available on the links table without additional processing. +readPersonsTable - Loads a MATSim CSV output_persons from file or archive, +creating a tibble with columns as in csv file +copied + adopted code from readTripsTable in tripsOutput.R +boxplotScoreDifferences - function generates a boxplot to compare the score differences between two sets of data +represented by personTibble_base and personTibble_policy tibbles. +It provides insights into the distribution of score differences between the two sets of data. These functions are provided for compatibility with older version of the matsimr package. They may eventually be completely removed. -plotModalSplitPieChart - Takes Table trips_output (from read_output_trips()), +plotModalSplitPieChart - Takes Table trips_output (from read_output_trips), to plot pie chart with with values that represent percentage of using transport modes from trips -plotModalSplitBarChart - Takes Table trips_output (from read_output_trips()), +plotModalSplitBarChart - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent percentage of using transport modes from trips readTripsTable - Loads a MATSim output_trips file from file or archive path, creating a tibble -plotAverageTravelWait - Takes Table trips_output (from read_output_trips()), +plotAverageTravelWait - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent time spent on traveling/waiting Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotModalDistanceDistribution - Takes Table trips_output (from read_output_trips()), +plotModalDistanceDistribution - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent number of trips ~ distance travelled Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -compareModalDistanceDistribution - Takes 2 Tables trips_output (from read_output_trips()), +compareModalDistanceDistribution - Takes 2 Tables trips_output (from read_output_trips), to plot bar chart with with values that represent difference of number of trips between tripsTable2 and tripsTable1 ~ distance travelled Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotTripDistanceByMode - Takes Table trips_output (from read_output_trips()), +plotTripDistanceByMode - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent average distance traveled ~ main mode used Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotTripCountByDepTime - Takes Table trips_output (from read_output_trips()), +plotTripCountByDepTime - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of trips for a specific departure time by main_mode Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotActivityEndTimes - Takes Table trips_output (from read_output_trips()), +plotActivityEndTimes - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent the number of activities ending at a specific time. Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotArrivalTimesPerTripPurpose - Takes Table trips_output (from read_output_trips()), +plotArrivalTimesPerTripPurpose - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of destination activities for a specific arrival time Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotDepartureTimesPerTripPurpose - Takes Table trips_output (from read_output_trips()), +plotDepartureTimesPerTripPurpose - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of destination activities for a specific arrival time Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotTripDistancedByType - Takes Table trips_output (from read_output_trips()), +plotTripDistancedByType - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent travelled distance of each tripType related to the shapeTable -plotModalShiftSankey - Takes two trips_table (from readTripsTable), and collects +plotModalShiftSankey - Takes two trips_table (from read_output_trips), and collects changes between transport mode distribution of these tables to make alluvial diagram from this data Function calculates number of each transport mode used in @@ -60,7 +66,7 @@ distribution of transport mode has changed (f. e. what part of concrete trasport mode changed to another) Using parameter unite.columns transport modes that match PATTERN in unite.columns can be united in 1 transport mode type (by default united_name is "united") Using parameter show.onlyChanges -plotModalShiftBar - Takes two trips_table (from readTripsTable), and collects +plotModalShiftBar - Takes two trips_table (from read_output_trips), and collects changes between transport mode distribution of these tables to make bar chart diagram with dodging positioning from this data Function calculates number of each transport mode used in @@ -86,7 +92,7 @@ compareBasePolicyShapeOutput - Chooses a function to compare output_trips from the folders. baseFolder contains all base outputs, policyFolder contains all policy outputs. appendDistanceCategory - adds to trips output tibble additional column that represent distance as category -filterByRegion - Filtering of trips_table(from readTripsTable) depending on how they located in given shape +filterByRegion - Filtering of trips_table(from read_output_trips) depending on how they located in given shape Takes trips_table and shapeTable(sf object from file representing geographical data, can be received by using function st_read(path_to_file). Please be aware that this filterByRegion currently only works, when one geometry is loaded.) transforms both objects to match mutual CRS(network.xml from MATSimOutputDirectory) @@ -98,8 +104,8 @@ deriveODMatrix - Creates an instance of ODMatrix(origin/destination) in conventional form or for the simwrapper getCrsFromConfig - Reads an coordinate reference system of MATSim output directory from output_config.xml -transformToSf - Transforms trips_table tibble (from readTripsTable) from tibble to sf (table with attribute features and geometry feature) -Takes trips_table (from readTripsTable) and transforms trips_table to sf object using start_x, end_x, start_y, end_y as a geometry features +transformToSf - Transforms trips_table tibble (from read_output_trips) from tibble to sf (table with attribute features and geometry feature) +Takes trips_table (from read_output_trips) and transforms trips_table to sf object using start_x, end_x, start_y, end_y as a geometry features deletes from resulting data.frame start_x, end_x, start_y, end_y. And adds wkt column, if geometry.type = st_mulitpoint(), or geometry.type = st_linestring() Or adds start_wkt and end_wkt, if geometry.type = st_point() @@ -112,54 +118,60 @@ The links table is automatically joined with the nodes table so that node x/y coordinates (and any other node attributes) are available on the links table without additional processing. +readPersonsTable - Loads a MATSim CSV output_persons from file or archive, +creating a tibble with columns as in csv file +copied + adopted code from readTripsTable in tripsOutput.R +boxplotScoreDifferences - function generates a boxplot to compare the score differences between two sets of data +represented by personTibble_base and personTibble_policy tibbles. +It provides insights into the distribution of score differences between the two sets of data. These functions are provided for compatibility with older version of the matsimr package. They may eventually be completely removed. -plotModalSplitPieChart - Takes Table trips_output (from read_output_trips()), +plotModalSplitPieChart - Takes Table trips_output (from read_output_trips), to plot pie chart with with values that represent percentage of using transport modes from trips -plotModalSplitBarChart - Takes Table trips_output (from read_output_trips()), +plotModalSplitBarChart - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent percentage of using transport modes from trips readTripsTable - Loads a MATSim output_trips file from file or archive path, creating a tibble -plotAverageTravelWait - Takes Table trips_output (from read_output_trips()), +plotAverageTravelWait - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent time spent on traveling/waiting Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotModalDistanceDistribution - Takes Table trips_output (from read_output_trips()), +plotModalDistanceDistribution - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent number of trips ~ distance travelled Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -compareModalDistanceDistribution - Takes 2 Tables trips_output (from read_output_trips()), +compareModalDistanceDistribution - Takes 2 Tables trips_output (from read_output_trips), to plot bar chart with with values that represent difference of number of trips between tripsTable2 and tripsTable1 ~ distance travelled Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotTripDistanceByMode - Takes Table trips_output (from read_output_trips()), +plotTripDistanceByMode - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent average distance traveled ~ main mode used Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotTripCountByDepTime - Takes Table trips_output (from read_output_trips()), +plotTripCountByDepTime - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of trips for a specific departure time by main_mode Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotActivityEndTimes - Takes Table trips_output (from read_output_trips()), +plotActivityEndTimes - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent the number of activities ending at a specific time. Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotArrivalTimesPerTripPurpose - Takes Table trips_output (from read_output_trips()), +plotArrivalTimesPerTripPurpose - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of destination activities for a specific arrival time Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotDepartureTimesPerTripPurpose - Takes Table trips_output (from read_output_trips()), +plotDepartureTimesPerTripPurpose - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of destination activities for a specific arrival time Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united') -plotTripDistancedByType - Takes Table trips_output (from read_output_trips()), +plotTripDistancedByType - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent travelled distance of each tripType related to the shapeTable -plotModalShiftSankey - Takes two trips_table (from readTripsTable), and collects +plotModalShiftSankey - Takes two trips_table (from read_output_trips), and collects changes between transport mode distribution of these tables to make alluvial diagram from this data Function calculates number of each transport mode used in @@ -167,7 +179,7 @@ distribution of transport mode has changed (f. e. what part of concrete trasport mode changed to another) Using parameter unite.columns transport modes that match PATTERN in unite.columns can be united in 1 transport mode type (by default united_name is "united") Using parameter show.onlyChanges -plotModalShiftBar - Takes two trips_table (from readTripsTable), and collects +plotModalShiftBar - Takes two trips_table (from read_output_trips), and collects changes between transport mode distribution of these tables to make bar chart diagram with dodging positioning from this data Function calculates number of each transport mode used in @@ -193,7 +205,7 @@ compareBasePolicyShapeOutput - Chooses a function to compare output_trips from the folders. baseFolder contains all base outputs, policyFolder contains all policy outputs. appendDistanceCategory - adds to trips output tibble additional column that represent distance as category -filterByRegion - Filtering of trips_table(from readTripsTable) depending on how they located in given shape +filterByRegion - Filtering of trips_table(from read_output_trips) depending on how they located in given shape Takes trips_table and shapeTable(sf object from file representing geographical data, can be received by using function st_read(path_to_file). Please be aware that this filterByRegion currently only works, when one geometry is loaded.) transforms both objects to match mutual CRS(network.xml from MATSimOutputDirectory) @@ -205,8 +217,8 @@ deriveODMatrix - Creates an instance of ODMatrix(origin/destination) in conventional form or for the simwrapper getCrsFromConfig - Reads an coordinate reference system of MATSim output directory from output_config.xml -transformToSf - Transforms trips_table tibble (from readTripsTable) from tibble to sf (table with attribute features and geometry feature) -Takes trips_table (from readTripsTable) and transforms trips_table to sf object using start_x, end_x, start_y, end_y as a geometry features +transformToSf - Transforms trips_table tibble (from read_output_trips) from tibble to sf (table with attribute features and geometry feature) +Takes trips_table (from read_output_trips) and transforms trips_table to sf object using start_x, end_x, start_y, end_y as a geometry features deletes from resulting data.frame start_x, end_x, start_y, end_y. And adds wkt column, if geometry.type = st_mulitpoint(), or geometry.type = st_linestring() Or adds start_wkt and end_wkt, if geometry.type = st_point() @@ -260,7 +272,7 @@
@@ -271,53 +283,59 @@ The links table is automatically joined with the nodes table so that node x/y coordinates (and any other node attributes) are available on the links table without additional processing.

+

readPersonsTable - Loads a MATSim CSV output_persons from file or archive, +creating a tibble with columns as in csv file +copied + adopted code from readTripsTable in tripsOutput.R

+

boxplotScoreDifferences - function generates a boxplot to compare the score differences between two sets of data +represented by personTibble_base and personTibble_policy tibbles. +It provides insights into the distribution of score differences between the two sets of data.

These functions are provided for compatibility with older version of the matsimr package. They may eventually be completely -removed.

plotModalSplitPieChart - Takes Table trips_output (from read_output_trips()), +removed.

plotModalSplitPieChart - Takes Table trips_output (from read_output_trips), to plot pie chart with with values that represent percentage of using transport modes from trips

-

plotModalSplitBarChart - Takes Table trips_output (from read_output_trips()), +

plotModalSplitBarChart - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent percentage of using transport modes from trips

readTripsTable - Loads a MATSim output_trips file from file or archive path, creating a tibble

-

plotAverageTravelWait - Takes Table trips_output (from read_output_trips()), +

plotAverageTravelWait - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent time spent on traveling/waiting Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotModalDistanceDistribution - Takes Table trips_output (from read_output_trips()), +

plotModalDistanceDistribution - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent number of trips ~ distance travelled Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

compareModalDistanceDistribution - Takes 2 Tables trips_output (from read_output_trips()), +

compareModalDistanceDistribution - Takes 2 Tables trips_output (from read_output_trips), to plot bar chart with with values that represent difference of number of trips between tripsTable2 and tripsTable1 ~ distance travelled Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotTripDistanceByMode - Takes Table trips_output (from read_output_trips()), +

plotTripDistanceByMode - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent average distance traveled ~ main mode used Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotTripCountByDepTime - Takes Table trips_output (from read_output_trips()), +

plotTripCountByDepTime - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of trips for a specific departure time by main_mode Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotActivityEndTimes - Takes Table trips_output (from read_output_trips()), +

plotActivityEndTimes - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent the number of activities ending at a specific time. Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotArrivalTimesPerTripPurpose - Takes Table trips_output (from read_output_trips()), +

plotArrivalTimesPerTripPurpose - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of destination activities for a specific arrival time Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotDepartureTimesPerTripPurpose - Takes Table trips_output (from read_output_trips()), +

plotDepartureTimesPerTripPurpose - Takes Table trips_output (from read_output_trips), to make line plot with with values that represent count of destination activities for a specific arrival time Using parameters unite.columns, specific columns could be given, to unite them in 1 mode with the name united_name(by default 'united')

-

plotTripDistancedByType - Takes Table trips_output (from read_output_trips()), +

plotTripDistancedByType - Takes Table trips_output (from read_output_trips), to plot bar chart with with values that represent travelled distance of each tripType related to the shapeTable

-

plotModalShiftSankey - Takes two trips_table (from readTripsTable), and collects +

plotModalShiftSankey - Takes two trips_table (from read_output_trips), and collects changes between transport mode distribution of these tables to make alluvial diagram from this data
Function calculates number of each transport mode used in @@ -325,7 +343,7 @@ distribution of transport mode has changed (f. e. what part of concrete trasport mode changed to another) Using parameter unite.columns transport modes that match PATTERN in unite.columns can be united in 1 transport mode type (by default united_name is "united") Using parameter show.onlyChanges

-

plotModalShiftBar - Takes two trips_table (from readTripsTable), and collects +

plotModalShiftBar - Takes two trips_table (from read_output_trips), and collects changes between transport mode distribution of these tables to make bar chart diagram with dodging positioning from this data
Function calculates number of each transport mode used in @@ -351,7 +369,7 @@

compareBasePolicyShapeOutput - Chooses a function to compare output_trips from the folders. baseFolder contains all base outputs, policyFolder contains all policy outputs.

appendDistanceCategory - adds to trips output tibble additional column that represent distance as category

-

filterByRegion - Filtering of trips_table(from readTripsTable) depending on how they located in given shape
+

filterByRegion - Filtering of trips_table(from read_output_trips) depending on how they located in given shape
Takes trips_table and shapeTable(sf object from file representing geographical data, can be received by using function st_read(path_to_file). Please be aware that this filterByRegion currently only works, when one geometry is loaded.) transforms both objects to match mutual CRS(network.xml from MATSimOutputDirectory) @@ -363,8 +381,8 @@

deriveODMatrix - Creates an instance of ODMatrix(origin/destination) in conventional form or for the simwrapper

getCrsFromConfig - Reads an coordinate reference system of MATSim output directory from output_config.xml

-

transformToSf - Transforms trips_table tibble (from readTripsTable) from tibble to sf (table with attribute features and geometry feature)
-Takes trips_table (from readTripsTable) and transforms trips_table to sf object using start_x, end_x, start_y, end_y as a geometry features +

transformToSf - Transforms trips_table tibble (from read_output_trips) from tibble to sf (table with attribute features and geometry feature)
+Takes trips_table (from read_output_trips) and transforms trips_table to sf object using start_x, end_x, start_y, end_y as a geometry features deletes from resulting data.frame start_x, end_x, start_y, end_y.
And adds wkt column, if geometry.type = st_mulitpoint(), or geometry.type = st_linestring()
Or adds start_wkt and end_wkt, if geometry.type = st_point()
@@ -378,6 +396,10 @@

Usage

loadNetwork(filename)
 
+readPersonsTable(input_path = ".", n_max = Inf)
+
+boxplotScoreDifferences(personTibble_base, personTibble_policy)
+
 plotModalSplitPieChart(
   tripsTable,
   unite.columns = character(0),
@@ -563,8 +585,24 @@ 

Argumentsread_output_trips) or path to trips_output file

unite.columns
@@ -583,20 +621,12 @@

Argumentsread_output_trips,f.e. base case)

tripsTable2
-

tibble of trips_output (from read_output_trips(),f.e. policy case)

+

tibble of trips_output (from read_output_trips,f.e. policy case)

shapeTable
@@ -612,7 +642,7 @@

Argumentsread_output_trips)

start.inshape
@@ -673,6 +703,12 @@

Value

loadNetwork - "nodes" and "links" tibbles in a list object.

+

readPersonsTable - tibble of output_persons

+ + +

boxplotScoreDifferences - ggplot boxplot of the distribution of the score differences

+ +

plotModalSplitPieChart - Pie Chart plot of transport mode distribution, values given in percents

diff --git a/docs/reference/plot_arrtime_by_act.html b/docs/reference/plot_arrtime_by_act.html index 8afeb2e..83acc08 100644 --- a/docs/reference/plot_arrtime_by_act.html +++ b/docs/reference/plot_arrtime_by_act.html @@ -75,7 +75,7 @@

Usage

Arguments

trips_table
-

tibble of trips_output (from read_output_trips())

+

tibble of trips_output (from read_output_trips)

unite_activities
diff --git a/docs/reference/plot_compare_count_by_spatialcat_barchart.html b/docs/reference/plot_compare_count_by_spatialcat_barchart.html index 4b4186a..2dd1f86 100644 --- a/docs/reference/plot_compare_count_by_spatialcat_barchart.html +++ b/docs/reference/plot_compare_count_by_spatialcat_barchart.html @@ -76,15 +76,15 @@

Usage

Arguments

trips_table1
-

tible of trips_output (from read_output_trips())

+

tible of trips_output (from read_output_trips)

trips_table2
-

tible of trips_output (from read_output_trips())

+

tible of trips_output (from read_output_trips)

shape_table
-

A spatial shapefile or spatial polygons dataframe representing the spatial categories.

+

A spatial shapefile or spatial polygons data frame used to create the spatial categories.

crs
diff --git a/docs/reference/plot_compare_distcat_by_mainmode_barchart.html b/docs/reference/plot_compare_distcat_by_mainmode_barchart.html index 752262a..72a5e47 100644 --- a/docs/reference/plot_compare_distcat_by_mainmode_barchart.html +++ b/docs/reference/plot_compare_distcat_by_mainmode_barchart.html @@ -1,15 +1,15 @@ Bar chart comparing distance traveled on x-axis and number of trips on y-axis for two different runs -Takes two data frames (from read_output_trips()), categorizes the traveled distances into pre-defined bins +Takes two data frames (from read_output_trips), categorizes the traveled distances into pre-defined bins and plots the difference in number of trips for each bin. (Bins: 1000,2000,5000,10000,20000,50000,100000 (m)) Using the parameter unite_modes, specific modes can be renamed into one with the name specified with united_name (by default 'united') — plot_compare_distcat_by_mainmode_barchart • matsimPlot bar chart of changes in modal split — plot_compare_mainmode_barchart • matsimPlot bar chart of changes in modal split — plot_compare_mainmode_barchart • matsimPlot alluvial/sankey diagram of transport mode changes — plot_compare_mainmode_sankey • matsimPlot alluvial/sankey diagram of transport mode changes — plot_compare_mainmode_sankey • matsimBoxplot of Score Differences — plot_compare_score_boxplot • matsim + Skip to contents + + +
+
+
+ +
+

The boxplotScoreDifferences function generates a boxplot to compare the score differences between two sets of data +represented by personTibble_base and personTibble_policy tibbles. +It provides insights into the distribution of score differences between the two sets of data.

+
+ +
+

Usage

+
plot_compare_score_boxplot(personTibble_base, personTibble_policy)
+
+ +
+

Arguments

+
personTibble_base
+

persons tibble of the base case, can be loaded with readPersonsTable.

+ + +
personTibble_policy
+

persons tibble of the policy case, can be loaded with readPersonsTable.

+ +
+
+

Value

+ + +

ggplot boxplot of the distribution of the score differences

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/docs/reference/plot_compare_travelwaittime_by_mainmode.html b/docs/reference/plot_compare_travelwaittime_by_mainmode.html index f6813c9..c286017 100644 --- a/docs/reference/plot_compare_travelwaittime_by_mainmode.html +++ b/docs/reference/plot_compare_travelwaittime_by_mainmode.html @@ -1,7 +1,7 @@ -Bar Chart comparing two runs with main_mode on x-axis and average travel/wait time on y-axis — plot_compare_travelwaittime_by_mainmode • matsimBar Chart comparing two runs with main_mode on x-axis and average travel/wait time on y-axis — plot_compare_travelwaittime_by_mainmode • matsimComparison bar chart with main_mode on x-axis and average travel/wait time on y-axis — plot_compare_travelwaittime_by_mainmode_barchart • matsimComparison bar chart with main_mode on x-axis and average travel/wait time on y-axis — plot_compare_travelwaittime_by_mainmode_barchart • matsimBar chart with average distance traveled for each mode on x-axis and number of trips on y-axis — plot_distance_by_mainmode_barchart • matsimBar chart with average distance traveled for each mode on x-axis and number of trips on y-axis — plot_distance_by_mainmode_barchart • matsimBar Chart with tripType on x-axis and travelled distance on y-axis — plot_distance_by_spatialcat_barchart • matsimBar Chart with tripType on x-axis and travelled distance on y-axis — plot_distance_by_spatialcat_barchart • matsimBar Chart with distance traveled on x-axis and number of trips on y-axis — plot_distcat_by_mainmode_barchart • matsimBar Chart with distance traveled on x-axis and number of trips on y-axis — plot_distcat_by_mainmode_barchart • matsimPlot the distribution of modes as a bar chart — plot_mainmode_barchart • matsimPlot the distribution of modes as a bar chart — plot_mainmode_barchart • matsimPlots distribution of every type of trips(inside, outside, origin and destinating) in Pie Chart -XXXX — plot_spatialtype_by_shape_piechart • matsimPlots distribution of every type of trip(inside, outside, origin and destinating) as a pie chart — plot_spatialtype_by_shape_piechart • matsim @@ -49,15 +45,13 @@
-

Plots distribution of every type of trips(inside, outside, origin and destinating) in Pie Chart -XXXX

+

Plots distribution of every type of trip(inside, outside, origin and destinating) as a pie chart

@@ -68,22 +62,23 @@

Usage

Arguments

trips_table
-

tibble of trips_output (from read_output_trips())

+

tibble of trips_output (from read_output_trips)

-
shape_table
-

sf object(data.frame with geometries), can be received by using st_read(path_to_geographical_file)

+
crs
+

numeric representation of the EPSG code or proj4string for the corresponding coordinate system of the trip coordinates, +can be found in network file from output directory of MATSim simulation

-
crs
-

numeric of EPSG code or proj4string, can be found in network file from output directory of MATSim simulation

+
shape_Table
+

sf object(data frame with geometries), can be created using st_read(), is used to categorize the trips.

Value

-

plot with percentage of each type of trips

+

Pie chart showing the percentage of each type of trip