Unverified Commit 59702674 authored by Laurae's avatar Laurae Committed by GitHub
Browse files

Help fixing #1540 (#1638)

* Help fixing #1540

* Handle character matrix corner case

* Update with recommendation in #1638
parent 41fab1ff
......@@ -79,8 +79,8 @@ Predictor <- R6::R6Class(
# Set temporary variable
num_row <- 0L
# Check if data is a file name
if (is.character(data)) {
# Check if data is a file name and not a matrix
if (identical(class(data), "character") && length(data) == 1) {
# Data is a filename, create a temporary file with a "lightgbm_" pattern in it
tmp_filename <- tempfile(pattern = "lightgbm_")
......@@ -97,7 +97,7 @@ Predictor <- R6::R6Class(
lgb.c_str(tmp_filename))
# Get predictions from file
preds <- read.delim(tmp_filename, header = FALSE, seq = "\t")
preds <- read.delim(tmp_filename, header = FALSE, sep = "\t")
num_row <- nrow(preds)
preds <- as.vector(t(preds))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment