Train xgboost model in R error

Hi, I trained and predict xgboost model with a dataset that logs impression, clicks etc. and I used:
table(pred,dataset$Log_Type) and to get probability. Here is the code:

 label <- as.matrix(dataset[,3])
 train <- as.matrix(dataset[,c(1,2,4,5,6,7,8,9)])
 bst_model <- xgboost(data=train,eta=1.1, objective='multi:softmax',max.depth=2,nrounds=200,nthread=4,lambda=.80,num_class=4,eval_metric='mlogloss')
 bst_model <- xgb.save.raw(bst_model)
 But it says error:
 Error in xgb.iter.update(bst$handle, train, iteration - 1, obj) : 
 [17:11:54] amalgamation/../src/objective/multiclass_obj.cc:78: Check failed: label_error >= 0 && label_error < nclass SoftmaxMultiClassObj: label must be in [0, num_class), num_class=4 but found -2147483648 in label.

I checked my input data(sampled 50%), it didn't have -2147483648, only 0-3 in num_class/label.

Thanks,
R.

© Copyright 2013-2019 Analytics Vidhya