read_nds: Read Nodes of a Decoration

View source: R/read_nds.R

read_ndsR Documentation

Read Nodes of a Decoration

Description

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

Usage

read_nds(site, decor, dir = getwd(), 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.

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).

Value

Dataframe of graph nodes, including at least the columns "site", "decor", "id", and coordinates "x", "y", with values for each node (row).

Examples


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

# Read dataframe of nodes
nds.df <- read_nds(site = "Cerro Muriano", decor = "Cerro Muriano 1",
                   dir = dataDir, format = "tsv")

# Read shapefile of nodes
nds.df <- read_nds(site = "Cerro Muriano", decor = "Cerro Muriano 1",
                   dir = dataDir, format = "shp")


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