Error happens when use `use_package`

usethis

#1

In the help decoument, I find example like

Examples
## Not run: 
use_package("ggplot2")
use_package("dplyr", "suggests")
use_dev_package("glue")

## End(Not run)

But when I do this, I get errors below.

library(usethis)
use_package("dplyr", "data.table")
#> Error in match.arg(tolower(type), types): 'arg'应当是"imports", "depends", "suggests", "enhances", "linkingto"其中的一个
use_package("dplyr", "data.table",type = "Suggests")
#> Error in use_package("dplyr", "data.table", type = "Suggests"): 参数没有用("data.table")

Created on 2018-11-08 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> - Session info ----------------------------------------------------------
#>  setting  value                                              
#>  version  R version 3.4.4 (2018-03-15)                       
#>  os       Windows 7 x64 SP 1                                 
#>  system   x86_64, mingw32                                    
#>  ui       RTerm                                              
#>  language (EN)                                               
#>  collate  Chinese (Simplified)_People's Republic of China.936
#>  ctype    Chinese (Simplified)_People's Republic of China.936
#>  tz       Asia/Taipei                                        
#>  date     2018-11-08                                         
#> 
#> - Packages --------------------------------------------------------------
#>  package     * version date       lib source        
#>  assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.4.4)
#>  backports     1.1.2   2017-12-13 [1] CRAN (R 3.4.3)
#>  base64enc     0.1-3   2015-07-28 [1] CRAN (R 3.4.1)
#>  callr         3.0.0   2018-08-24 [1] CRAN (R 3.4.4)
#>  cli           1.0.1   2018-09-25 [1] CRAN (R 3.4.4)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.4.4)
#>  debugme       1.1.0   2017-10-22 [4] CRAN (R 3.4.3)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.4.4)
#>  devtools      2.0.1   2018-10-26 [1] CRAN (R 3.4.4)
#>  digest        0.6.18  2018-10-10 [1] CRAN (R 3.4.4)
#>  evaluate      0.12    2018-10-09 [1] CRAN (R 3.4.4)
#>  fs            1.2.6   2018-08-23 [1] CRAN (R 3.4.4)
#>  glue          1.3.0   2018-07-17 [1] CRAN (R 3.4.4)
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.4.4)
#>  knitr         1.20    2018-02-20 [1] CRAN (R 3.4.4)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.4.4)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.4.4)
#>  pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.4.4)
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.4.4)
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.4.4)
#>  processx      3.2.0   2018-08-16 [1] CRAN (R 3.4.4)
#>  ps            1.2.0   2018-10-16 [1] CRAN (R 3.4.4)
#>  R6            2.3.0   2018-10-04 [1] CRAN (R 3.4.4)
#>  Rcpp          0.12.19 2018-10-01 [1] CRAN (R 3.4.4)
#>  remotes       2.0.2   2018-10-30 [1] CRAN (R 3.4.4)
#>  rlang         0.3.0.1 2018-10-25 [1] CRAN (R 3.4.4)
#>  rmarkdown     1.10    2018-06-11 [1] CRAN (R 3.4.4)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.4.4)
#>  sessioninfo   1.1.0   2018-09-25 [1] CRAN (R 3.4.4)
#>  stringi       1.1.7   2018-03-12 [1] CRAN (R 3.4.4)
#>  stringr       1.3.1   2018-05-10 [1] CRAN (R 3.4.4)
#>  testthat      2.0.0   2017-12-13 [4] CRAN (R 3.4.3)
#>  usethis     * 1.4.0   2018-08-14 [1] CRAN (R 3.4.4)
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.4.4)
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.4.4)
#> 
#> [1] D:/weDo/imp_rmd00/add2blog/packrat/lib/x86_64-w64-mingw32/3.4.4
#> [2] D:/weDo/imp_rmd00/add2blog/packrat/lib-ext/x86_64-w64-mingw32/3.4.4
#> [3] D:/weDo/imp_rmd00/add2blog/packrat/lib-R/x86_64-w64-mingw32/3.4.4
#> [4] C:/Program Files/R/R-3.4.4/library

#2

Take a closer look at examples in the help file. They all add 1 package at a time. You are trying to add two and that is why you are getting this error.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.