Learn R Programming

Momocs (version 1.1.6)

Coo: Coo "super" class

Description

Coo class is the 'parent' or 'super' class of Out, Opn and Ldk classes.

Usage

Coo(...)

Arguments

...
anything and, anyway, this function will simply returns a message.

Details

Useful shortcuts are described below. See browseVignettes("Momocs") for a detail of the design behind Momocs' classes. Coo class is the 'parent' class of the following 'child' classes
  • Out for closed outlines
  • Opn for open outlines
  • Ldk for configuration of landmarks
Since all 'child classes' of them handle \((x; y)\) coordinates among other generic methods, but also all have their specificity, this architecture allow to recycle generic methods and to use specific methods. In other words, Out, Opn and Ldk classes are all, primarily, Coo objects on which we define generic and specific methods. See their respective help pages for more help. You can access all the methods available for Coo objects with methods(class=Coo).

See Also

Other Coo objects: Opn, Out

Examples

Run this code
## Not run: ------------------------------------
# # to see all methods for Coo objects.
# methods(class='Coo')
# # Let's take an Out example. But all methods shown here
# # work on Ldk (try data(wings) ) and on Opn (try data(olea))
# data(bot)
# 
# # Primarily a 'Coo' object, but also an 'Out'
# class(bot)
# inherits(bot, "Coo")
# panel(bot)
# stack(bot)
# plot(bot)
# 
# # Getters (you can also use it to set data)
# bot[1] %>% coo_plot()
# bot[1:5] %>% str()
# 
# # Setters
# bot[1] <- shapes[4]
# panel(bot)
# 
# bot[1:5] <- shapes[4:8]
# panel(bot)
# 
# # access the different components
# # $coo coordinates
# head(bot$coo)
# # $fac grouping factors
# head(bot$fac)
# # or if you know the name of the column of interest
# bot$type
# # table
# table(bot$fac)
# # an internal view of an Out object
# str(bot)
# 
# # subsetting
# # see ?filter, ?select, and their 'see also' section for the
# # complete list of dplyr-like verbs implemented in Momocs
# 
# length(bot) # the number of shapes
# names(bot) # access all individual names
# bot2 <- bot
# names(bot2) <- paste0('newnames', 1:length(bot2)) # define new names
## ---------------------------------------------

Run the code above in your browser using DataLab