knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
All function names are created following the same pattern. They start with a specific verb (e.g. read, plot, process) that describes their main function. 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.
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.
{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:
For processing functions:
[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".
plot_arrtime_by_act
plot_compare_count_by_spatialcat_barchart
plot_compare_distcat_by_mainmode_barchart
plot_compare_mainmode_barchart
plot_compare_mainmode_sankey
plot_compare_travelwaittime_by_mainmode
plot_compare_travelwaittime_by_mainmode_barchart
plot_deptime_by_act
plot_distance_by_mainmode_barchart
plot_distance_by_spatialcat_barchart
plot_distcat_by_mainmode_barchart
plot_mainmode_barchart
plot_mainmode_piechart
plot_map_trips
process_append_distcat
process_append_spatialcat
process_convert_table_to_sf
process_convert_time
process_filter_by_shape
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.