read_eds: Read Edges of a Decoration

View source: R/read_eds.R

read_edsR Documentation

Read Edges of a Decoration

Description

Read edges' information from a file including all edges and extract edges of one decoration. Accepted formats are tab separated values ('tsv'), semicolon separated values ('csv'), or shapefile ('shp').

Usage

read_eds(
  site,
  decor,
  dir = getwd(),
  edges = "edges",
  nodes = "nodes",
  format = "tsv"
)

Arguments

site

name of the site.

decor

name of the decoration.

dir

path to the working folder, by default it is the working directory.

edges

name of the edges file (a dataframe or a shapefile).

nodes

name of the nodes file (a dataframe or a shapefile).

format

file extension indicating a file format from 'tsv' (tab separated values), 'csv' (semicolon separated values) or 'shp' (shapefile). For 'tsv' and 'csv', the files must include node coordinates (nodes$x, nodes$y).

Details

subset the dataframe of edges depending on 'site' and 'decor'.

Value

Dataframe of graph edges, including at least the columns "site", "decor", "a", "b", "xa", "ya", "xb", "yb", with values for each edge (row).

Examples


## Set data folder
dataDir <- system.file("extdata", package = "iconr")

# Read .tsv file
eds.df <- read_eds(site = "Cerro Muriano", decor = "Cerro Muriano 1",
                   dir = dataDir, edges = "edges", format = "tsv")
eds.df
## Dataframe of edges

# Read shapefile
eds.df <- read_eds(site = "Cerro Muriano", decor = "Cerro Muriano 1",
                   dir = dataDir, edges = "edges", format = "shp")
eds.df
## Dataframe of edges


zoometh/iconr documentation built on Nov. 9, 2023, 10:01 a.m.