Description Usage Arguments Details Value See Also Examples
These are helper functions for phylo_data
allowing for either the easy fine-tuning of the generated
HTML output or for the conversions of strings
to safe phylogenetic taxon labels.
1 2 3 4 5 6 7 8 9 10 11 | html_args(character.states = c(`negative reaction` = "-", `weak reaction` = "w",
`positive reaction` = "+"),
multiple.sep = "/", organisms.start = "Organisms: ",
states.start = "Symbols: ", legend.dot = TRUE,
legend.sep.1 = ", ", legend.sep.2 = "; ",
table.summary = "character matrix", no.html = TRUE,
greek.letters = TRUE, css.file = opm_opt("css.file"),
embed.css = FALSE, ...)
safe_labels(x, format, enclose = TRUE, pad = FALSE,
comment = FALSE)
|
character.states |
Character vector used for mapping
integers to the elements in the corresponding position.
It is also used in conjunction with its names to create
the table legend. The default value is useful for data of
mode ‘logical’, mapping |
multiple.sep |
Character scalar used for joining multiple-state characters together. |
organisms.start |
Character scalar prepended to the organism part of the table legend. Ignored if empty. |
states.start |
Character scalar prepended to the character-states part of the table legend. Ignored if empty. |
legend.dot |
Logical scalar indicating whether or not a dot shall be appended to the table-legend entries. |
legend.sep.1 |
Character scalar used for the first pass of joining the table-legend entries together. |
legend.sep.2 |
Character scalar used for the second pass of joining the table-legend entries together. |
table.summary |
Character scalar inserted as
‘summary’ attribute of the resulting |
no.html |
Logical scalar indicating whether
substrate names should be cleaned from characters that
might interfere with |
greek.letters |
Logical scalar indicating whether or not letters between ‘a’ and ‘e’ within substrate names should be converted to the corresponding Greek letters. This is done after the cleaning step, if any. |
css.file |
Character vector indicating the name of
one to several CSS files to link or embed.
Empty strings and empty vectors are ignored. If
Under Windows it is recommended to convert a file name
|
embed.css |
Logical scalar indicating whether or not CSS files shall be embedded, not linked. |
... |
Optional other arguments available for inserting user-defined HTML content. Currently the following ones (in their order of insertion) are not ignored, and can even be provided several times:
|
x |
Character vector or convertible to such. |
format |
Character scalar. See
|
enclose |
Logical scalar. See
|
pad |
Logical scalar. Bring labels to the same number of characters by appending spaces? Has no effect for PHYLIP and HTML output format. |
comment |
Logical scalar. If |
These functions are not normally called directly by an
opm user but by phylo_data
; see there
for their usual application. The phylo_data
methods for OPMD_Listing
and OPMS_Listing
objects do not support all HTML formatting
options.
Label cleaning invokes either the replacement of disallowed characters or the enclosing of all labels in single quotes and the doubling of already existing single quotes, if any.
List of HTML arguments or character vector with modified labels.
base::normalizePath base::I base::gsub
Other phylogeny-functions: phylo_data
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Some animals you might know
x <- c("Elephas maximus", "Loxodonta africana", "Giraffa camelopardalis")
(y <- safe_labels(x, "phylip"))
stopifnot(nchar(y) == 10L) # truncation
(y <- safe_labels(x, "epf"))
stopifnot(nchar(y) == nchar(x)) # changes in length unnecessary
(y <- safe_labels(x, "epf", pad = TRUE))
stopifnot(nchar(y) == 22) # padded to uniform length
(y <- safe_labels(x, "nexus", enclose = TRUE))
stopifnot(grepl("^'.*'$", y)) # all strings enclosed in sinqle quotes
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.