Commit 6eef3f4c authored by jlopez's avatar jlopez
Browse files

Add gestion github packages

parent 2783efb9
......@@ -5,6 +5,9 @@ library(shinycssloaders)
library(DT)
library(dplyr)
library(tools)
library(githubinstall)
require(stringi)
library(devtools)
source("./R/helper_functions.R", local = T)
source("./R/menugauche.R", local = T)
......@@ -42,6 +45,7 @@ server <- function( input, output, session) {
#allCRAN <<- as.data.frame(available.packages(repo = "http://cran.us.r-project.org")[, c("Package")])
allCRAN <<- as.data.frame(getPackagesWithTitle())
allBIO <<- as.data.frame(available.packages(repo = biocinstallRepos()[1])[, c("Package", "Version")])
allGITHUB <<- data.frame(Package=character(), Version=character())
hide("downloadContainerFile")
......
......@@ -37,6 +37,9 @@ tabHome = fluidPage(align="left",
tabPanel('Bioconductor',
DT::dataTableOutput('dtrbioconductorpackage')),
tabPanel('Github',
textInput("inputGithub", "Package name:", ""),
actionButton("findGithub", label = "Find", icon("paper-plane"), style="color: #fff; background-color: #337ab7; border-color: #2e6da4"),
br(), br(),
DT::dataTableOutput('dtrgithubpackage'))
)
)
......
......@@ -127,6 +127,32 @@ createContentFile <- function() {
}
result <- paste(result, "\n", sep = "\n")
selectGITHUB <- allGITHUB[input$dtrgithubpackage_rows_selected,]
selectGITHUB <- selectGITHUB[,"Package"]
print(selectGITHUB)
sizeGITHUB <- length(selectGITHUB)
if(!is.null(sizeGITHUB)) {
if(sizeGITHUB >= 1) {
listRGITHUB <- '\tR --slave -e "install_github(c('
for (pkg in 1:sizeGITHUB){
if(pkg < sizeGITHUB) {
listRGITHUB <- paste0(listRGITHUB, '"',selectGITHUB[pkg],'", ')
} else {
listRGITHUB <- paste0(listRGITHUB, '"',selectGITHUB[pkg],'"))')
}
}
result <- paste(result, listRGITHUB, sep = "\n")
}
}
result <- paste(result, "\n", sep = "\n")
result <- paste(result, input$customDataContainer, sep = "\t\n")
......@@ -167,3 +193,21 @@ output$downloadContainerFile <- downloadHandler(
# updateSelectizeInput(session,"rcranpackagelist", choices = selectCRAN, selected = selectCRAN, options = list())
#
#})
observeEvent(input$findGithub, {
name <- input$inputGithub
if(!stri_isempty(name)) {
allGITHUB <<- data.frame(Package = gh_suggest(name, keep_title = FALSE), Title = attr(gh_suggest(name, keep_title = TRUE), "title"))
output$dtrgithubpackage <- DT::renderDataTable({
result <- allGITHUB
return(result)
}, filter='top', escape = FALSE, rownames= FALSE,server = TRUE)
}
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment