combn错误的含义:有趣的错误(X[[i]],…):n<;m在R
尝试创建一对元素,但出现以下错误:combn错误的含义:有趣的错误(X[[i]],…):n<;m在R,r,combn,R,Combn,尝试创建一对元素,但出现以下错误: Error in FUN(X[[i]], ...) : n < m 谢谢你的帮助。谢谢。这是元素数量少于“m”的情况之一。一个选项是为list的length创建一个小于'm'的异常 lapply(split(my$symbol, my$character), function(x) if(length(x)>1) { combn(x, 2, simplify=FALSE) }
Error in FUN(X[[i]], ...) : n < m
谢谢你的帮助。谢谢。这是元素数量少于“m”的情况之一。一个选项是为
list
的length
创建一个小于'm'的异常
lapply(split(my$symbol, my$character), function(x)
if(length(x)>1) {
combn(x, 2, simplify=FALSE)
}
else x)
my:
symbol character
BHMT Abruptio Placentae
BHMT Diabetes Mellitus, Type 2
BHMT Lymphoma, Non-Hodgkin
BHMT Neural Tube Defects
BID Carcinoma, Hepatocellular
BID Stomach Neoplasms
BIN1 Alzheimer Disease
BIN1 Myopathies, Structural, Congenital
BIN1 Myopathy, Centronuclear, Autosomal Recessive
BIRC5 Lung Neoplasms
BIRC5 Ovarian Neoplasms
BIRC5 Stomach Neoplasms
BIRC6 Neoplasms
BIRC7 Carcinoma, Renal Cell
BLK Arthritis, Rheumatoid
BLK Lupus Erythematosus, Systemic
BLK Maturity-onset diabetes of the young, type 11
lapply(split(my$symbol, my$character), function(x)
if(length(x)>1) {
combn(x, 2, simplify=FALSE)
}
else x)