Warning from the example provided in the main page
pascaloettli opened this issue · 0 comments
pascaloettli commented
Hello,
The code provided in the Usage: the basics section to generate sample data is incorrect and throw a warning, because of the incorrect number of columns in the matrices:
Warning message:
In matrix(data = runif(500, 0, 1), nrow = 50, ncol = 5) :
data length differs from size of matrix: [500 != 50 x 5]
The correct code should be:
library(magrittr)
x_data <- matrix(data = runif(500,0,1),nrow = 50,ncol = 10)
y_data <- ifelse(runif(50,0,1) > 0.6, 1L,0L) %>% as.matrix()
x_data2 <- matrix(data = runif(500,0,1),nrow = 50,ncol = 10)
y_data2 <- ifelse(runif(50,0,1) > 0.6, 1L,0L) %>% as.matrix()
with ncol = 10
instead of ncol = 5
.