Description Usage Arguments Details Value Author(s) Examples
View source: R/align_matrix_block.R
Given a block of taxa and characters aligns text so each character block begins at same point.
1 | align_matrix_block(matrix_block)
|
matrix_block |
The matrix block as raw input text. |
The function serves to help build NEXUS files by neatly aligning raw text blocks of taxa and characters. Or in simple terms it takes input that looks like this:
1 2 3 4 | Allosaurus 012100?1011
Abelisaurus 0100???0000
Tyrannosaurus 01012012010
Yi 10101?0????
|
And turns it into something that looks like this:
1 2 3 4 | Allosaurus 012100?1011
Abelisaurus 0100???0000
Tyrannosaurus 01012012010
Yi 10101?0????
|
I use this in building the NEXUS files on my site, graemetlloyd.com.
Nothing is returned, instead the aligned block is sent to the clipboard ready for pasting into a text editor.
Graeme T. Lloyd graemetlloyd@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Build example block from above:
x <- paste(c(
"Allosaurus 012100?1011",
"Abelisaurus 0100???0000",
"Tyrannosaurus 01012012010",
"Yi 10101?0????"
), collapse = "\n")
# Look at block pre-alignment:
x
# Align block and place on clipboard:
## Not run:
align_matrix_block(x)
## End(Not run)
# To test the response open a text editor and paste the
# contents of the clipboard.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.