aggr_fea_voro: aggr_fea_voro

Description Usage Arguments Details Value Author(s) Examples

Description

Aggregate features by Voronoi tesselation

Usage

1
aggr_fea_voro(nodes, features, type_col)

Arguments

nodes

a data.frame containing metric x and y coordinates of nodes, additionally an identifier. Coordinates are expected to be the first two columns.

features

a data.frame containing metric x and y coordinates of nodes, and feature type. Coordinates are expected to be the first two columns.

type_col

a character string naming the columname containing feature types.

Details

Creates a Voronoi tesselation of the nodes and aggregates features in tiles according to their spatial location. Returns a dataframe of aggregated features and their associated node as a new collum.

Value

a dataframe with feature types and their corresponding node. Additionally a plot is created to display the aggregation of features to nodes. Amount of feature per node is added as number to the plot.

Author(s)

Oliver Nakoinz <oliver.nakoinz@ufg.uni-kiel.de>

Chiara Girotto <chiara.girotto@web.de>

Franziska Faupel <franziska-faupel@gmx.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(1234)

nodes <- data.frame(nodes_x = sample(3433806:3581396, 10, replace = TRUE),
               nodes_y = sample(5286004:5484972, 10, replace = TRUE), 
               nodes_id = c(1:10))
features <- data.frame(x = sample(3433806:3581396, 100, replace = TRUE),
                   y = sample(5286004:5484972, 100, replace = TRUE),
                   type = paste0("B", c(rep(1, 5), rep(2,15), sample(11:19, 20, replace = TRUE), 
                   sample(111:119, 30, replace = TRUE), sample(1111:1115, 30, replace = TRUE)))
                   ) 
aggr_fea <- aggr_fea_voro(nodes, features, "type") 

CRC1266-A2/moin documentation built on May 7, 2019, 8:56 p.m.