title: R - XGBoost: Error building DMatrix
body: <p>I am having trouble using the XGBoost in R.
  I am reading a CSV file with my data:</p>
  
  <pre><code>get_data = function()
  {
  #Loading Data
  path = "dados_eye.csv"
  data = read.csv(path)
  
  #Dividing into two groups
  train_porcentage = 0.05
  train_lines = nrow(data)*train_porcentage
  train = data[1:train_lines,]
  test = data[train_lines:nrow(data),]
  rownames(train) = c(1:nrow(train))
  rownames(test) = c(1:nrow(test))
  
  return (list("test" = test, "train" = train))
  }
  </code></pre>
  
  <p>This function is Called my the main.R</p>
  
  <pre><code>lista_dados = get_data()
  #machine = train_svm(lista_dados$train)
  #machine = train_rf(lista_dados$train)
  machine = train_xgt(lista_dados$train)
  </code></pre>
  
  <p>The problem is here in the train_xgt</p>
  
  <pre><code>train_xgt = function(train_data)
  {
  data_train = data.frame(train_data[,1:14])
  label_train = data.frame(factor(train_data[,15]))
  
  print(is.data.frame(data_train))
  print(is.data.frame(label_train))
  
  dtrain = xgb.DMatrix(data_train, label=label_train)
  machine = xgboost(dtrain, num_class = 4 ,max.depth = 2, 
      eta = 1, nround = 2,nthread = 2, 
      objective = "binary:logistic")
  
  return (machine)    
  }
  </code></pre>
  
  <p>This is the Error:</p>
  
  <blockquote>
    <p>becchi@ubuntu:~/Documents/EEG_DATA/Dados_Eye$ Rscript main.R</p>
    
    <p>[1] TRUE</p>
    
    <p>[1] TRUE </p>
    
    <p>Error in xgb.DMatrix(data_train, label = label_train) :<br>
    xgb.DMatrix: does not support to construct from  list Calls: train_xgt
    -> xgb.DMatrix Execution halted becchi@ubuntu:~/Documents/EEG_DATA/Dados_Eye$</p>
  </blockquote>
  
  <p>As you can see, they are both DataFrames.</p>
  
  <p>I dont know what I am doing wrong, please help!</p>