dater - a tiny Addin for RStudio

Inserting a date with a keyboard shortcut TLDR: You can find the dater package on github. Update 1: It seems all of this was for nothing… Tweet from @verajosemanuel …but still, it’s a good excuse to learn more about Addins! Update 2: Jose (see above) was kind enough to expand on his original response to my tweet about this post and has introduced me to the wonderful world of RStudio snippets!

Learn to Write Command Line Utilities in R - part 7

Check out the first post in this series for an index of all the other posts. In this post, we’re going to look at extending the work we’ve done earlier by adding another flag into the mix. We’ll use that to improve the way the output of the tool looks when it runs. First of all, we need to add our new flag to the argparser config. # Add a pretty printing flag p <- add_argument(p, "--pretty", help="pretty print the output", flag=TRUE) And we’ll also need a new function to handle those inputs.

Field Guide to the R Ecosystem

I started working with R around about 5 years ago. Parts of the R world have changed substantially over that time, while other parts remain largely the same. One thing that hasn’t changed however, is that there has never been a simple, high-level text to introduce newcomers to the ecosystem. I believe this is especially important now that the ecosystem has grown so much. It’s no longer enough to just know about R itself.

Learn to Write Command Line Utilities in R - part 6

Check out the first post in this series for an index of all the other posts. In the first parts of this series we explored how to create simple command line utilities in R. In part 5 we talked about how difficult it is to go beyond a couple of parameters. This part will remove that limitation and allow us to take our command line apps to a whole new level, delivering the look and feel of existing command line utilities.

Learn to Write Command Line Utilities in R - part 5

Check out the first post in this series for an index of all the other posts. Last time, we changed the way our sorting hat command line utility did its sorting. We moved away from random assignment and implemented a simple binning system for our input names. While we fixed a major problem with our utility, we didn’t really learn much about writing command line tools, so in this post, we’ll look at implementing some debug logging to let us know what’s happening inside our app while it’s running.

Learn to Write Command Line Utilities in R - part 4

Check out the first post in this series for an index of all the other posts. In previous posts, we’ve been working on our command line Sorting Hat utility. We started out with a really simple tool that ran on the command line and just output a random Hogwarts house. Since then, we’ve extended that to accept an argument – in this case a name – and also added some input validation and an error message.

Learn to Write Command Line Utilities in R - part 3

Check out the first post in this series for an index of all the other posts. Yesterday we modified our simple sorting hat command line utility to accept it’s first argument, a name. Those of you who’ve been playing along may have noticed that our implementation wasn’t ideal. It’s fine if you run the script with an argument, like ./sortinghat.R Daphne, but what happens if you omit the argument? $ .

Learn to Write Command Line Utilities in R - part 2

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.

Learn to Write Command Line Utilities in R

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?

When a Tweet Turns Into an R Package

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.