-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Currently we simply call install.packages() to get dependencies, which always prefers the highest version of each R package. However in some cases may need something else.
For example, in we want 'basilisk.utils' from the first repo, however the one in the second repo is higher.
# Problem: we want 'basilisk.utils' from myrepo even though it has a lower version
db <- available.packages(repos = c(
myrepo = 'https://bioconductor-source.r-universe.dev',
bioc = 'https://bioc.r-universe.dev'
))
# Gives us the latter
subset(db, row.names(db) == 'basilisk.utils')The "filters" argument in availabe.packages() allows us to customize this (search base R source for available_packages_filters_db). For example this should filter duplicates left-to-right I think:
db <- available.packages(repos = c(
myrepo = 'https://bioconductor-source.r-universe.dev',
bioc = 'https://bioc.r-universe.dev/'
), filters = list(
"R_version",
"OS_type",
"subarch",
function(db){
db[!duplicated(row.names(db)),]
}
))
Or to make this apply only to bioc we could do like
options(available_packages_filters = list(
"R_version", "OS_type", "subarch",
function(db){
isbioc <- grepl("https://bioc.r-universe.dev", fixed = TRUE, db[,'Repository'])
biocdups <- duplicated(row.names(db)) & isbioc
db[!biocdups,]
},
"duplicates"
))Metadata
Metadata
Assignees
Labels
No labels