Skip to contents

Adds a iso line to a data frame. The iso lines are accumulated in rows at the bottom of the data frame.

Usage

add_iso(
  .DF = NULL,
  indexed = FALSE,
  meta,
  graph_type,
  iso_name,
  colour = ReboundTools::path_graph_params$energy_grid_colour,
  linewidth = ReboundTools::path_graph_params$energy_grid_linewidth,
  linetype = ReboundTools::path_graph_params$energy_grid_linetype,
  x_orig,
  y_orig,
  x,
  y,
  graph_df_colnames = ReboundTools::graph_df_colnames
)

Arguments

.DF

A data frame that accumulates iso lines. When NULL, the default, a new data frame is created and returned. When not NULL, rows for the segment are added to the bottom of .DF.

indexed

A boolean telling whether the rebound path should be indexed to 1 at its start.

meta

A data frame of metadata for the segment to be added. This metadata data frame provides the left-most columns of the return value.

graph_type

The type of graph associated with this segment. See ReboundTools::graph_types.

iso_name

A name for this iso line.

colour

The colour for this iso line. Default is ReboundTools::path_graph_params$energy_grid_colour.

linewidth

Line width. Default is ReboundTools::path_graph_params$energy_grid_size.

linetype

Line type for this iso line. Default is ReboundTools::path_graph_params$energy_grid_linetype.

x_orig, y_orig

The (x,y) coordinates of the starting point for the path on this graph, used for indexing.

x, y

The (x,y) coordinates of a point on this iso line. Slope and intercept are calculated from these values.

graph_df_colnames

A list of column names in graph data frames. Default is ReboundTools::graph_df_colnames.

Value

A version of .DF with iso lines added at the bottom.

Details

There is usually no need to call this function directly. Functions like iso_energy_lines() and iso_expenditure_lines() call add_iso() internally.

Examples

meta <- tibble::tibble(Case = "Test case")
add_iso(meta = meta, graph_type = "Test type", 
  iso_name = "Test segment", 
  x_orig = 10, y_orig = 10, 
  x = 20, y = 30)
#> # A tibble: 1 × 8
#>   Case      graph_type line_name    colour linewidth linetype slope intercept
#>   <chr>     <chr>      <chr>        <chr>      <dbl> <chr>    <dbl>     <dbl>
#> 1 Test case Test type  Test segment black        0.1 solid       -1        50