├── inst ├── extdata │ ├── .gitignore │ ├── raddins.csv │ └── raddins.md └── rstudio │ └── addins.dcf ├── .gitignore ├── images └── screenshot.png ├── .Rbuildignore ├── NEWS.md ├── .travis.yml ├── NAMESPACE ├── man └── addin_manager.Rd ├── addinselector.Rproj ├── DESCRIPTION ├── README.Rmd ├── R └── addinpicker.R └── README.md /inst/extdata/.gitignore: -------------------------------------------------------------------------------- 1 | raddins.html 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csgillespie/addinmanager/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | .travis.yml 4 | images 5 | ^README\.Rmd$ 6 | ^README-.*\.png$ 7 | -------------------------------------------------------------------------------- /inst/rstudio/addins.dcf: -------------------------------------------------------------------------------- 1 | Name: Addin manager 2 | Description: Addin to maintain other addins 3 | Binding: addin_manager 4 | Interactive: true 5 | 6 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # Version 0.1.2 2 | * Move to addins.md 3 | 4 | # Version 0.1.1 5 | * Try and download addins.csv (suggested by @calligross). 6 | 7 | # Version 0.1.0 8 | * Initial release. 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: r 2 | cache: packages 3 | 4 | r: 5 | - release 6 | 7 | r_github_packages: 8 | - rstudio/DT 9 | 10 | notifications: 11 | email: 12 | on_success: change 13 | on_failure: change 14 | 15 | ## Only run covr on release 16 | #after_success: 17 | # - Rscript -e "if(length(grep('2\$', ${TRAVIS_JOB_NUMBER}))) covr::codecov()"; 18 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(addin_manager) 4 | import(miniUI) 5 | importFrom(DT,dataTableOutput) 6 | importFrom(DT,renderDataTable) 7 | importFrom(devtools,install_github) 8 | importFrom(shiny,a) 9 | importFrom(shiny,observeEvent) 10 | importFrom(shiny,paneViewer) 11 | importFrom(shiny,runGadget) 12 | importFrom(shiny,stopApp) 13 | -------------------------------------------------------------------------------- /man/addin_manager.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/addinpicker.R 3 | \name{addin_manager} 4 | \alias{addin_manager} 5 | \title{Addin manager} 6 | \usage{ 7 | addin_manager() 8 | } 9 | \description{ 10 | An RStudio addin for managing addins! When the addin is lauched, you can select 11 | which addins to install or remove. 12 | } 13 | 14 | -------------------------------------------------------------------------------- /addinselector.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | StripTrailingWhitespace: Yes 16 | 17 | BuildType: Package 18 | PackageUseDevtools: Yes 19 | PackageInstallArgs: --no-multiarch --with-keep.source 20 | PackageRoxygenize: rd,collate,namespace 21 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: addinmanager 2 | Type: Package 3 | Title: RStudio 'addin' Manager 4 | Version: 0.1.2 5 | Date: 2016-04-11 6 | Authors@R: person(given="Colin", family="Gillespie", 7 | email="csgillespie@gmail.com", role = c("aut", "cre")) 8 | Maintainer: Colin Gillespie 9 | Description: An RStudio addin to manage installing and removing other RStudio addins. 10 | License: GPL-2 | GPL-3 11 | LazyData: TRUE 12 | URL: https://github.com/csgillespie/addinmanager 13 | BugReports: https://github.com/csgillespie/addinmanager/issues 14 | Imports: 15 | DT (>= 0.1.3), 16 | miniUI, 17 | shiny, devtools 18 | RoxygenNote: 5.0.1 19 | -------------------------------------------------------------------------------- /inst/extdata/raddins.csv: -------------------------------------------------------------------------------- 1 | "Name","Description","Package" 2 | "ggplot2 Marginal Plots","Add marginal plots to ggplot2","ggExtra" 3 | "ggplot Theme Assist","Customize your ggplot theme","ggThemeAssist" 4 | "Data Recoding","Interactively generate R code for variable manipulation (levels editing / levels ordering / cutting)","questionr" 5 | "Colour Picker","Lets you easily select colours","shinyjs" 6 | "Roxygen2 comments"," Add/remove roxygen2 comments ","csgillespie/roxygen2Comment" 7 | "Schedule Rscripts","Easily scheduling Rscripts","jwijffels/taskscheduleR" 8 | "Assign Default Values","Set function arguments in selection to their default values","jennybc/jadd" 9 | "Wrap Rmd","Wrap selected R Markdown text but don't insert lines breaks into inline R code","tjmahr/WrapRmd" 10 | "Tidy Data","Interactively build tidyr function call (gather)","MangoTheCat/tidyshiny" 11 | "Lattice Plotting","Interactively build plots using the `lattice` system","homerhanumat/addinplots" 12 | "Copy Frame to Clipboard","Copy a `data.frame` to the clipboard","BAAQMD/copydat" 13 | "Render Rmd in Console","Render an R Markdown document in the global environment","jeffjjohnston/RStudioConsoleRender" 14 | "Document This","Auto-generate Roxygen skeletons for functions and data","mdlincoln/docthis" 15 | "Hist Add-In","Interactively create histograms with ggplot2 and obtain the R Code","Stan125/limoaddin" 16 | "Graphical Unit Testing"," Visual regression testing and graphical diffing with testthat ","lionel-/vdiffr" 17 | -------------------------------------------------------------------------------- /inst/extdata/raddins.md: -------------------------------------------------------------------------------- 1 | ## Table of addins 2 | 3 | To include your addin, just add it to the table below. General points: 4 | 5 | * The name should be less than 20 characters 6 | * Don't go overboard on the Description 7 | * If the package is on CRAN, just add the package name. Otherwise use repo/pkgName. 8 | * The `raddins.csv` is from an old version, and will eventually be deleted. At present 9 | I just generate the `raddins.csv` from `raddins.md`. 10 | 11 | 12 | 13 | 14 | 15 | Name|Description|Package 16 | ----------------|---------------------------|------- 17 | ggplot2 Marginal Plots|Add marginal plots to ggplot2|ggExtra 18 | ggplot Theme Assist|Customize your ggplot theme|ggThemeAssist 19 | Data Recoding|Interactively generate R code for variable manipulation (levels editing / levels ordering / cutting)|questionr 20 | Colour Picker|Lets you easily select colours|shinyjs 21 | Roxygen2 comments| Add/remove roxygen2 comments |csgillespie/roxygen2Comment 22 | Schedule Rscripts|Easily scheduling Rscripts|jwijffels/taskscheduleR 23 | Assign Default Values|Set function arguments in selection to their default values|jennybc/jadd 24 | Wrap Rmd|Wrap selected R Markdown text but don't insert lines breaks into inline R code|tjmahr/WrapRmd 25 | Tidy Data|Interactively build tidyr function call (gather)|MangoTheCat/tidyshiny 26 | Lattice Plotting|Interactively build plots using the `lattice` system|homerhanumat/addinplots 27 | Copy Frame to Clipboard|Copy a `data.frame` to the clipboard|BAAQMD/copydat 28 | Render Rmd in Console|Render an R Markdown document in the global environment|jeffjjohnston/RStudioConsoleRender 29 | Document This|Auto-generate Roxygen skeletons for functions and data|mdlincoln/docthis 30 | Hist Add-In|Interactively create histograms with ggplot2 and obtain the R Code|Stan125/limoaddin 31 | Graphical Unit Testing| Visual regression testing and graphical diffing with testthat |lionel-/vdiffr 32 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | md_document: 4 | variant: markdown_github 5 | --- 6 | 7 | 8 | 9 | ```{r, echo = FALSE} 10 | knitr::opts_chunk$set( 11 | collapse = TRUE, 12 | comment = "#>", 13 | fig.path = "README-" 14 | ) 15 | ``` 16 | 17 | # RStudio addins manager 18 | [![Build Status](https://travis-ci.org/csgillespie/addinmanager.png?branch=master)](https://travis-ci.org/csgillespie/addinmanager) 19 | [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/addinmanager)](https://cran.r-project.org/package=addinmanager) 20 | 21 | RStudio addins let you execute a bit of R code or a Shiny app through the RStudio IDE, 22 | either via the Addins dropdown menu or with a keyboard shortcut. 23 | This package is an RStudio addin for managing **other** addins. To run these addins, you need the 24 | latest version of [RStudio](https://www.rstudio.com/). 25 | 26 | ## Installation 27 | 28 | The package can be installed via `devtools` 29 | 30 | ```{r eval=FALSE} 31 | ## Need the latest version of DT as well 32 | devtools::install_github('rstudio/DT') 33 | devtools::install_github("csgillespie/addinmanager") 34 | ``` 35 | 36 | You can test the package at the command line with 37 | 38 | ```{r eval=FALSE} 39 | addinmanager::addin_manager() 40 | ``` 41 | 42 | ## Running addins 43 | 44 | After installing the package, the _Addins_ menu toolbar will be populated with a 45 | new addin called __Addin Manager__. When you lauch this addin, a DT table will be launched: 46 | 47 | ![Screenshot](https://raw.github.com/csgillespie/addinmanager/master/images/screenshot.png) 48 | 49 | In the screenshot above, the highlighted addins, `shinyjs` and `ggThemeAssit`, 50 | indicate that this addins have already installed. 51 | 52 | When you click **Done** 53 | 54 | * Highlighted addins will be installed. 55 | * Un-highlighted addins will be removed. 56 | 57 | Simple! 58 | 59 | 60 | ## Including your addin 61 | 62 | Just fork and alter [raddins.md](https://github.com/csgillespie/addinmanager/tree/master/inst/extdata/raddins.md) which is located in the `inst/extdata` directory. This file is a md file with three columns: 63 | 64 | * addin Name/title 65 | * Brief Description 66 | * Package. If the package is only on github, use name/repo. 67 | 68 | The initial list of addins was obtain from [daattali](https://github.com/daattali/rstudio-addins) 69 | repo. 70 | 71 | ## Current List of Addins 72 | 73 | ```{r echo=FALSE} 74 | dd = read.csv("inst/extdata/raddins.md", sep="|", header=TRUE, skip=14)[-1,] 75 | write.csv(dd, file="inst/extdata/raddins.csv", row.names=FALSE) 76 | knitr::kable(dd) 77 | ``` 78 | 79 | ## Other information 80 | 81 | * If you have any suggestions or find bugs, please use the github [issue tracker](https://github.com/csgillespie/addmanager/issues). 82 | * Feel free to submit pull requests. 83 | * TODO: Make the package name a url in the table. -------------------------------------------------------------------------------- /R/addinpicker.R: -------------------------------------------------------------------------------- 1 | clean_addins = function(addins) { 2 | ## Determine which packages are in CRAN. 3 | ## Assume others are in github 4 | addins$is_cran = !grepl("/", addins[,3]) 5 | 6 | ## For github packages, get package name 7 | names = unlist(strsplit(addins$Package[!addins$is_cran], "/")) 8 | ## Remove github user names 9 | names = names[seq(2, length(names), by=2)] 10 | #urls = ifelse(addins$is_cran, "https://cran.r-project.org/package=", "https://github.com") 11 | 12 | ## Nice Package name 13 | addins$full_name = addins$Package 14 | addins$Package[!addins$is_cran] = names 15 | addins 16 | } 17 | 18 | read_addins = function(path) { 19 | read.csv(path, sep="|", header=TRUE, skip=14, stringsAsFactors = FALSE)[-1,] 20 | } 21 | 22 | 23 | get_addins = function() { 24 | ## Download raddins.csv from web if possible 25 | url = "https://raw.githubusercontent.com/csgillespie/addinmanager/master/inst/extdata/raddins.md" 26 | addins = suppressWarnings(try(read_addins(url), silent=TRUE)) 27 | 28 | if(class(addins) == "try-error" || nrow(addins) == 0) { 29 | message("Can't access online version of addins. Using local copy as fallback.") 30 | ## Locate file of raddins 31 | path = system.file("extdata/raddins.md", package = "addinmanager") 32 | addins = read_addins(path) 33 | } 34 | clean_addins(addins) 35 | } 36 | 37 | 38 | #' Addin manager 39 | #' 40 | #' An RStudio addin for managing addins! When the addin is lauched, you can select 41 | #' which addins to install or remove. 42 | #' @importFrom DT renderDataTable dataTableOutput 43 | #' @import miniUI 44 | #' @importFrom shiny observeEvent stopApp paneViewer runGadget a 45 | #' @importFrom devtools install_github 46 | #' @export 47 | addin_manager = function() { 48 | 49 | # Our ui will be a simple gadget page, which 50 | # simply displays the time in a 'UI' output. 51 | ui = miniPage( 52 | gadgetTitleBar(a(href="https://github.com/csgillespie/addinmanager", "RStudio Addins")), 53 | miniContentPanel( 54 | DT::dataTableOutput("addins") 55 | ) 56 | ) 57 | 58 | server = function(input, output, session) { 59 | ## Set DT page length 60 | options(DT.options = list(pageLength = 10)) 61 | 62 | addins = get_addins() 63 | 64 | ## See which packages are already installed to highlight 65 | install_pack = installed.packages()[,1] 66 | highlight = rownames(addins[addins[,3] %in% install_pack,]) 67 | 68 | ## Total number of pacakges 69 | all_packages = as.character(1:nrow(addins)) 70 | 71 | output$addins = DT::renderDataTable(addins[,1:3], server = FALSE, 72 | selection = list(mode = 'multiple', selected = highlight), 73 | rownames=FALSE) 74 | 75 | observeEvent(input$done, { 76 | ## Packages to install 77 | rows_selected = input$addins_rows_selected 78 | ## Don't install packages already installed 79 | select = rows_selected[!(rows_selected %in% highlight)] 80 | for(i in select) { 81 | if(addins$is_cran[i]) 82 | install.packages(addins[i,"full_name"]) 83 | else 84 | devtools::install_github(addins[i,"full_name"]) 85 | } 86 | 87 | ## Packages to remove 88 | not_select = all_packages[!(all_packages %in% rows_selected)] 89 | ## Only remove packages already installed 90 | not_select = not_select[not_select %in% highlight] 91 | for(i in not_select) 92 | remove.packages(addins[i,"Package"]) 93 | 94 | stopApp() 95 | }) 96 | 97 | 98 | } 99 | viewer = paneViewer(300) 100 | runGadget(ui, server, viewer = viewer) 101 | } 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | RStudio addins manager 3 | ====================== 4 | 5 | [![Build Status](https://travis-ci.org/csgillespie/addinmanager.png?branch=master)](https://travis-ci.org/csgillespie/addinmanager) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/addinmanager)](https://cran.r-project.org/package=addinmanager) 6 | 7 | RStudio addins let you execute a bit of R code or a Shiny app through the RStudio IDE, either via the Addins dropdown menu or with a keyboard shortcut. This package is an RStudio addin for managing **other** addins. To run these addins, you need the latest version of [RStudio](https://www.rstudio.com/). 8 | 9 | Installation 10 | ------------ 11 | 12 | The package can be installed via `devtools` 13 | 14 | ``` r 15 | ## Need the latest version of DT as well 16 | devtools::install_github('rstudio/DT') 17 | devtools::install_github("csgillespie/addinmanager") 18 | ``` 19 | 20 | You can test the package at the command line with 21 | 22 | ``` r 23 | addinmanager::addin_manager() 24 | ``` 25 | 26 | Running addins 27 | -------------- 28 | 29 | After installing the package, the *Addins* menu toolbar will be populated with a new addin called **Addin Manager**. When you lauch this addin, a DT table will be launched: 30 | 31 | ![Screenshot](https://raw.github.com/csgillespie/addinmanager/master/images/screenshot.png) 32 | 33 | In the screenshot above, the highlighted addins, `shinyjs` and `ggThemeAssit`, indicate that this addins have already installed. 34 | 35 | When you click **Done** 36 | 37 | - Highlighted addins will be installed. 38 | - Un-highlighted addins will be removed. 39 | 40 | Simple! 41 | 42 | Including your addin 43 | -------------------- 44 | 45 | Just fork and alter [raddins.md](https://github.com/csgillespie/addinmanager/tree/master/inst/extdata/raddins.md) which is located in the `inst/extdata` directory. This file is a md file with three columns: 46 | 47 | - addin Name/title 48 | - Brief Description 49 | - Package. If the package is only on github, use name/repo. 50 | 51 | The initial list of addins was obtain from [daattali](https://github.com/daattali/rstudio-addins) repo. 52 | 53 | Current List of Addins 54 | ---------------------- 55 | 56 | | | Name | Description | Package | 57 | |-----|:------------------------|:-----------------------------------------------------------------------------------------------------|:-----------------------------------| 58 | | 2 | ggplot2 Marginal Plots | Add marginal plots to ggplot2 | ggExtra | 59 | | 3 | ggplot Theme Assist | Customize your ggplot theme | ggThemeAssist | 60 | | 4 | Data Recoding | Interactively generate R code for variable manipulation (levels editing / levels ordering / cutting) | questionr | 61 | | 5 | Colour Picker | Lets you easily select colours | shinyjs | 62 | | 6 | Roxygen2 comments | Add/remove roxygen2 comments | csgillespie/roxygen2Comment | 63 | | 7 | Schedule Rscripts | Easily scheduling Rscripts | jwijffels/taskscheduleR | 64 | | 8 | Assign Default Values | Set function arguments in selection to their default values | jennybc/jadd | 65 | | 9 | Wrap Rmd | Wrap selected R Markdown text but don't insert lines breaks into inline R code | tjmahr/WrapRmd | 66 | | 10 | Tidy Data | Interactively build tidyr function call (gather) | MangoTheCat/tidyshiny | 67 | | 11 | Lattice Plotting | Interactively build plots using the `lattice` system | homerhanumat/addinplots | 68 | | 12 | Copy Frame to Clipboard | Copy a `data.frame` to the clipboard | BAAQMD/copydat | 69 | | 13 | Render Rmd in Console | Render an R Markdown document in the global environment | jeffjjohnston/RStudioConsoleRender | 70 | | 14 | Document This | Auto-generate Roxygen skeletons for functions and data | mdlincoln/docthis | 71 | | 15 | Hist Add-In | Interactively create histograms with ggplot2 and obtain the R Code | Stan125/limoaddin | 72 | | 16 | Graphical Unit Testing | Visual regression testing and graphical diffing with testthat | lionel-/vdiffr | 73 | 74 | Other information 75 | ----------------- 76 | 77 | - If you have any suggestions or find bugs, please use the github [issue tracker](https://github.com/csgillespie/addmanager/issues). 78 | - Feel free to submit pull requests. 79 | - TODO: Make the package name a url in the table. 80 | --------------------------------------------------------------------------------