1镜雨,為什么讀取數(shù)據(jù)時要加上options(stringsAsFactors = F) 嫂侍,否則總報錯?
R語言是不太喜歡因子(factor)這類數(shù)據(jù)的荚坞,用的多的多半是向量挑宠,矩陣,數(shù)據(jù)框颓影,列表各淀。目前只遇到過limma計算差異基因時,分組信息需要的輸入文件是factor诡挂。
2碎浇,TCGA樣本名,明明輸入之前是TCGA-06-0675咆畏,讀入數(shù)據(jù)后卻變成了TCGA.06.0675南捂,“-”變".",怎么辦旧找?
讀入數(shù)據(jù)時加上參數(shù):read.table("zz.txt",check.names = F)溺健。讓它不要檢查我的行名,就OK啦!
3钮蛛,讀取文件時出現(xiàn)報錯:
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 31 did not have 2 elements
加上comment.char="鞭缭!" #將以!為開頭的注釋內(nèi)容去掉魏颓。read.table("zz.txt",comment.char="岭辣!")