Do you not have to use:
write.table(df, 'Aman_root_25.gene.txt', sep = '\t', quote = FALSE)
?
• 0 views
•
link
Hello,
I am using below R code to extract count data for multiple samples from a file but not able to write as a matrix could you please help with it?
data = read.table("DESeq2-Norm-Count-Table.txt",header=T,sep='\t',check.names=F)
> otu.list = read.table("Aman_root_gene.list.txt",header=F,sep='\t',check.names=F)
> i <- row.names(data) %in% otu.list[[1]]
> dim(data[i, ])
[1] 25 72
> write.table(i,"Aman_root_25.gene.txt",sep="\t")
Many thanks
thanks, it is sorted by using below code.
> df = as.data.frame(data[i, ])
> write.table(df,"Aman_root_25.gene.txt",sep="\t")
Thanks
Log in to answer this question.
Please show content of that file.