Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d759ac

Browse files
authored
Replace references to ‘modules’ with ‘box’ (#107)
Update the “alternative” approaches to use ‘box’ instead of thedeprecated ‘modules’: ‘box’ is the name of the current version of‘modules’. However, its API has changed substantially, so the usageexample was adapted to show the different ways of using it.
1 parent321d77c commit4d759ac

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

‎README.Rmd‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,17 @@ Loading conflicted creates a new "conflicted" environment that is attached just
7676

7777
##Alternative approaches
7878

79-
It is worth comparing conflicted to[modules](https://github.com/klmr/modules) and[import](https://github.com/rticulate/import). Both packages provide strict alternatives to`library()`, giving much finer control over what functions are added to the search path.
79+
It is worth comparing conflicted to[box](https://github.com/klmr/box) and[import](https://github.com/rticulate/import). Both packages provide strict alternatives to`library()`, giving much finer control over what functions are added to the search path.
8080

8181
```{r, eval = FALSE}
82-
#modules expects you to namespace all package functions
83-
dplyr <- modules::import_package('dplyr')
82+
#box expects you toeithernamespace all package functions or to load them explicitly
83+
box::use(dplyr)
8484
dplyr$filter(mtcars, cyl == 8)
85+
# or:
86+
box::use(dplyr[select, arrange, dplyr_filter = filter])
87+
dplyr_filter(mtcars, cyl == 8)
8588
86-
# import expects you toexplicit load functions
89+
# import expects you toexplicitly load functions
8790
import::from(dplyr, select, arrange, dplyr_filter = filter)
8891
dplyr_filter(mtcars, cyl == 8)
8992
```

‎README.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,20 @@ update the conflicted environment with any new conflicts.
103103

104104
##Alternative approaches
105105

106-
It is worth comparing conflicted to
107-
[modules](https://github.com/klmr/modules) and
108-
[import](https://github.com/rticulate/import). Both packages provide
106+
It is worth comparing conflicted to[box](https://github.com/klmr/box)
107+
and[import](https://github.com/rticulate/import). Both packages provide
109108
strict alternatives to`library()`, giving much finer control over what
110109
functions are added to the search path.
111110

112111
```r
113-
#modules expects you to namespace all package functions
114-
dplyr<-modules::import_package('dplyr')
112+
#box expects you toeithernamespace all package functions or to load them explicitly
113+
box::use(dplyr)
115114
dplyr$filter(mtcars,cyl==8)
115+
# or:
116+
box::use(dplyr[select,arrange,dplyr_filter=filter])
117+
dplyr_filter(mtcars,cyl==8)
116118

117-
# import expects you toexplicit load functions
119+
# import expects you toexplicitly load functions
118120
import::from(dplyr,select,arrange,dplyr_filter=filter)
119121
dplyr_filter(mtcars,cyl==8)
120122
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp