Description Usage Arguments Value Examples
View source: R/ssn2DataFrames.R
This function takes a SpatialStreamNetwork and returns a list of one to three data.frame objects. The first data.frame object is for the stream edges and the second is for the observed points. The third data.frame is only produced when preds = TRUE
. An example of how function could be used is to convert a SpatialStreamNetwork into a series of data.frame
objects to plot with ggplot2
.
1 | ssn2DataFrames(ssn, preds = FALSE)
|
ssn |
An object of class SpatialStreamNetwork. |
preds |
A logical to specify whether the prediction points in the SSN (if any) should be coerced to data.frame. Defaults to FALSE. |
A list. The list contains at least two elements. The first element will be the data.frame equivalent of the edges shapefile, obtained in the same format as the output of a ggplot2::fortify()
call on a SpatialLines* object. This data.frame will also include the attributes of the edges. The second element will be data.frame equivalent of the obspoints slot in the SpatialStreamNetwork, including both the point.data and the point.coords slots. The third element will only be returned if preds = TRUE
. This is the data.frame equivalent of the predpoints slot, processed in exactly the same way as the obspoint slot discussed previously.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.