0
我想R中創建以下ExpressionSet:[R ExpressionSet過濾NA值
dataDirectory <- system.file("extdata", package = "Biobase")
exprsFile <- "path to expression data.txt"
exprs <- as.matrix(read.table(exprsFile, header = TRUE, sep = "\t", row.names = 1, as.is = TRUE))
pDataFile <- "path to phenotype data.txt"
pData <- read.table(pDataFile, row.names=1, header=TRUE, sep="\t")
phenoData <- new("AnnotatedDataFrame",data=pData)
現在刪除從exprs那些列與NA的超過80%的值
exprs <- exprs[,colSums(is.na(exprs)) < 0.8]
之前,我可以執行以下代碼&構建ExpressionSet我必須刪除與exprs中上面刪除的列匹配的phenoData(= samples)中的所有行。我怎樣才能做到這一點?
exampleSet <- ExpressionSet(assayData=exprs, phenoData=phenoData)
exampleSet
謝謝你的解決方案! – user86533