level1_unit_orientation,sfc_3x3_peano-method {sfcurve} | R Documentation |
Level-1 unit in the Peano curve and Meander curve
Description
Level-1 unit in the Peano curve and Meander curve
Usage
## S4 method for signature 'sfc_3x3_peano'
level1_unit_orientation(p)
## S4 method for signature 'sfc_3x3_peano'
change_level1_unit_orientation(p, to = c("horizontal", "vertical"))
## S4 method for signature 'sfc_3x3_meander'
level1_unit_orientation(p)
## S4 method for signature 'sfc_3x3_meander'
change_level1_unit_orientation(p, to = c("forward", "backward"))
Arguments
p |
For |
to |
A string of "vertical/horizontal" (on the |
Details
"vertical" and "horizontal" correspond to the direction of the "long segments" in a Peano curve (see Examples).
level1_unit_orientation()
is normally used inside sfc_apply()
. change_level1_unit_orientation()
changes all level-1 units of a Peano curve or a Meander curve simultaneously.
Value
level1_unit_orientation()
returns "verticalhorizontal" (on the sfc_3x3_peano
object) or "forward/backward" (on the sfc_3x3_meander
object).
change_level1_unit_orientation()
returns an sfc_3x3_peano
or sfc_3x3_meander
object.
Examples
p = sfc_3x3_peano("I", 111)
# the first level-1 unit
level1_unit_orientation(p[1:9, TRUE])
# the fourth level-1 unit
level1_unit_orientation(p[1:9 + 27, TRUE])
p2 = change_level1_unit_orientation(p, "horizontal")
p3 = change_level1_unit_orientation(p, "vertical")
draw_multiple_curves(p, p2, p3,
title = c("original", "all horizontal", "all vertical"), nrow = 1)
# by default, orientations of all level-1 units in Meander curve are forward
p = sfc_3x3_meander("I", 111)
level1_unit_orientation(p[1:9, TRUE])
p2 = change_level1_unit_orientation(p, "backward")
draw_multiple_curves(p, p2,
title = c("all forward", "all backward"), nrow = 1)