Convert data.frame to plotly line segment format
Arguments
- x
numeric matrix of coordinates, where x,y,z coordinates are present twice per row, and whose colnames are defined by
axes1andaxes2.- axes1
vector of colnames(x) corresponding to the x,y,z coordinates of the first point in a line segment. It can be of any length, but is intended for length 2 or 3.
- axes2
vector of colnames(x) corresponding to the x,y,z coordinates of the second point in a line segment. It must be the same length as
axes1.- ...
additional parameters are ignored.
Value
data.frame where every two rows represents a line segment to be drawn by plotly, followed by a blank line indicating the line ends.
Details
Purpose is to take a data.frame containing (x,y) or (x,y,z) coordinates for two points defined on one row, and create a data.frame with 3 rows where blank coordinates are used to separate each line segment. The main benefit in using this function is that it enables vectorized line segment drawing when used with a plotting function that recognizes line breaks via empty rows, for example plotly.
See also
Other Internal utility functions:
combineGRcoverage(),
compressPolygonM(),
df2colorSub(),
escapeWhitespaceRegexp(),
factor2label(),
geomean(),
intercalate(),
internal_junc_score(),
jamGeomean(),
list2im(),
shrinkMatrix(),
simplifyXY(),
stackJunctions(),
strsplitOrdered()