read_eds: Read Edges of a Decoration

Description Usage Arguments Details Value Examples

View source: R/read_eds.R

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

1
2
3
4
5
6
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 coordinates of the edges will be calculated from the same decoration's node dataframe.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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

iconr documentation built on Feb. 16, 2021, 5:06 p.m.