Skip to content

Commit b0138b6

Browse files
committed
Add import::what() to vignette and review overall documentation
1 parent 8fe3110 commit b0138b6

4 files changed

Lines changed: 193 additions & 127 deletions

File tree

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Version 1.3.3.9001
55
* New function, import::what(), which lists objects available for import from
66
a given package or module.
77

8-
* Documentation links now point both to release and dev documentation.
8+
* Documentation links now point both to release and development documentation.
9+
10+
* Other minor documentation improvements.
911

1012

1113

README.Rmd

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ using the help (`?import::from`).
2222

2323
The typical way of using functionality exposed by a package in R scripts is to
2424
load (and attach) the entire package with `library()` (or `require()`). This can
25-
have the **undesirable effect of masking objects** in the user's search path and
26-
can also make it difficult and **confusing to identify** what functionality
25+
have the undesirable effect of masking objects in the user's search path and
26+
can also make it difficult and confusing to identify what functionality
2727
comes from which package when using several `library` statements.
2828

2929
The `import` package provides a simple alternative, allowing the user specify in
@@ -36,7 +36,6 @@ import those functions only:
3636
import::from(Hmisc, impute, nomiss)
3737
```
3838

39-
4039
## Installation and Documentation
4140

4241
Install the release version of `import` from CRAN using `pak` or
@@ -47,15 +46,17 @@ pak::pak("import")
4746
# or
4847
install.packages("import")
4948
```
50-
Documentation (for the main branch, which should match the CRAN release)
51-
is available on:
49+
50+
A documentation site is available on GitHub. For the `main` branch, which
51+
usually matches the CRAN release, the link is:
5252

5353
- https://rticulate.github.io/import/
5454

5555

56-
### Development Versions
56+
### Installing from GitHub
5757

58-
Install the development version of `import` from GitHub using `pak`:
58+
Install the either the `main` (release) or the `dev` (development) branch of
59+
`import` from GitHub using `pak`:
5960

6061
```R
6162
# The main branch typically matches the CRAN release
@@ -65,7 +66,7 @@ pak::pak("rticulate/import")
6566
pak::pak("rticulate/import@dev")
6667
```
6768

68-
Documentation for the development version is available on:
69+
Documentation for the `dev` branch is available on:
6970

7071
- https://rticulate.github.io/import/dev/
7172

@@ -74,9 +75,9 @@ Documentation for the development version is available on:
7475

7576
### Importing functions from R packages
7677

77-
The most basic use case is to import a few functions from package (here the
78-
`psych` package). We start by using `import::what()` to list available
79-
functions.
78+
The most basic use case is to import a few functions from package using
79+
`import::from()`. Here we import from the `psych` package. We start by using
80+
`import::what()` to list available functions.
8081

8182
```R
8283
import::what(psych) |> head()
@@ -115,6 +116,7 @@ These and other examples are discussed in more detail in the
115116
[Importing from Packages](https://rticulate.github.io/import/articles/import.html#importing-from-packages)
116117
section of the package vignette.
117118

119+
118120
### Importing Functions from "Module" Scripts
119121

120122
The `import` package allows R files to be used as "modules" from which functions

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ or using the help (`?import::from`).
2424

2525
The typical way of using functionality exposed by a package in R scripts
2626
is to load (and attach) the entire package with `library()` (or
27-
`require()`). This can have the **undesirable effect of masking
28-
objects** in the user’s search path and can also make it difficult and
29-
**confusing to identify** what functionality comes from which package
30-
when using several `library` statements.
27+
`require()`). This can have the undesirable effect of masking objects in
28+
the user’s search path and can also make it difficult and confusing to
29+
identify what functionality comes from which package when using several
30+
`library` statements.
3131

3232
The `import` package provides a simple alternative, allowing the user
3333
specify in a concise way exactly which objects. For example, the `Hmisc`
@@ -50,14 +50,15 @@ pak::pak("import")
5050
install.packages("import")
5151
```
5252

53-
Documentation (for the main branch, which should match the CRAN release)
54-
is available on:
53+
A documentation site is available on GitHub. For the `main` branch,
54+
which usually matches the CRAN release, the link is:
5555

5656
- <https://rticulate.github.io/import/>
5757

58-
### Development Versions
58+
### Installing from GitHub
5959

60-
Install the development version of `import` from GitHub using `pak`:
60+
Install the either the `main` (release) or the `dev` (development)
61+
branch of `import` from GitHub using `pak`:
6162

6263
``` r
6364
# The main branch typically matches the CRAN release
@@ -67,17 +68,17 @@ pak::pak("rticulate/import")
6768
pak::pak("rticulate/import@dev")
6869
```
6970

70-
Documentation for the development version is available on:
71+
Documentation for the `dev` branch is available on:
7172

7273
- <https://rticulate.github.io/import/dev/>
7374

7475
## Usage
7576

7677
### Importing functions from R packages
7778

78-
The most basic use case is to import a few functions from package (here
79-
the `psych` package). We start by using `import::what()` to list
80-
available functions.
79+
The most basic use case is to import a few functions from package using
80+
`import::from()`. Here we import from the `psych` package. We start by
81+
using `import::what()` to list available functions.
8182

8283
``` r
8384
import::what(psych) |> head()

0 commit comments

Comments
 (0)