r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
336 stars 153 forks source link

build package dependen on package has different version from global env #614

Closed longhua8800w closed 3 years ago

longhua8800w commented 3 years ago

i am building an R package which rely on an older version of packages 。 so I add a line : Remotes: local::/Users/xxx/RHome/rpk2install/scorecard_0.3.0.tar.gz in DESCRIPTION file and export an function as api: ver <- function(){ library(scorecard) return(packageVersion("scorecard")) }

but when i install library and call this "ver" function it return 0.3.2 which is the new version in R session's global environment.

how can i let my packages refer to the package i appiont in "Remotes: local::/Users/xxx/RHome/rpk2install/scorecard_0.3.0.tar.gz" ?

jimhester commented 3 years ago

local remotes are directories, not tarballs, so you would have to extract the file.

This sort of question is a better fit for https://community.rstudio.com. Do you mind asking it over there? (You might want to read https://www.tidyverse.org/help/ first to maximise your chances of getting a good answer)