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

@@ -19,6 +19,7 @@ xgb.DMatrix.save <- function(dmatrix, fname) {
if (!inherits(dmatrix, "xgb.DMatrix"))
stop("dmatrix must be xgb.DMatrix")
fname <- path.expand(fname)
.Call(XGDMatrixSaveBinary_R, dmatrix, fname[1], 0L)
return(TRUE)
}