File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 11Package: parallelly
2- Version: 1.46.1-9004
2+ Version: 1.46.1-9005
33Title: Enhancing the 'parallel' Package
44Imports:
55 parallel,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments