class: center, middle, inverse, title-slide .title[ # Getting started with R-universe ] .subtitle[ ## rOpenSci community call, May 2021 ] .author[ ### Jeroen Ooms ] .date[ ### 2021/05/25 ] --- class: fullpage # R-universe is for everyone ! ![website2](images/website2.png) ??? Teams, organizations, developers or just personal projects --- class: inverse, center, middle # What is R-universe? --- # What is R-universe? R-universe is new platform by rOpenSci for _publishing_ and _discovering_ R packages, Rmd articles, and other R based content. ## `https://<user>.r-universe.dev` Every user or organization has a personal domain for publishing their content. On this domain you can find: -- - __CRAN-like repo__ with any R packages + win/mac binaries - Live rendered __Rmd articles__ - Programmable __API access__ - Interactive __dashboard__ for browsing and monitoring activity - Everything is __fully automated__ - Metrics and other meta functionality (planned later 2021) -- The R-universe platform connects these different universes with each other, though global feeds, cross referencing maintainers, etc. A bit like GitHub! But for R :-) --- class: inverse, center, middle # Example! --- class: fullpage # Example: the ggseg universe ![ggseg-builds](images/ggseg-builds.png) --- class: fullpage # Example: the ggseg universe ![ggseg-builds2](images/ggseg-builds0.png) --- class: fullpage # Example: the ggseg universe ![ggseg-builds2](images/ggseg-builds1.png) --- class: inverse, center, middle # Browsing R packages in a universe --- class: fullpage # Example: the ggseg universe (packages) ![ggseg-builds3](images/ggseg-builds3.png) --- class: fullpage # Example: the ggseg universe (packages) ![ggseg-builds4](images/ggseg-builds4.png) --- # Example: the ggseg universe (packages) ### Users install simply using `install.packages`. ```r # Enable this universe options(repos = c( ggseg = 'https://ggseg.r-universe.dev', CRAN = 'https://cloud.r-project.org')) # Install some packages install.packages('ggseg3d') ``` -- ## No `remotes` / `devtools`/ `rtools` required !! --- class: fullpage # Example: the ggseg universe (packages) ![ggseg-packages0](images/ggseg-packages0.png) --- class: fullpage # Example: the ggseg universe (packages) ![ggseg-packages](images/ggseg-packages.png) --- class: fullpage # Example: the ggseg universe (packages) ![ggseg-packages2](images/ggseg-packages2.png) --- class: fullpage # Example: the ggseg universe (packages) ![ggseg-packages1](images/ggseg-packages1.png) --- class: inverse, center, middle # Browsing articles in a universe --- class: fullpage # Example: the ggseg universe (articles) ![ggseg-articles0](images/ggseg-articles0.png) --- class: fullpage # Example: the ggseg universe (articles) ![ggseg-articles1](images/ggseg-articles1.png) --- class: fullpage # Example: the ggseg universe (articles) ![ggseg-article](images/ggseg-article.png) --- class: fullpage # Example: the ggseg universe (articles) ![ggseg-article1](images/ggseg-article1.png) --- class: inverse, center, middle # API access to all the data ! --- class: fullpage # Example: the ggseg universe (APIs) ![ggseg-api0](images/ggseg-api0.png) --- class: fullpage # Example: the ggseg universe (APIs) ![ggseg-api0](images/ggseg-api2.png) --- class: fullpage # Example: the ggseg universe (APIs) ![ggseg-json](images/ggseg-json.png) --- # Example: the ggseg universe (APIs) Use `jsonlite` to read data in R: ```r library(jsonlite) ggseg <- fromJSON('https://ggseg.r-universe.dev/api/packages/ggseg') ``` Aggregate data uses ndjson so you need `jsonlite::stream_in()`: ```r library(jsonlite) # All package description data descriptions <- stream_in(url('https://ggseg.r-universe.dev/stats/descriptions')) # All articles vignettes <- stream_in(url('https://ggseg.r-universe.dev/stats/vignettes')) ``` --- class: inverse, center, middle # For who is R universe intended? --- # For who is R universe intended? ## Anyone can start a universe ! Example use cases - Both for personal and organizations. - Packages do NOT need to be on CRAN. In your universe you make the rules! - Experimental projects - Research compendia packages - Homework assignments - Dev versions of CRAN packages Package git repos do not need to be in the same GitHub user/org as the universe. You can even add packages from Gitlab or another Git server. You only need the GitHub username for the universe itself. --- class: inverse, center, middle # Example use-cases for R-universe --- class: fullpage # Personal package portfolio ![mohammed](images/mohammed.png) --- class: fullpage # Research software publishing ![mrc](images/mrc.png) --- class: fullpage # Curated suite of packages ![ropensci](images/ropensci.png) --- class: fullpage # Dev versions for CRAN packages ![rlib](images/rlib.png) --- class: fullpage # Domain specific suite of packages ![rspatial](images/rspatial.png) --- class: fullpage # And many more ! ![listuniverses](images/listuniverses.png) --- # Other types of universes R-universe is specifically intended to allow publishing non-software R packages. For example you can think about: - Packages containing only a vignette which serves to create a live, reproducible paper - Research compendium packages with supporting data or code used in a scientific publication - A package where you publish interesting R tutorials by including them as vignettes - A package containing an interesting dataset Any R-based content can fit in a package! --- class: inverse, center, middle # Global feeds connect the universes --- class: fullpage # Global feed: builds ![globalbuilds](images/global-builds.png) --- class: fullpage # Global feed: articles ![globalarticles](images/global-articles.png) --- class: fullpage # Global feed: maintainers ![globalmaintainers](images/global-maintainers.png) --- class: fullpage # Global feed: maintainers ![maintainerinfo](images/maintainer-info.png) --- class: inverse, center, middle # How to setup your own universe --- class: fullpage # Setup your own universe ![help](images/help.png) --- # Step 1: create your registry Create a repository called `{user}.universe.dev` on your GitHub account where `{user}` equals your GitHub username. Add a file called `packages.json` listing the names and git URLs of the R packages you want to include: ```json [ { "package": "goodpress", "url": "https://github.com/maelle/goodpress" }, { "package": "cransays", "url": "https://github.com/lockedata/cransays" }, { "package": "rodev", "url": "https://github.com/ropenscilabs/rodev", "branch" : "master" } ] ``` Example: https://github.com/maelle/maelle.r-universe.dev. Start by adding no more than a few packages, you can add more later. The `branch` field is optional. --- class: fullpage # Step 1: create your registry ![maelle](images/maelle.png) --- class: fullpage # Step 2: install the GitHub app ![setup](images/setup.png) --- class: fullpage # Step 2: install the GitHub app ![installapp](images/installapp.png) --- class: fullpage # Your universe monorepo ![monorepo](images/monorepo.png) --- class: fullpage # Your universe monorepo ![actions](images/actions.png) --- class: fullpage # Now just wait... ![maelledash](images/maelledash.png) --- class: fullpage # Show commit status (if permitted) ![commitstatus](images/commitstatus.png) --- # Conclusion What is R-universe and why is it useful? - R-universe is an open platform that provides users and organizations with a personal space for publishing R content - The system automatically tracks your git repos, builds and distributes binary versions of your packages for Mac and Windows. - Users can easily install packages from your personal CRAN-like repository, without complex configuration of compile tools and dependencies - The dashboard showcases a collection of R packages and vignette content, even when spread across multiple GitHub organizations - R-universe can be used as a simple zero-configuration CI/CD system, running the standard checks on the most important platforms. - R-universe is very easy to set up! We have dealt with lots of challenges related to dependencies, platforms, etc., for you. You can have a universe with just a few clicks. - R-universe combines the best features of hosting your packages on GitHub and CRAN, without being exclusive to either. - Anyone, from novice R user to veteran package developer, can setup their own universe.