Commit 9b2558d6 authored by Laurae's avatar Laurae Committed by Guolin Ke
Browse files

Allow easier installation for R package via devtools (#177)

* Fix to avoid issue #176 for R package installation

* Provide installation step using devtools
parent 81a6a442
......@@ -4,14 +4,39 @@ LightGBM R Package
Installation
------------
Windows users may need to run with administrator rights (either R or the command prompt, depending on the way you are installing this package). Rtools must be installed.
You can use a command prompt to install via command line:
```
cd R-package
R CMD INSTALL --build .
```
For windows user, you may need to run command prompt as administrator.
You can also install directly from R using the repository with `devtools`:
```r
devtools::install_github("Microsoft/LightGBM", subdir = "R-package")
```
To install LightGBM from a specific commit, you can specify the reference, such as the following to install the first release of the R package for LightGBM:
```r
devtools::install_github("Microsoft/LightGBM", ref = "1b7643b", subdir = "R-package")
```
You can check quickly if your LightGBM R package is working by running the following:
```r
library(lightgbm)
data(agaricus.train, package='lightgbm')
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label=train$label)
params <- list(objective="regression", metric="l2")
model <- lgb.cv(params, dtrain, 10, nfold=5, min_data=1, learning_rate=1, early_stopping_rounds=10)
```
Examples
--------
------------
* Please visit [demo](demo).
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