Learn R Programming

osmar (version 1.1-7)

subset.osmar: Subset an osmar object

Description

Subset an osmar object

Usage

"subset" (x, node_ids = NULL, way_ids = NULL, relation_ids = NULL, ids = list(node_ids = node_ids, way_ids = way_ids, relation_ids = relation_ids), ...)

Arguments

x
An osmar object
node_ids
Node ID vector
way_ids
Way ID vector
relation_ids
Relation ID vector
ids
A list composed of node_ids, way_ids, relation_ids; for easier usage with results from find_up and find_down
...
Ignored

Value

An osmar object containing the specified elements

Examples

Run this code
data("muc", package = "osmar")
  id <- find(muc, node(tags(v == "Marienplatz")))

  subset(muc, node_ids = id)

  subset(muc, ids = find_up(muc, node(id)))

Run the code above in your browser using DataLab