[.sfc_nxn | R Documentation |
Subunit in the curve
## S3 method for class 'sfc_nxn'
x[i, j, ..., drop = TRUE]
## S4 method for signature 'sfc_nxn'
sfc_index(p, index = "")
test_sfc_index(p, index)
x |
An |
i , index |
A string of digits representing the path on the hierarchy of the curve. The left side
corresponds to the top level and the right side corresponds to the bottom level on the curve. For the
2x2 curve, the digits can only be 1-4, and for the Peano and Meander curves, the digites can be 1-9.
The hierarchical index should be specified in a format of |
j |
A value of |
... |
Ignore. |
drop |
A value of |
p |
An |
sfc_index()
only works on square curves (i.e. a curve with a single base letter as seed.)
test_sfc_index()
is a helper function for demonstrating sfc_index()
.
sfc_index()
returns an integer vector.
p = sfc_2x2("I", "11111")
p["3:2:1"]
# for 2x2 and 3x3 curves, ":" can be omitted
p["321"]
p["3:2:1", TRUE] # or p["3:2:1", drop = FALSE]
# only for testing
p = sfc_2x2("I", "11111")
om = par(no.readonly = TRUE)
par(mfrow = c(2, 2))
test_sfc_index(p, "3")
test_sfc_index(p, "3:2")
test_sfc_index(p, "3:2:1")
test_sfc_index(p, "3:2:1:1")
par(om)
p = sfc_3x3_meander("I", "11111")
om = par(no.readonly = TRUE)
par(mfrow = c(2, 2))
test_sfc_index(p, "7")
test_sfc_index(p, "7:5")
test_sfc_index(p, "7:5:9")
test_sfc_index(p, "7:5:9:2")
par(om)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.