Error in check_dims(x = x, y = y) : nrow(x) > 1 is not TRUE
I encountered this issue today, hard to decipher, I think a dedicated error message what the problem is might be good.
Here a traceback:
13.
stop(simpleError(msg, call = if (p <- sys.parent(1L)) sys.call(p)))
12.
stopifnot(nrow(x) > 1)
11.
check_dims(x = x, y = y)
10.
train.default(x, y, weights = w, ...)
9.
train(x, y, weights = w, ...)
8.
train.formula(y ~ ., data = data_train, method = "ranger", trControl = train_control_cv,
num.trees = 500, importance = importance, num.threads = max_threads)
7.
train(y ~ ., data = data_train, method = "ranger", trControl = train_control_cv,
num.trees = 500, importance = importance, num.threads = max_threads) at 1_v4_main_functions.R#364
6.
v4_GRN_model_function(normal_data, importance = importance, max_threads = cores,
ML_type = ML_type, control = control, test_part = test_part) at 1_v4_main_functions.R#144
5.
FUN(X[[i]], ...)
4.
lapply(1:num_run, function(i) {
set.seed(Sys.time())
flog.info("Actual network number : %s", i)
tmp_res = v4_GRN_model_function(normal_data, importance = importance, ...
3.
lapply(1:num_run, function(i) {
set.seed(Sys.time())
flog.info("Actual network number : %s", i)
tmp_res = v4_GRN_model_function(normal_data, importance = importance, ... at 1_v4_main_functions.R#141
2.
v4_GRN_complete_dist(all_raw_data = all_raw_data, weight_method = weight_method,
num_run = num_run, num_run_CR = num_run_CR, num_run_random = num_run_random,
cores = cores, normalized_rnaseq = normalized_rnaseq, importance = importance,
variability_test = variability_test, variability_data = variability_data, ... at 1_v4_main_functions.R#90
1.
v4_GRN_prediction_Main_Function(DE_data = all_datasets$Mac$DE_SL1344_naive,
GRN_matrix_filtered = GRN_matrix_tmp, DE_pvalue_th = 0.2,
logFC_th = 1, corrTFGene_th = -1, num_run = 10, num_run_CR = 5,
num_run_random = 10, ret_dev = FALSE, cores = 20, GRN_name = networkCur, ...
The input to v4_GRN_prediction_Main_Function
here is a data frame with only 4 rows, so probably a consequence of that. I think you could replicate the error simply by inputting a data frame with very few rows.
Edited by Christian Arnold