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 !  ??? 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  --- class: fullpage # Example: the ggseg universe  --- class: fullpage # Example: the ggseg universe  --- class: inverse, center, middle # Browsing R packages in a universe --- class: fullpage # Example: the ggseg universe (packages)  --- class: fullpage # Example: the ggseg universe (packages)  --- # 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)  --- class: fullpage # Example: the ggseg universe (packages)  --- class: fullpage # Example: the ggseg universe (packages)  --- class: fullpage # Example: the ggseg universe (packages)  --- class: inverse, center, middle # Browsing articles in a universe --- class: fullpage # Example: the ggseg universe (articles)  --- class: fullpage # Example: the ggseg universe (articles)  --- class: fullpage # Example: the ggseg universe (articles)  --- class: fullpage # Example: the ggseg universe (articles)  --- class: inverse, center, middle # API access to all the data ! --- class: fullpage # Example: the ggseg universe (APIs)  --- class: fullpage # Example: the ggseg universe (APIs)  --- class: fullpage # Example: the ggseg universe (APIs)  --- # 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  --- class: fullpage # Research software publishing  --- class: fullpage # Curated suite of packages  --- class: fullpage # Dev versions for CRAN packages  --- class: fullpage # Domain specific suite of packages  --- class: fullpage # And many more !  --- # 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  --- class: fullpage # Global feed: articles  --- class: fullpage # Global feed: maintainers  --- class: fullpage # Global feed: maintainers  --- class: inverse, center, middle # How to setup your own universe --- class: fullpage # Setup your own universe  --- # 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  --- class: fullpage # Step 2: install the GitHub app  --- class: fullpage # Step 2: install the GitHub app  --- class: fullpage # Your universe monorepo  --- class: fullpage # Your universe monorepo  --- class: fullpage # Now just wait...  --- class: fullpage # Show commit status (if permitted)  --- # 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.