View source: R/flownet_plotting.R
grid2polygon | R Documentation |
Get the node indices of the four corner points of a series of grids
grid2polygon(df, dp)
df |
list with flownet problem definition |
dp |
list with flownet results, per node. This dataframe should contain a field with the name 'val' that is used to calculate a value for each polygon |
tibble with polygon data. Unique polygons are differentiated using the unique identifier in the field 'id'. Interpolated values are stored in field 'val', and the positions of the corner points in 'x' and 'y'
#calculate df <- flownet_geometry_rectangular(grid_size = 2) dp <- flownet_solve_rectangular(df) dpol <- grid2polygon(df, dp) #plot ggplot2::ggplot() + ggplot2::geom_polygon( data = dpol, ggplot2::aes(x = x, y = y, fill = h, group = id), color = NA )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.