% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/class_spflow_network.R
\docType{class}
\name{spflow_network-class}
\alias{spflow_network-class}
\alias{dat,spflow_network-method}
\alias{dat<-,spflow_network-method}
\alias{id,spflow_network-method}
\alias{id<-,spflow_network-method}
\alias{neighborhood,spflow_network-method}
\alias{neighborhood<-,spflow_network-method}
\alias{nnodes,spflow_network-method}
\alias{update_dat,spflow_network-method}
\title{Class spflow_network}
\usage{
\S4method{dat}{spflow_network}(object)

\S4method{dat}{spflow_network}(
  object,
  ...,
  node_key_column,
  node_coord_columns,
  derive_coordinates = FALSE,
  prefer_lonlat = TRUE
) <- value

\S4method{id}{spflow_network}(object)

\S4method{id}{spflow_network}(object) <- value

\S4method{neighborhood}{spflow_network}(object)

\S4method{neighborhood}{spflow_network}(object) <- value

\S4method{nnodes}{spflow_network}(object)

\S4method{update_dat}{spflow_network}(object, new_dat)
}
\arguments{
\item{object}{A spflow_network-class}

\item{...}{not used, required for consistent argument matching
(see https://bugs.r-project.org/show_bug.cgi?id=18538)}

\item{node_key_column}{A character indicating the column containing the identifiers for the nodes}

\item{node_coord_columns}{A character indicating the columns that represent the coordinates of the
nodes. For example \code{c("LON", "LAT")}.}

\item{derive_coordinates}{A logical indicating whether there should be an attempt to infer the
coordinates from the node_data.}

\item{prefer_lonlat}{A logical indicating whether the coordinates should be transformed to
longitude and latitude.}

\item{value}{An object to replace the existing id/data/neighborhood}

\item{new_dat}{A data.frame}
}
\description{
An S4 class that contains all information on a spatial network which is
composed by a set of nodes that are linked by some neighborhood relation.
The class is constructed by the \code{\link[=spflow_network]{spflow_network()}} function.
}
\details{
The data on each node is stored in a data.frame, where each node must be
uniquely identified by a key.
The neighborhood relations are described by a matrix that satisfies the
usual assumptions of the spatial weight matrix in spatial econometric models.
In most cases each node will only neighbor to a few others, in which case
the neighborhood matrix is represented as a \code{\link[=sparseMatrix]{sparseMatrix()}}.
Function to create spatial neighborhood matrices can be found in the
\strong{spdep} package.
}
\section{Slots}{

\describe{
\item{\code{id_net}}{A character that serves as an identifier for the set of nodes}

\item{\code{node_data}}{A data.frame that contains all information describing the nodes}

\item{\code{node_neighborhood}}{A matrix that describes the neighborhood relations of the nodes}
}}

\examples{
## access the data describing the nodes
new_dat <- dat(germany_net)

# access the id of the network
germany_net2 <- germany_net
id(germany_net2)
id(germany_net2) <- "Germany"

# access the neighborhood matrix of the nodes
neighborhood(germany_net)

# access the number of nodes inside the network
nnodes(germany_net)

}
