File: use_import_from.md

package info (click to toggle)
r-cran-usethis 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: sh: 26; makefile: 17; cpp: 6; ansic: 3
file content (28 lines) | stat: -rw-r--r-- 709 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# use_import_from() adds one line for each function

    Code
      roxygen_ns_show()
    Output
      [1] "#' @importFrom lifecycle deprecate_stop"
      [2] "#' @importFrom lifecycle deprecate_warn"

# use_import_from() generates helpful errors

    Code
      use_import_from(1)
    Condition
      Error in `use_import_from()`:
      x `package` must be a single string.
    Code
      use_import_from(c("desc", "rlang"))
    Condition
      Error in `use_import_from()`:
      x `package` must be a single string.
    Code
      use_import_from("desc", "pool_noodle")
    Condition
      Error in `map2()`:
      i In index: 1.
      Caused by error in `.f()`:
      x Can't find `desc::pool_noodle()`.