I have an attribute consisting of DNA sequences and would like to translate it into his name. So I need to break the sequence into a character of fixed length, which is 3. Here is an example of data
data=c("AATAGACGT","TGACCC","AAATCACTCTTT")
How can I extract it:
[1] "AAT" "AGA" "CGT"
[2] "TGA" "CCC"
[3] "AAA" "TCA" "CTC" "TTT"
So far, I can only find how to break a string by specifying a specific regular expression as a delimiter
source
share