Someone who knows how to fix this problem:
Code should be placed in three backticks as shown below
annot <- read.csv("samplesheet.txt",header=T,sep="\t") annot$Slide <- substring(annot$Array.Data.File,1,10) #adding annotation for Slide annot$Array <- substring(annot$Array.Data.File,12,17) #adding annotation for Array annot$Basename <- substr(annot$Array.Data.File,1,17) #adding annotation for Basename annot <-annot[!duplicated(annot$Basename),] #remove duplicated row, due to Cy3 & Cy5 taking up separate rows annot <- annot[!(annot$Characteristics.disease == "Crohn's disease"),] #remove rows with blood cells methylset <- read.metharray.exp(targets = annot)
My .idat files are all in the same working directory as this R file is. But the error states it can't find my .idat files as follows:
Error in read.metharray(basenames = files, extended = extended, verbose = verbose, : The following specified files do not exist:201172580052_R02C_Grn.idat, 201172560046_R01C_Grn.idat, 201172560048_R02C_Grn.idat, 201172580052_R07C_Grn.idat,... (the error goes for all my .idat files)
Thank you in advance!