Description Usage Arguments Details Value Note Examples
Find boundary points in a Grid
object.
1 | boundary_Grid(x, type = c("data.frame", "array", "index"))
|
x |
An object with class |
type |
The wanted type of result. |
When type
is "data.frame"
, the returned object is a
data frame containing only the boundary points. When type
is "array"
the result is a logical array with its elements
in correspondence with the index
slot of the
object. Finally, when type
is "index"
, the result is
an integer vector giving the indices of the boundary points in the
order of the nodes defined by the object. This order is the one
used by the as.data.frame
coercion.
An object describing the boundary points. See Details.
Remind that when using the plot
method for a
Grid
object, some nodes are generally hidden because
several points have the same projection when they are shown in a
two-dimensional scatterplot.
When one or more of the levels has length <= 2, all points of the grid are boundary points!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## define a Grid object
myGD <- Grid(nlevels = c(3, 4))
bd <- boundary_Grid(myGD, type = "index")
## use a different color for boundary points
cols <- rep("black", length(myGD))
cols[bd] <- "red"
plot(myGD, col = cols, pch = 16, cex = 2, main = "Boundary points")
## repeat this after a generalised transposition
myGD2 <- aperm(myGD, perm = c(2, 1))
bd2 <- boundary_Grid(myGD2, type = "index")
cols2 <- rep("black", length(myGD2))
cols2[bd2] <- "red"
plot(myGD2, col = cols2, pch = 16, cex = 2, main = "Boundary points")
## 3-dimensional
myGD3 <- Grid(nlevels = c("x" = 3, "y"= 4, "z" = 6))
bd3 <- boundary_Grid(myGD3, type = "index")
cols3 <- rep("black", length(myGD3))
cols3[bd3] <- "red"
plot(myGD3, jitter = TRUE, col = cols3, pch = 16, cex = 2, main = "Boundary points")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.