Skip to content

Commit babcdaf

Browse files
Wine vignette: Explain how to install packages in Wine
1 parent a5448d9 commit babcdaf

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: parallelly
2-
Version: 1.46.1-9004
2+
Version: 1.46.1-9005
33
Title: Enhancing the 'parallel' Package
44
Imports:
55
parallel,

vignettes/parallelly-22-wine-workers.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,42 @@ print(cl)
7171
```
7272

7373

74+
## Example: Installing packages in Wine
75+
76+
To install packages in Wine, we need to make sure that the personal
77+
package library exists. To create this, call:
78+
79+
```r
80+
void <- parallel::clusterEvalQ(cl[1], {
81+
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
82+
})
83+
```
84+
85+
After this, _make sure to restart the above `cl` cluster_, which can do as:
86+
87+
```r
88+
parallel::stopCluster(cl)
89+
for (kk in seq_along(cl)) cl[[kk]] <- cloneNode(cl[[kk]])
90+
```
91+
92+
Now we have a personal package library:
93+
94+
```r
95+
parallel::clusterEvalQ(cl[1], { .libPaths() })[[1]]
96+
[1] "C:/users/alice/AppData/Local/R/win-library/4.5"
97+
[2] "C:/PROG~FBU/R/R-45~RZJ.2/library"
98+
```
99+
100+
At this point, we can install R packages, e.g.
101+
102+
```r
103+
void <- parallel::clusterEvalQ(cl[1], {
104+
chooseCRANmirror(ind = 1L)
105+
install.packages("future")
106+
})
107+
```
108+
109+
74110
# Appendix
75111

76112
## Wine and R warnings

0 commit comments

Comments
 (0)