Expand ~ into the home directory on Linux and MacOS (#6531)

This commit is contained in:
Philip Hyunsu Cho
2020-12-19 23:35:13 -08:00
committed by GitHub
parent cd0821500c
commit fbb980d9d3
7 changed files with 19 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ xgb.Booster.handle <- function(params = list(), cachelist = list(),
if (typeof(modelfile) == "character") {
## A filename
handle <- .Call(XGBoosterCreate_R, cachelist)
modelfile <- path.expand(modelfile)
.Call(XGBoosterLoadModel_R, handle, modelfile[1])
class(handle) <- "xgb.Booster.handle"
if (length(params) > 0) {