Comments (12)
This is by no means complete but a test walk through of creating a data frame of packages and repo locations:
p_bioconductor <- function(URL = "http://www.bioconductor.org/packages/json/2.10/bioc/packages.js") {
require(RJSONIO)
require(RCurl)
x <- getURL(URL)
x <- substr(x, 21, nchar(x)-1)
x <- fromJSON(x)[[1]]
x <- data.frame(matrix(unlist(x), ncol = 3, byrow = TRUE), stringsAsFactors = FALSE)
names(x) <- c("Package", "Maintainer", "Title")
return(x)
} #compliments of bryan goodrich
p_pack.loc <- function() {
x <- p_cran()
y <- p_bioconductor()[, 1]
z <- p_seeRipley()
loc <- rep(c("cran", "bio", "ripley"), c(length(x), length(y), length(z)))
data.frame(package = c(x, y, z), location = loc, stringsAsFactors = FALSE)
}
p_packs_data <- p_pack.loc()
p_lookup <- function(package.name) {
p_packs_data[, 2][p_packs_data[, 1] %in% package.name]
}
p_lookup("ggplot2")
from pacman.
Note: you need seeRipley
to run the above. Currently this is internal and not exported so here's the code:
p_seeRipley <-
function() {
URL <- "http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.15/PACKAGES"
x <- tolower(readLines(URL))
sapply(strsplit(x[grep("package:", x)], ": "), function(x) x[2])
}
Also it looks like bioconductor uses its own install function now:
source("http://bioconductor.org/biocLite.R")
biocLite("limma")
http://www.bioconductor.org/install/
from pacman.
Just looking through the code... I'm wondering what we need p_exists for?
from pacman.
It was to check if something was on CRAN. I thought it may be nice for the user but if we make the changes we were talking about (with having p_load go to the appropriate repository and grab the package) then this seems to not be useful to any great extent.
from pacman.
I guess I just can't see a user saying "is there a package with this name on CRAN?" I personally can't imagine a situation where I would care to use the function as is.
If, though, we put some time into figuring out the github api and were able to search for packages on github and extract user names... that might be useful...
from pacman.
Ok here's a scenario. I heard about OpenMx
and tried to use install.packages
cran. No dice. using p_exists` could be a check but the install.packages error would do that in a way. Not saying its a good idea just presenting why to help make a decision. If it's not useful it adds a function that means more to keep track of and less intuitive; not what pacman is about.
from pacman.
The api is sometimes difficult to make exist on a windows machine. Not
saying impossible but difficult for me.
On Sun, Mar 24, 2013 at 12:17 AM, Dason Kurkiewicz <[email protected]
wrote:
I guess I just can't see a user saying "is there a package with this name
on CRAN?" I personally can't imagine a situation where I would care to use
the function as is.If, though, we put some time into figuring out the github api and were
able to search for packages on github and extract user names... that might
be useful...—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-15351243
.
from pacman.
It's actually not too bad using the api
library(RCurl)
# We can replace the 'ggplot2' with whatever we want to search...
ggplot2Repos <- getURL("https://api.github.com/legacy/repos/search/ggplot2")
# alternatively
ggplot2Repos <- getForm("https://api.github.com/legacy/repos/search/ggplot2") #, language = "R")
# Result is json
library(rjson)
gglist <- fromJSON(ggplot2Repos)
# We only really care about repositories...
gglist <- gglist$repositories
# let's check out the first result...
gglist[[1]] # no surprise that it's Hadley's...
from pacman.
Yeah for this task, for creating a repo and sending to github it's been rough. I've abandoned the idea for now:
trinker/reports#5 but for us it seems very usable.
On Sun, Mar 24, 2013 at 1:12 AM, Dason Kurkiewicz
[email protected]:
It's actually not too bad using the api
library(RCurl)
We can replace the 'ggplot2' with whatever we want to search...
ggplot2Repos <- getURL("https://api.github.com/legacy/repos/search/ggplot2")
alternatively
ggplot2Repos <- getForm("https://api.github.com/legacy/repos/search/ggplot2") #, language = "R")
Result is json
library(rjson)
gglist <- fromJSON(ggplot2Repos)
We only really care about repositories...
gglist <- gglist$repositories
let's check out the first result...
gglist[[1]] # no surprise that it's Hadley's...
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-15351644
.
from pacman.
Should we close this issue?
from pacman.
I can't remember but I think this came about for the ability to have p_load
grab from CRAN or bioconductor. I don't think p_exists
needs to do this.
I guess the question we need to answer is do we want to include bioconductor with CRAN in pacman functions as a possible repository?
from pacman.
I think eventually we do but for the time being lets focus on getting things working as best as possible just with CRAN. Adding in Rforge/bioconductor/github comes later.
from pacman.
Related Issues (20)
- Feature request: suppress warning for trailing comma
- BiocManager missing in fresh install HOT 1
- INSTALL_opts=c("--no-docs", "--no-help","--no-html") but still trying to install HOT 1
- Failing to find bioconductor packages HOT 2
- Cannot Install pacman via CRAN HOT 1
- “there is no package called ‘rgl’” 🐞 HOT 2
- p_load_gh( ... , update = TRUE) does not update github packages
- passing dependecies = T to p_load
- Strange capitalisation warning when trying to update loaded github package HOT 1
- misleading warning for bioconductor packages HOT 1
- GPLv2 license
- pak as package install backend?
- backspace characters in message() cause errors for pdf output HOT 1
- Pacman packages HOT 1
- file loading issues
- No code completion with `p_load()` in VS COde HOT 3
- need a p_delete() function
- setting library location in p_load
- [Feature] P_Install only if package does not exists
- p_install quiet option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pacman.