How to Update R and Rstudio on Windows

Updated 11/28/2016.

In this post, I provide instructions for updating R and Rstudio on Windows.

Specifically, these instructions are intended to apply to updating R and Rstudio running on a Windows 2012 server instance at Amazon Web Services. I am assuming that the set up and provisioning of this instance are as described in my series of videos AWS Windows Instance Set Up. Such an instance is running Windows 8.

These instructions, however, should work for other Windows set-ups as well. For example, they work on my Windows notebook computer running Windows 7 as well.

The sources of information I used to figure this out are as follows:

Here are the step-by-step instructions:

  1. Shut down R and Rstudio.
  2. It is best to turn off you antivirus software. The update will probably work if you do not, but you may have to re-do things with your antivirus software disabled if it quarantines any files involved in the installation.
  3. Next run the R GUI. Do not run Rstudio. You will probably find a “shortcut” to the R GUI on your desktop. If so, you can click on that. If you do not see a link on your desktop, you will need to find the program.
  4. If you are running the R GUI, it will say RGui in the upper-left corner of the title bar of the outer window:
RguiWindow
  • In Windows 8, you can find the program by pressing the Windows key (so the Start Page appears) and then typing “R” (just the R, not the quotes). There should be links to the R GUI among the search results. If you do not see it there, then you can right click on the Start Page and then click All Apps in the bar that appears at the bottom of the screen.
  • In Windows 7, you can find the program by pressing the Start Key and then clicking on “All Programs.” Next look for the “R” folder and a link to the RGui should be in that folder.
  1. Once you have found the R GUI, run it.
  2. As of updating R on 11/28/2016, the command discussed in this step failed and was unnecessary. So go to the next step. However, if you get an error message about not being able to open the URL and about the connection changing from a secured to an unsecured connection, you might try the following command: In the R Console at the > prompt type:

setInternet2(TRUE)

  1. Next type:

if(!require(installr)) { install.packages("installr"); require(installr) }

Note that the require() function returns FALSE if the package is not available. So the above if() statement installs “installr” if it is not already available and it returns TRUE (hidden) when it is installed.

  1. Then type:

updateR()

Note: On 4/8/2016 when upgrading from R version 3.2.1 to 3.2.4, updateR() failed with an error message that begins with “Error in strsplit(version_with_dots,” and continued with more opaque information. The problem is that the installr package version that you already have installed is too old install the current version of R. The fix is to remove the installr package and reinstall it. You can remove the installr package with the command
remove.packages("installr")
Next stop the RGui with the q() command and then restart it (this is one way to unload the old version package installr so that a new version can be installed). Follow the instructions above to re-start the RGui. Then you can begin again at step 7.

  1. You will then need to answer the questions that are a part of the installation process.

I recommend: (1) Not reading the News; (2) Copying the installed packages; (3) updating the installed packages; (4) copying the Rprofile.

  1. Once the update is complete, exit the RGui by using q().
  2. Run Rstudio
  3. Go to the Help menu and the Check for Updates. If an update is available, you will be taken to the Rstudio download page.
  4. If you need the update, download it, and run the installation file. I think this is straightforward so I won’t give more detailed instructions here.
  5. The last thing you need to do is update your already installed R packages. In RStudio, go to the menu Tools and then click on “Check for package updates…” Again this process is straightforward.
  6. Once you are finished with the installation and updates, turn your antivirus software back on!

The above should take care of updating both R and Rstudio. If you run into problems or have other questions, please comment below. Based on the comments, I will correct any errors or ambiguities in the above instructions.

AWS Windows Instance Set Up: Wrapping Up

This video is the last part in a series of videos that show how to set up a Windows virtual machine (instance) using Amazon Web Services and then provision it with Python and R (and some additional software) so that it can serve as a platform for doing some data science. In this video I do some checking to see whether or not the software we installed in the last video works and I also show how to create an AWS AMI (Amazon Machine Image) which will allow new instances to be launched that are already fully provisioned (and also serves as a back-up of the work done provisioning the instance).

See the previous video in this series for instructions on installing the software.

The video is about 15 minutes long.

AWSSetUpWrapUp-DSSThumb

Changes/Corrections

At time 1:28, the video discusses moving from the Start Screen to the All Apps screen. As discussed in the Step 3 video, the method shown in this video is obsolete and replaced by a small white arrow in a circle at the bottom left of the Start Screen.

Video Index

Time Topic
00:00Title Slide
00:03Introduction
00:43Toggle between the Start Screen and Desktop using the Windows Key
01:09Tiles on the Start Screen for the New Software
01:28Show the “All Apps” Screen
02:00Check that the ClamWin programs are installed
02:18Check that the ClamSentinel programs are installed
02:29Check that the Anaconda Python programs are installed
03:00Check that the R programs are installed
03:29Check that the Rstudio program is installed
03:36Check that the CYGWIN program is installed
04:20Return to the Start Screen
04:27Launch the Anaconda Python Command Prompt
05:05Launch the Spyder IDE
05:45Launch Rstudio
06:24Launch CYGWIN
07:31What to do if there is a problem
07:50Uninstall programs — Open the Control Panel
08:04Open Uninstall Programs
08:26After uninstall, may need to remove program folder
08:50Launch file explorer and navigate to the C: drive
08:56The location of the Anaconda Python and CYGWIN program folders
09:05Should remove Anaconda Python and CYGWIN folders when uninstalling and then reinstalling these programs
09:18Location of the R and Rstudio program folders
09:25May need to remove the R and Rstudio folders when reinstalling these programs
09:36Turn off virus software when installing or reinstalling the software
09:43Turning off ClamSentinel
09:59Logging out of the Windows Instance
10:25EC2 Dashboard and Instances Dashboard
11:01Identifying your instance
11:27Good idea to create an AMI (Amazon Machine Image)
11:52Select the instance
12:20Create the AMI (Amazon Machine Image)
12:30Name and describe the image
13:16Navigate to the AMI (under Images)
13:44Image serves as a backup
14:10Conclusion

AWS Windows Instance Set Up Step 4: Installing Open Source Software for Data Science

This video is part 4 in a series of 5 videos that show how to set up a Windows virtual machine (instance) using Amazon Web Services and then provision it with Python and R (and some additional software) so that it can serve as a platform for doing some data science. In this video I show how to get an obtain open source software and install it on the Windows instance. The primary software I am installing is Python 2.7 and the statistics software R with the intention of using this platform to do some data science.

The software installed in this video is Firefox, ClamWin anti virus software, Clam Sentinel real-time virus scanning software based on ClamWin, Anaconda Python, the R statistics package, and the cygwin unix-like tools for Windows.

NOTE: It is very important to turn off the virus scanning software Clam Sentinel while installing the rest of the software (especially Anaconda and cygwin).

A web page with the links for provisioning the Windows instance can be found at:

DataScienceSource.com/WindowsInstanceProvisioning

The video is about 30 minutes long.

AWSSetStep4-DSSThumb

Changes/Corrections

  • The web page at DataScienceSource.com/WindowsInstanceProvisioning has been updated since the video was originally made. The links to the software are not exactly the same as in the video since they have all been updated to point to the latest versions. Also, a few additional warnings have been added. None of this really affects the usefulness of the video.
  • At time 27:14 in the video, I begin to discuss how to test if the “chere” feature of the cygwin software has been successfully installed. Things have changed slightly. Open the File Explorer as indicated in the video. Next double click on the Documents folder to change into that folder. Then, right-click in the blank space (under the “This folder is empty.” message) and you should then see “Bash Prompt Here” in the context menu. “Bash Prompt Here” no longer shows up at the top level (the “This PC” level) in the File Explorer.

Video Index

Click on the topics below to jump to that location in the video.

Time Topic
00:00Title Slide
00:03Introduction
00:49Log into the Windows Instance at AWS
02:53The Windows Instance Desktop
03:00Using the Windows button to switch to the Start Screen
03:06Launch Internet Explorer
03:13The Internet Explorer Warning about Browsing on Servers
03:39Internet Explorer is set to a very high level of security
04:11The links page at DataScienceSource.com for provisioning the instance
05:05Installing the Firefox browser
05:19Add the Firefox web site to the list of trusted sites for IE
07:04Close Internet Explorer
07:30Navigate again to the provisioning links page at DataScienceSource.com
08:24The Windows Server 2012 Instance Lacks Antivirus Software
08:43It is hard to find free or open course antivirus software for Windows Server
09:15Free Open-Source Anitvirus Software: ClamWin and ClamSentinel
09:40Install ClamWin
10:04Show the Recent Downloads list for the Firefox browser using the arrow icon
11:34Install ClamSentinel
13:42ClamSentinal is in the System Tray
13:48The ClamSentinel Menu — Stopping and Starting the ClamSentinel virus scanning
14:29Discussion of Python and Ananconda Python
15:30Discussion of Python 2.7 and 3.4
16:42Must turn off the Antivirus software to install Anaconda Python
17:06Turning off the ClamSentinel antivirus software
17:29Installing Anaconda Python
17:45The Firefox download progress icon and recent downloads
19:15Installing R
20:52Installing Rstudio
21:58Disucssion of CYGWIN
22:26Installing CYGWIN
24:25Installing the chere package (or feaqure) of CYGWIN
26:16Compllete the installation of chere
27:14Check that chere is installed
28:20Restart the antivirus software ClamSentinel
28:51Conclusion

Next Video: Wrapping Up

AWS Windows Instance Set Up Step 3: Connecting to an AWS Windows Instance

This video is part 3 in a series of 5 videos that show how to set up a Windows virtual machine (instance) using Amazon Web Services and then provision it with Python and R (and some additional software) so that it can serve as a platform for doing some data science. In this video I show how to connect to an Windows instance at AWS from a Windows compute using Microsoft Remote Desktop Connection.

Note: Microsoft Remote Desktop Connections clients exist for most operating systems including for Mac, iPad, and Linux. If you are not using a Windows computer to connect to the instance, after watching this video, you should be able to set up a client for you own computer without much trouble. Important for Mac OS X users: Use the Remote Desktop App that you can obtain from the Apple App Store.

The video is about 17 minutes long.

AWSSetUpStep3-DSSThumb

Changes/Corrections

Starting at time 14:06 in the video, I explain how to move from the Start Screen to the screen that lists all of the Apps. This has changed in more recent versions of Windows 8. Now, at the bottom of the Start Screen on the left-hand side is a small white arrow in a white circle that takes you to the page of all the Apps. This is much more intuitive and easier than the right-clicking approach discussed in the video. Click here to see an image of the updated Start Page.

Video Index

Click on the topics below to jump to that location in the video.

Time Topic
00:00Title Slide
00:03Introduction
00:23EC2 Table of Instances
01:02Navigate to the EC2 Instance Table
02:08Review Information Saved in the Instance Folder
04:28Select Instance in the EC2 Instance Table
04:38The “Connect” Button
04:41The “Connect to Your Instance” Dialog
04:46The “Download Remote Desktop File” Button
05:19The Remote Desktop File default name is the IP number
06:04The “Get Password” Button
06:25Input the Key Pair Information from the .pem file
07:03The Private Key
07:22Decrypting the password
07:34Save the password in the Instance Data Excel file
08:03Close the “Connect to Your Instance” dialog
08:18Run the .rdp file for the instance
08:39Ignore the warning
08:48Login name and password
09:24Ignore the certificate warning and click “Yes”
09:37Instance Windows 8 Start Screen
10:24Return to the local computer
10:35Reduce the Remote Desktop Protocol from fullscreen to a Window
10:53Minimize the Remote Desktop Connect to the local computer taskbar
11:05Return to the AWS Windows Instance
11:29Move the Remote Desktop Protocol top bar around
11:38Windows 8 Start Screen
11:46In Windows 8, the Start Screen replaces the Start Menu
11:47Windows 8 Programs List
12:11Brief Introduction to Windows 8
12:21Moving between the Start Screen and the Desktop
12:07Programs are now called “Apps”
12:28Moving to the Desktop using the Desktop Tile on the Start Screen
12:36Using the Windows Key
13:02Move to the Windows 8 Start Screen using the Windows Key
13:15Move back to the Desktop using the Windows Key
13:21Move back to the Windows 8 Start Screen
13:25Expose the Charms (including the Settings)
13:41Show the Settings Menu including the Power Button
14:00Hide the Setting Menu
14:06Showing the “All Apps” Page
15:13Return to the Start Screen from the All Apps page using the Windows Key
15:19Determine the disk size and available disk space.
15:39Switch to the Desktop
15:41Open File Explorer
15:46Switch to the Computer folder
15:53Disk C size and space available
16:02Conclusion

Next Video: Step 4 — Provisioning the Instance

AWS Windows Instance Set Up Step 2: Launching a Windows Instance

This video is part 2 in a series of 5 videos that show how to set up a Windows virtual machine (instance) using Amazon Web Services (AWS) and then provision it with Python and R (and some additional software) so that it can serve as a platform for doing some data science. In this video I show how to launch a Windows instance using AWS.

The video is about 20 minutes long.

AWSSetUpIntro-DSSThumb

Changes/Corrections

  • The section of the video from time 3:57 to 4:55 is obsolete and can be ignored. This section of the video begins with a pop-up dialog that is titled “Boot from General Purpose SSD.” General purpose SSD is now the default and your virtual instance will automatically have a 30GB SSD drive. You will not be prompted as shown in the video.
  • The Actions menu which appears in the video at time 13:16 has changed. The large number of items in the old menu have been consolidated into groups in the new menu. Specifically, the Actions category of the old menu has now been changed to the Instance State menu item which leads to a sub-menu with the items Start, Stop, Reboot, and Terminate.

Video Index

Click on the topics below to jump to that location in the video.

Time Topic
00:00Title Slide
00:04Introduction
00:33Navigating to AWS
00:50Loggin in to AWS
01:21Page of Links to All AWS Services
01:31Navigating to the page of AWS Sevices if already logged in
01:44EC2 link and dashboard
02:05Launch instance button
02:13List of Image Types (Amazon Machine Images)
02:30Scroll to MS Windows Server 2012 R2 Base image (Free Tier Eligible)
03:24Choose instance types
04:00Select device types (SSD 30GB)
04:57Security Issues
05:30IAM (Identity and Access Management) – Accept Defaults
06:08A Secure Connection requires a Key Pair
06:40Create a new key pair
07:52Create a folder on the local computer for the key pair
09:53Download the key pair
10:45Launch the instance
10:52Launch status – initializing
11:19Instance console
12:42Give the instance a name
13:11Action Menu (Terminate, Reboot, Stop, and Start)
13:36Select and Instance for the Action
14:53Instance state is “running”
15:08Time delay in launching an instance
15:22Save the data about an instance
18:40Instance IP and DNS Name can change on stop and start
19:13Conclusion

Next Video: Step 3 — Connecting to the Instance

AWS Windows Instance Set Up Step 1: Setting Up An Amazon Web Services Account

This video is step 1 in a series of 5 videos that show how to set up a Windows virtual machine (instance) using Amazon Web Services and then provision it with Python and R (and some additional software) so that it can serve as a platform for doing some data science. In this video I discuss setting up an Amazon Web Services account, using the “Free Tier” services, and setting up a billing alert.

The video is about 11 minutes long.

AWSSetUpStep1-DSSThumb

Changes/Corrections

  • The choices that show up in the billing alert notification menu have changed (about time 9:30 in the video). Instead of seeing and selecting the account owner’s name (in my case George), you should select Notify Me.

Video Index

Click on the topics below to jump to that location in the video.

Time Topic
00:00Title slide
00:04Introduction
00:36Navigate to AWS (aws.amazon.com)
01:09Link for creating free account
01:36Explore information on free (“free tier”) services
02:59Information on EC2 (Elastic Compute Cloud)
03:42Begin Sign-Up
03:56Need Two Things for Account – Credit Card and Phone Access
04:54Log in to your AWS Account
05:50AWS Services Page
06:17AWS Regions
07:10Need Billing Alert – Billing and Cost Management
08:08Set up Billing Alert
10:05Conclusion

Next Video: Step 2 — Launching a Windows Instance

AWS Windows Instance Set Up Introduction

This video provides a brief introduction to a series of 5 videos that follow which show how to set up a Windows virtual machine (instance) using Amazon Web Services and then provision it with Python and R (and some additional software) so that it can serve as a platform for doing some data science.

The video is a little less than 2 minutes long.

AWSSetUpIntro-DSSThumb

Next Video: Step 1 — Setting Up an AWS Account