Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_ref() does not behave as indicated in Examples #348

Open
ramiromagno opened this issue Aug 1, 2024 · 1 comment
Open

pkg_ref() does not behave as indicated in Examples #348

ramiromagno opened this issue Aug 1, 2024 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@ramiromagno
Copy link

In pkg_ref() doc:

# You can also override this behavior with a source argument
ref_2 <- pkg_ref("utils", source = "pkg_cran_remote")
ref_2$source  # returns 'pkg_cran_remote'

But:

library(riskmetric)
ref_2 <- pkg_ref("utils", source = "pkg_cran_remote")
#> Warning in verify_pkg_source(x, source, repos): Package: `utils` not found on
#> CRAN, source is now 'pkg_missing'
ref_2$source
#> [1] "pkg_missing"
sessionInfo()
#> R version 4.4.0 (2024-04-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Arch Linux
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/libblas.so.3.12.0 
#> LAPACK: /usr/lib/liblapack.so.3.12.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: Europe/Lisbon
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] riskmetric_0.2.4.9000
#> 
#> loaded via a namespace (and not attached):
#>  [1] styler_1.10.3       utf8_1.2.4          xml2_1.3.6         
#>  [4] stringi_1.8.4       digest_0.6.35       magrittr_2.0.3     
#>  [7] evaluate_0.24.0     pkgload_1.3.4       fastmap_1.2.0      
#> [10] R.oo_1.26.0         R.cache_0.16.0      jsonlite_1.8.8     
#> [13] R.utils_2.12.3      pkgbuild_1.4.4      sessioninfo_1.2.2  
#> [16] cranlogs_2.1.1      backports_1.5.0     urltools_1.7.3     
#> [19] urlchecker_1.0.1    promises_1.3.0      BiocManager_1.30.23
#> [22] httr_1.4.7          fansi_1.0.6         purrr_1.0.2        
#> [25] lazyeval_0.2.2      cli_3.6.2           shiny_1.8.1.1      
#> [28] rlang_1.1.3         covr_3.6.4          triebeard_0.4.1    
#> [31] R.methodsS3_1.8.2   ellipsis_0.3.2      reprex_2.1.0       
#> [34] remotes_2.5.0       withr_3.0.0         cachem_1.1.0       
#> [37] yaml_2.3.8          devtools_2.4.5      tools_4.4.0        
#> [40] memoise_2.0.1       httpuv_1.6.15       curl_5.2.1         
#> [43] vctrs_0.6.5         R6_2.5.1            mime_0.12          
#> [46] lifecycle_1.0.4     stringr_1.5.1       fs_1.6.4           
#> [49] htmlwidgets_1.6.4   usethis_2.2.3       miniUI_0.1.1.1     
#> [52] pkgconfig_2.0.3     pillar_1.9.0        rex_1.2.1          
#> [55] later_1.3.2         glue_1.7.0          profvis_0.3.8      
#> [58] Rcpp_1.0.12         tibble_3.2.1        xfun_0.44          
#> [61] rstudioapi_0.16.0   knitr_1.46          xtable_1.8-4       
#> [64] htmltools_0.5.8.1   rmarkdown_2.27      compiler_4.4.0

Created on 2024-08-01 with reprex v2.1.0

@emilliman5 emilliman5 added the Bug Something isn't working label Aug 6, 2024
@emilliman5 emilliman5 self-assigned this Sep 17, 2024
@emilliman5
Copy link
Collaborator

The example needs to be updated. I think, because utils is a base package it is not technically in CRAN which is why you are getting this error. When I use ggplot2 or nlme I get the intended result as shown in the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants