Skip to content

Commit

Permalink
add to lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed May 16, 2023
1 parent f6bfa30 commit c21bd58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/arulespy/arules.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# install arules if necessary. Note: the system path is probably not writable for the user.
# we try to create the directory so install.packages does not ask

ro.r('dir.create(Sys.getenv("R_LIBS_USER")[1], showWarnings = FALSE, recursive = TRUE)')
import os
os.makedirs(ro.r('Sys.getenv("R_LIBS_USER")')[0], exist_ok=True)
ro.r('.libPaths(c(Sys.getenv("R_LIBS_USER"), .libPaths()))')

utils = packages.importr('utils')
if not ro.packages.isinstalled('arules'):
Expand Down
4 changes: 3 additions & 1 deletion src/arulespy/arulesViz.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@


# install arules if necessary. Note: the system path is probably not writable for the user.
ro.r('dir.create(Sys.getenv("R_LIBS_USER")[1], showWarnings = FALSE, recursive = TRUE)')
import os
os.makedirs(ro.r('Sys.getenv("R_LIBS_USER")')[0], exist_ok=True)
ro.r('.libPaths(c(Sys.getenv("R_LIBS_USER"), .libPaths()))')

utils = packages.importr('utils')
if not ro.packages.isinstalled('arulesViz'):
Expand Down

0 comments on commit c21bd58

Please sign in to comment.