In yesterday’s post we took a look at command line utilities in general, some of the reasons why they’re useful, and also made our first bare-bones utility of our own.
Today, we’re going to extend our sortinghat.R example, by allowing it to accept ‘arguments’.
Arguments are what we call the stuff that goes after a command when you run it on the command line.
If we take the humble ls command as an example, we can run it on its own, and it will just list the contents of the current working directory.
…
Other posts in this series Part 1 - Getting Started - This post Part 2 - Arguments Part 3 - Argument validation Part 4 - Improved sorting Part 5 - Debug logging Part 6 - Improving look and feel Part 7 - Improving the output Introduction Do you know some R? Have you ever wanted to write your own command line utilities, but didn’t know where to start? Do you like Harry Potter?
…
Boy, that escalated quickly I just wanted to write up a brief post about the power of R, its community, and tell the story of how actually putting stuff out into the world can have amazing consequences.
About 24 hours ago I was going to tweet something like this:
Hey Mac #rstats users - system(‘say “hello rstats user”’)
I’d been playing with the MacOS command line tool, ‘say’, with the kids, and just figured it would be funny to make R say stuff.
…
I’ve given a version of this talk at all three EARL conferences this year starting in San Francisco. I think this is a measure of the extent to which I believe bridging the gap between Data Science and Ops is becoming increasingly important.
There is a perception in many Ops teams that Data Science lives outside the organisational mainstream, and to some extent or other “gets away” with doing what it likes.
…
Pre-requisites Before we begin, it’s a good idea to install some general purpose tools that will help us out once R is installed.
The first of these dependencies are a bunch of development tools. These are needed because on Linux, packages are generally installed from source, and if they contain any compiled code, will need to ensure that we have the compilers and build tools available.
I take a shortcut here and just install the pre-configured group called ‘Development Tools’.
…
I wrote a really quick script to install R packages from the command line that I thought I’d share.
It doesn’t really do a great deal, but you can use it to install one package at a time.
Save the below as rpkginstall and make sure it’s executable with chmod + x rpkginstall.
Then you can install a package like this example, which would install dplyr, ./rpkginstall dplyr.
#!/usr/bin/env bash pkg=${1} function help { echo "Usage: $(basename $0) <package name>" exit 1 } [ -z ${pkg} ] && help REXEC=$(which R) if [ -z ${REXEC} ]; then echo "R not found, please ensure R is available and try again.
…
Awesome Blogdown Collage by [Mara Averick](https://twitter.com/dataandme) Earlier this year, at RStudio::conf 2017, I heard about Yihui Xie’s Blogdown package for the first time. Blogdown is a fantastic tool kit for static website generation that works with R and RMarkdown, and built on top of the hugo static website generator.
I had used hugo a little for a previous version of my blog, but I update so infrequently that I’d forget how to use it from one update to the next.
…
Anyone that I’ve ever talked to about RPMs knows that I can’t stand the ‘official’ rpmbuild tools.
For whatever reason, I’ve just never got on with them. I know loads of people who use them all the time without complaint, but the whole process has always seemed dysfunctional to me. That’s why, for the vast majority of my packaging needs, I turn to fpm. Using fpm allows me to quickly create RPMs and debs with a really simple, single command line call.
…
This post was originally published on the Mango Solutions blog.
At Mango we work with a great many clients using the Shiny framework for R. Many of those use Shiny Server or Shiny Server Pro to publish their shiny apps within their organisations. Shiny Server Pro in particular is a great product, but some of the stock html pages are a little plain, so I asked the good folks at RStudio if it was possible to customise them to match corporate themes and so on.
…
Turn a shiny application into a tablet or desktop app Since we first demoed it at our really successful trip to Strata London last year, a few people have asked us how we made the awesome looking Data Science Radar app that we were running on the tablets we had with us. In this post we’ll take a look at how we did it, and hopefully show you how easy it is to do yourself.
…