0

I have a big list of characters (250*5000), and I need to read 7 at a time. So I want to read 1-7 then 2-8 , 3-9 etc so I can compare those to a vector of mine. My code so far is this

library("affy")
? ReadAffy
list<-seq5000
##list<-read.table("C:\\Users\\user\\Desktop\\mike\\seq5000.txt")
##list
a<-c(list)
d.b
  • 32,245
  • 6
  • 36
  • 77
Μιχάλης
  • 47
  • 1
  • 1
  • 8
  • 2
    You're looking for an output without telling us what the input really looks like. See here: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example focussing on *a minimal dataset*. – ngm Feb 27 '18 at 18:11
  • Thanks for the reply, the input is in that form : ATCGTCC...(5K chars for 1st row), then row 2 with 5k chars where in total i have 250 rows – Μιχάλης Feb 28 '18 at 08:51

1 Answers1

1

A script based on a guess that may help, if not, more details are required!

simu <- paste(letters[sample(1:26, 250*5, replace = T)], collapse = "")
stri <- unlist(strsplit(simu, split=""))

for (i in 1:(length(stri)-6)){
  val7 <- stri[i+0:6]
  print(val7)
  print(paste(val7, collapse = ""))
}
Kevin Cazelles
  • 1,255
  • 9
  • 20