File: Extract.linnet.Rd

package info (click to toggle)
r-cran-spatstat.linnet 3.2-5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,664 kB
  • sloc: ansic: 2,107; makefile: 32; sh: 13
file content (67 lines) | stat: -rw-r--r-- 1,892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
\name{Extract.linnet}
\alias{[.linnet}
\title{Extract Subset of Linear Network}
\description{
  Extract a subset of a linear network.
}
\usage{
  \method{[}{linnet}(x, i, \dots, snip=TRUE)
}
\arguments{
  \item{x}{
    A linear network (object of class \code{"linnet"}).
  }
  \item{i}{
    Spatial window defining the subregion.
    An object of class \code{"owin"}.
  }
  \item{snip}{
    Logical. If \code{TRUE} (the default), segments of \code{x}
    which cross the boundary of \code{i} will be cut by the boundary.
    If \code{FALSE}, these segments will be deleted.
  }
  \item{\dots}{Ignored.}
}
\value{
  Another linear network (object of class \code{"linnet"}).
}
\details{
  This function computes the intersection
  between the linear network \code{x} and the domain specified by \code{i}.
  
  This function is a method for the subset operator \code{"["} for
  linear networks (objects of class \code{"linnet"}). It is provided
  mainly for completeness.

  The index \code{i} should be a window.

  The argument \code{snip} specifies what to do with segments of \code{x}
  which cross the boundary of \code{i}. 
  If \code{snip=FALSE}, such segments are simply deleted.  
  If \code{snip=TRUE} (the default), such segments are cut into pieces by the
  boundary of \code{i}, and those pieces which lie inside the window
  \code{i} are included in the resulting network. 
}
\examples{
  p <- par(mfrow=c(1,2), mar=0.2+c(0,0,1,0))
  B <- owin(c(0.1,0.7),c(0.19,0.6))

  plot(simplenet, main="x[w, snip=TRUE]")
  plot(simplenet[B], add=TRUE, col="green", lwd=3)
  plot(B, add=TRUE, border="red", lty=3)

  plot(simplenet, main="x[w, snip=FALSE]")
  plot(simplenet[B, snip=FALSE], add=TRUE, col="green", lwd=3)
  plot(B, add=TRUE, border="red", lty=3)

  par(p)
}
\author{
  \adrian,
  \rolf,
  \ege
  and Suman Rakshit.
}
\keyword{spatial}
\keyword{manip}
\concept{Linear network}