Skip to contents

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.