I have a .txt file with a fixed-length DNA string and I want you to return an array of text with different fragments.
I read the file with the following code:
dades<- read.table("DnaSeq.txt")
Example:
I have the string:
tgcaggctttgcacatgtgac
and I want you to return me:
posicion valor
1 tgc
2 agg
3 ctt
4 tgc
5 aca
6 tgt
7 gac
Solution:
dades<- read.table("DnaSeq.txt")
dades<-dades$V1
DNA <- substr(dades,0,3)