Last chance! 50% off unlimited learning
Sale ends in
Convert between different classes
l2m(l)m2l(m)
d2m(d)
m2d(m)
l2a(l)
a2l(a)
a2m(a)
m2a(m)
m2ll(m, index = NULL)
list
with x and y coordinates as components
matrix
of (x; y) coordinates
data.frame
with two columns
array
of (x; y) coordinates
numeric
, the number of coordinates for every slice
the data in the required class
# NOT RUN {
# matrix/list
wings[1] %>% coo_sample(4) %>%
m2l() %T>% print %>% # matrix to list
l2m() # and back
# data.frame/matrix
wings[1] %>% coo_sample(4) %>%
m2d() %T>% print %>% # matrix to data.frame
d2m # and back
# list/array
wings %>% slice(1:2) %$%
coo %>% l2a %T>% print %>% # list to array
a2l # and back
# array/matrix
wings %>% slice(1:2) %$%
l2a(coo) %>% # and array (from a list)
a2m %T>% print %>% # to matrix
m2a # and back
# m2ll
m2ll(wings[1], c(6, 4, 3, 5)) # grab slices and coordinates
# }
Run the code above in your browser using DataLab