Trying to create a pair of element but get the following error:
Error in FUN(X[[i]], ...) : n < m
The error appears after running the code:
rslt <- lapply(split(my$symbol, my$character), combn, 2, simplify = F)
Here my
is my data frame and symbol and character is column of data frame. the data frame contain 26,552 rows. Here i posted the small part of my data.
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
Any help appreciated. Thank you.
This is one of the cases where there are less number of elements than 'm'. One option would be to create an exception for
length
oflist
that are less than 'm'