Learn R Programming

alcyon (version 0.7.0)

getTopFeatures: Extract top x percent of features

Description

Sorts features by a specific column and extracts the top x percent

Usage

getTopFeatures(lineStringMap, column, percent)

Value

The lineString map filtered and sorted

Arguments

lineStringMap

An sf lineString map

column

The column to use to extract the features from

percent

Percentage of features (to total) to extract

Examples

Run this code
mifFile <- system.file(
    "extdata", "testdata", "barnsbury",
    "barnsbury_small_axial_original.mif",
    package = "alcyon"
  )
  sfMap <- st_read(mifFile,
    geometry_column = 1L, quiet = TRUE
  )
  shapeGraph <- as(sfMap, "AxialShapeGraph")
shapeGraph <- allToAllTraverse(
  shapeGraph,
  traversalType = TraversalType$Topological,
  radii = c("n", "3"),
  includeBetweenness = TRUE
)
getTopFeatures(shapeGraph, "Connectivity", 0.1)

Run the code above in your browser using DataLab