tidy-motifs | R Documentation |
Tidy manipulation of motifs.
to_df(motifs, extrainfo = TRUE)
update_motifs(motif_df, extrainfo = TRUE, force = FALSE)
to_list(motif_df, extrainfo = TRUE, force = FALSE)
requires_update(motifs, extrainfo = TRUE)
motifs |
List of motifs. |
extrainfo |
Use the |
motif_df |
Motif |
force |
Whether to coerce non-character data types into characters for
inclusion in |
To turn off the informative messages/warnings when printing the object to
the console, set options(universalmotif_df.warning=FALSE)
.
For to_df()
: a data.frame
with the exposed slots as columns.
For update_motifs()
: the updated data.frame
.
For requires_update()
: TRUE
if the motifs are out of date,
FALSE
if otherwise. Note that this function uses identical()
to check for this, which can be quite slow for large datasets. It
is usually just as fast to simply run update_motifs()
in such
cases.
For to_list()
: a list of motifs.
Benjamin Jean-Marie Tremblay, benjamin.tremblay@uwaterloo.ca
## Not run:
library(universalmotif)
library(dplyr)
m <- c(create_motif(name = "motif A"), create_motif(name = "motif B"))
# Change the names of the motifs using the tidy way:
m <- m %>%
to_df() %>%
mutate(name = paste0(name, "-2")) %>%
to_list()
# Add your own metadata to be stored in the extrainfo slot:
m_df <- to_df(m)
m_df$MyMetadata <- c("Info_1", "Info_2")
m <- to_list(m_df, extrainfo = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.