Skip to content

Commit

Permalink
Add missing repos parameter in R installation
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Sep 14, 2023
1 parent ebca0b9 commit 4604224
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yggdrasil/languages/R/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ def install_packages(package_list, update=False, repos=None, **kwargs):
install_method = 'install.packages'
if 'ver' in x:
R_cmd += [
'install.packages("devtools")',
f'install.packages("devtools", repos="{repos}")',
# ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/'
# '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver'])
]
install_method = 'devtools::install_version'
args = (f"version=\"{x['ver']}\""
args = (f"version=\"{x['ver']}\", repos=\"{repos}\""
+ ("," if x.get('args', '') else "")
+ x.get('args', ''))
# name = 'packageurl'
Expand All @@ -199,7 +199,7 @@ def install_packages(package_list, update=False, repos=None, **kwargs):
else:
R_cmd += [
f"if (!is.element(\"{x['name']}\", installed.packages()[,1])) {{",
f"{install_method}({name}, {args})",
f" {install_method}({name}, {args})",
'} else {',
f" print(\"{x['name']} already installed.\")",
'}']
Expand Down

0 comments on commit 4604224

Please sign in to comment.