Category: SAS

Which lives longer – a honey bee or black ant?

A honey bee can live for 8 years … but a black garden ant can live even 20 years longer than that! Learn more details, and other interesting trivia, in this blog on “the longevity of things.” I recently found The Animal Ageing and Longevity Database, and was fascinated by […]

The post Which lives longer – a honey bee or black ant? appeared first on SAS Learning Post.

How did you measure up in Snowpocalypse 2016?

The East Coast of the US got quite a snowstorm this past weekend, but did your area get enough snow to brag about? Let’s see what the data says… Before we get started, here are a couple pictures of the snow. The first one is from my driveway – we didn’t […]

The post How did you measure up in Snowpocalypse 2016? appeared first on SAS Learning Post.

A viral video that was 47 years in the making

When he filmed the scene in the summer of ’69, my Dad did not foresee his moment of fame in 2016. But in the last two days, Dad has seen his 47-year-old work appear in the local Buffalo, NY media, on DailyMail.com, and on FOX News*. In August of 1969, […]

The post A viral video that was 47 years in the making appeared first on The SAS Dummy.

A fun analysis of regional cultures in the US

Are you from Yankeedom, The Far West, or somewhere in between?  In this blog, I use SAS maps to explore some fun data about regional cultures in the U.S. I recently ran across an interesting article about Colin Woodward’s book “American Nations: A History of the Eleven Rival Regional Cultures […]

The post A fun analysis of regional cultures in the US appeared first on SAS Learning Post.

New Year’s resolution: schedule SAS tasks and your success with SAS

Do any of your New Year’s resolutions include the goal to become a more productive SAS user? Whether you’re building models or reports using SAS or you’re using SAS to effectively manage your data, you likely have a goal to be as productive as possible with your SAS usage in […]

The post New Year’s resolution: schedule SAS tasks and your success with SAS appeared first on SAS Learning Post.

Which stores will Walmart close in 2016?

You probably heard the recent announcement this past Friday that Walmart will be closing 269 stores. Are any closing near where you live? This blog shows some really cool SAS maps to let you drill-down into the data! I’ve seen a few maps showing which Walmart stores are closing, but they […]

The post Which stores will Walmart close in 2016? appeared first on SAS Learning Post.

Set up RStudio in the cloud to work with GitHub

I love GitHub for version control and collaboration, though I’m no master of it. And the tools for integrating git and GitHub with RStudio are just amazing boons to productivity.

Unfortunately, my University-supplied computer does not play well with GitHub. Various directories are locked down, and I can’t push or pull to GitHub directly from RStudio. I can’t even use install_github() from the devtools package, which is needed for loading Shiny applications up to Shinyapps.io. I lived with this for a bit, using git from the desktop and rsconnect from a home computer. But what a PIA.

Then I remembered I know how to put RStudio in the cloud— why not install R there, and make that be my GitHub solution?

It works great. The steps are below. In setting it up, I discovered that Digital Ocean has changed their set-up a little bit, so I update the earlier post as well.

1. Go to Digital Ocean and sign up for an account. By using this link, you will get a $10 credit. (Full disclosure: I will also get a $25 credit once you spend $25 real dollars there.) The reason to use this provider is that they have a system ready to run with Docker already built in, which makes it easy. In addition, their prices are quite reasonable. You will need to use a credit card or PayPal to activate your account, but you can play for a long time with your $10 credit– the cheapest machine is $.007 per hour, up to a $5 per month maximum.

2. On your Digital Ocean page, click “Create droplet”. Click on “One-click Apps” and select “Docker (1.9.1 on 14.04)”. (The numbers in the parentheses are the Docker and Ubuntu version, and might change over time.) Then a size (meaning cost/power) of machine and the region closest to you. You can ignore the settings. Give your new computer an arbitrary name. Then click “Create Droplet” at the bottom of the page.

3. It takes a few seconds for the droplet to spin up. Then you should see your droplet dashboard. If not, click “Droplets” from the top bar. Under “More”, click “Access Console”. This brings up a virtual terminal to your cloud computer. Log in (your username is root) using the password that digital ocean sent you when the droplet spun up.

4. Start your RStudio container by typing: docker run -d -p 8787:8787 -e ROOT=TRUE rocker/hadleyverse

You can replace hadleyverse with rstudio if you like, for a quicker first-time installation, but many R users will want enough of Hadley Wickham’s packages that it makes sense to install this version. The -e ROOT=TRUE is crucial for our application here; without it, we can’t install git into the container.

5. Log in to your Cloud-based RStudio. Find the IP address of your cloud computer on the droplet dashboard, and append :8787 to it, and just put it into your browser. For example: http://135.104.92.185:8787. Log in as user rstudio with password rstudio.

6. Install git, inside the Docker container. Inside RStudio, click Tools -> Shell.... Note: you have to use this shell, it’s not the same as using the droplet terminal. Type: sudo apt-get update and then sudo apt-get install git-core to install git.

git likes to know who you are. To set git up, from the same shell prompt, type git config --global user.name "Your Handle" and git config --global user.email "an.email@somewhere.edu"


7. Close the shell, and in RStudio, set things up to work with GitHub: Go to Tools -> Global Options -> Git/SVN. Click on create RSA key. You don’t need a name for it. Create it, close the window, then view it and copy it.


8. Open GitHub, go to your Profile, click “Edit Profile”, “SSH keys”. Click “Add key”, and just paste in the stuff you copied from RStudio in the previous step.


You’re done! To clone an existing repos from Github to your cloud machine, open a new project in RStudio, and select Version Control, then Git, and paste in the URL name that GitHub provides. Then work away!

An unrelated note about aggregators:We love aggregators! Aggregators collect blogs that have similar coverage for the convenience of readers, and for blog authors they offer a way to reach new audiences. SAS and R is aggregated by R-bloggers, PROC-X, and statsblogs with our permission, and by at least 2 other aggregating services which have never contacted us. If you read this on an aggregator that does not credit the blogs it incorporates, please come visit us at SAS and R. We answer comments there and offer direct subscriptions if you like our content. In addition, no one is allowed to profit by this work under our license; if you see advertisements on this page, other than as mentioned above, the aggregator is violating the terms by which we publish our work.