Simple mechanisms for defining and interpreting package options. Provides
helpers for interpreting environment variables, global options, defining
default values and more.
Ever heard the phrase “Read the source, Luke”? It’s a play on “Use the force, Luke” from Star Wars, with no definite source 😉 that we could find^[We erroneously first linked to a rather recent blog post but Robert Link corrected us in a comment that we reproduce here in case the post gets separated from its comments: ““Use the Source, Luke” goes way back before 2012, and probably even before blogs were a thing.
When developing a package it is essential to track the changes you make to your code. This is especially vital if they are breaking changes which have implications for any code written that depends on your package, i.e. a major version bump. Although you can always look back at your version control history in git, it is also convenient to have documentation which summarises the changes. This is where the NEWS file comes in.
{rspm}: easy access to RSPM binary packages with automatic management of system requirements
There are many community projects out there that provide binary R packages for various distributions. You may know Michael Rutter’s legendary c2d4u.team/c2d4u4.0+ PPA, but this situation has …
How to build a CLI for R, with npm.BackgroundThis blog post was triggered by a discussion on Twitter with MartinSkarzynski,who was looking for a way to build a CLI that launches an RScript.Here’s a way to do this using npm.Please note that this blog post won’t teach you how to build the commandline tool, it will quickly go over the way to create a system-widecommand line interface, using npm.If you want to learn more about building the utility, see thisfantastic series of blogpostsby Mark Sellor.Now, the idea is to have a CLI, i.e. a way to launch your utility with:$ mytoolAnd that, system-wide.What you’ll need An R script (script.R) with in it, for example:#!/usr/bin/env Rscript --vanillacli::cat_rule("yeay")cli::cat_bullet(Sys.time()) npm, which you can get fromthere.Let’s goCreate a new folder, and go inside it.mkdir cli && cd cliCreate the R Script there.echo '#!/usr/bin/env Rscript --vanilla' script.Recho 'cli::cat_rule("yeay")' script.Recho 'cli::cat_bullet(Sys.time())' script.RTry your script to see if it works:Rscript script.RNow launch an npm project:npm init -y(You can also run it without the -y to interactively add informationto the package.json.)Now the important part: add a "bin" value in the package.json, withthe name of the bin you want to create, and the path to the script,relatively to the package file. Here is an example of a package.json(I removed some elements).{ "name": "cli", "version": "1.0.0", "description": "CLI example with npm", "bin" : { "clir" : "./script.R" }, "author": "Colin Fay", "license": "MIT"}Install it globally (need sudo rights):sudo npm linkAnd, voilà! Open your terminal, and you’re done!clirOther way to go See the {littler}implementation
Introduction My Use Case Workflow Building the Docker image Uploading the docker image to Docker Hub Setting up Travis to use the Docker image References Introduction The below summarize the workflow I’ve converged on, after reading through various tutorials on Docker, examples, etc. If you’re here, I presume you have some interest in R package development and/or using Docker, which is a tool for containerizing an environment for running software.
AWS has announced support for container images for their serverless computing platform Lambda. AWS doesn’t provide an R runtime for Lambda, and this was the excuse I needed to finally try to make one. An R runtime means that I can take advantage of AWS Lambda to put my R functions in the cloud. I don’t have to worry about provisioning servers or spinning up containers — the function itself is the star.
GitHub - thebioengineer/dockyard: Tools for building and working with docker containers in R
Tools for building and working with docker containers in R - GitHub - thebioengineer/dockyard: Tools for building and working with docker containers in R