concatenate | R Documentation |
A function to transform a raw
matrix, used to
store sets of single nucleotides, into a vector of strings, optionally
removing specific value(s).
concatenate(x, discard = NULL)
x |
A |
discard |
A vector of characters to exclude from the results (default:
|
That function concatenates the rows of a raw
matrix,
which is used for storing the molecular trait values, into a vector of
strings. If argument discard
is given a set of values, they will be
excluded from the resulting strings.
A vector of character strings.
Guillaume Guénard [aut, cre] (<https://orcid.org/0000-0003-0761-3072>), Pierre Legendre [ctb] (<https://orcid.org/0000-0002-3838-3305>)
## Define a raw vector for storing nuceotide values:
c(Sequence_1 = "ATCG-TTTCG--CCCCA--TTA--TTAA-GTAA-GTAATCTTTCA",
Sequence_2 = "TTGGCTTCC--TC--CAT-TTC--TTCA-GT-ACG-ATTCTTTTA",
Sequence_3 = "TTCG-TACC-T-T---A-ATAA--T-AA-GTCTTGTAATCGTTCA") %>%
sapply(charToRaw) %>%
t -> sqn
## Display the raw sequence:
sqn
## Transforming the sequence to character strings
concatenate(sqn)
## Transforming the sequence to character strings without the gaps:
concatenate(sqn, discard="-")
## Clean-up:
rm(sqn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.