提问人:Anon 提问时间:11/17/2023 更新时间:11/17/2023 访问量:47
两个数据帧之间的按列关联
Column-wise correlation between two dataframes
问:
我想在 和 之间执行逐列关联。meth$beta_value
expr
法典:
t.meth <- t(meth$beta_value)
t.expr <- t(expr)
spearman.corr <- cor.test(t.meth, t.expr, method="spearman")
追踪:
Error in cor.test.default(t.meth, t.expr, method = "spearman") :
'x' and 'y' must have the same length
输入:
> dim(meth$beta_value)
[1] 373233 169
> dim(expr)
[1] 11550 169
> dput(meth$beta_value[1:5,1:5])
structure(c(0.937221863875433, 0.884685944584618, 0.00772875906060839,
0.974299336034647, 0.527647691683903, 0.820402509764824, 0.746851906366392,
0.00688133381821596, 0.955114652587149, 0.838526921251755, 0.856636409601063,
0.832976487385604, 0.0100358136497527, 0.980061730438325, 0.977217882552452,
0.943360790700266, 0.884748613341517, 0.0130798750757149, 0.989522013973257,
0.971365584092397, 0.855547597290183, 0.669820939800438, 0.00656667040139398,
0.981290789016522, 0.899078039097799), dim = c(5L, 5L), dimnames = list(
c("cg13869341", "cg15560884", "cg01014490", "cg17505339",
"cg16736630"), c("TCGA.2K.A9WE.01", "TCGA.2Z.A9J1.01", "TCGA.2Z.A9J3.01",
"TCGA.2Z.A9J6.01", "TCGA.2Z.A9J7.01")))
> dput(expr[1:5,1:5])
structure(c(7.65342121905285, 14.3511850042327, 10.3737643425674,
10.0819596419255, 9.44832324553207, 5.09389393824392, 12.4136523086721,
11.1918237390263, 10.1912122382252, 9.9623840324273, 4.70168212029528,
10.1689338100564, 9.96839262629172, 9.87305770150294, 9.75535162798677,
5.13719199914349, 12.0367193976262, 10.8202555636581, 10.3262700402849,
9.91216810777653, 6.95117512427229, 10.9656928148969, 10.5991523452113,
10.4556415168452, 9.46537845450025), dim = c(5L, 5L), dimnames = list(
c("ENSG00000121410", "ENSG00000175899", "ENSG00000128274",
"ENSG00000291836", "ENSG00000081760"), c("TCGA.2K.A9WE.01",
"TCGA.2Z.A9J1.01", "TCGA.2Z.A9J3.01", "TCGA.2Z.A9J6.01",
"TCGA.2Z.A9J7.01")))
答: 暂无答案
评论