Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
combn错误的含义:有趣的错误(X[[i]],…):n<;m在R_R_Combn - Fatal编程技术网

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)