Discover millions of ebooks, audiobooks, and so much more with a free trial

From $11.99/month after trial. Cancel anytime.

Learn RStudio IDE: Quick, Effective, and Productive Data Science
Learn RStudio IDE: Quick, Effective, and Productive Data Science
Learn RStudio IDE: Quick, Effective, and Productive Data Science
Ebook172 pages1 hour

Learn RStudio IDE: Quick, Effective, and Productive Data Science

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Discover how to use the popular RStudio IDE as a professional tool that includes code refactoring support, debugging, and Git version control integration. This book gives you a tour of RStudio and shows you how it helps you do exploratory data analysis; build data visualizations with ggplot; and create custom R packages and web-based interactive visualizations with Shiny. In addition, you will cover common data analysis tasks including importing data from diverse sources such as SAS files, CSV files, and JSON. You will map out the features in RStudio so that you will be able to customize RStudio to fit your own style of coding.
Finally, you will see how to save a ton of time by adopting best practices and using packages to extend RStudio. Learn RStudio IDE is a quick, no-nonsense tutorial of RStudio that will give you a head start to develop the insights you need in your data science projects.

What YouWill Learn
  • Quickly, effectively, and productively use RStudio IDE for building data science applications
  • Install RStudio and program your first Hello World application
  • Adopt the RStudio workflow 
  • Make your code reusable using RStudio
  • Use RStudio and Shiny for data visualization projects
  • Debug your code with RStudio 
  • Import CSV, SPSS, SAS, JSON, and other data

Who This Book Is For
Programmers who want to start doing data science, but don’t know what tools to focus on to get up to speed quickly. 
LanguageEnglish
PublisherApress
Release dateApr 17, 2019
ISBN9781484245118
Learn RStudio IDE: Quick, Effective, and Productive Data Science

Read more from Matthew Campbell

Related to Learn RStudio IDE

Related ebooks

Programming For You

View More

Related articles

Reviews for Learn RStudio IDE

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Learn RStudio IDE - Matthew Campbell

    © Matthew Campbell 2019

    Matthew CampbellLearn RStudio IDEhttps://doi.org/10.1007/978-1-4842-4511-8_1

    1. Installing RStudio

    Matthew Campbell¹ 

    (1)

    Yardley, PA, USA

    RStudio is an integrated development environment (IDE) that adds modern features like syntax highlighting and code refactoring to R. The strength of RStudio is that it brings all the features that you need together in one place. Before we install RStudio, we will need to install the latest version of R for our operating system as well as another program called git. Both of these software packages are integrated into RStudio, but they do not come with the RStudio IDE.

    R is a statistical programming language and we need this language to use RStudio. Git is a popular version control system that will be integrated into RStudio. Version control systems like git are used to manage copies of the code you are working on. Git helps you see the differences between versions of a file so that you can get insight into why one version of your code behaves differently than another version. Git is also required to use Github, an online community where programmers share code and projects.

    Install R

    R is a free open source software used for statistical programming and graphics. You can get the latest version of R from CRAN, the Comprehensive R Network. This is a network of mirrored servers that have copies of R as well as R packages. R packages are extensions to the core R programming language contributed by R users in the community.

    To install R, go to this URL: https://cran.r-project.org/mirrors.html and you will see a list like the one featured in Figure 1-1.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig1_HTML.jpg

    Figure 1-1

    CRAN mirrors

    Scroll down the list of servers and find the one that is geographically closest to you and then click the link. Don’t worry too much about getting the absolute closest server, just picking any from your country should be fine. If you find a broken link, simply go back and try another server. You will be brought to a new screen that lists versions of R for Windows and Mac as you can see in Figure 1-2.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig2_HTML.jpg

    Figure 1-2

    Installing R on CRAN

    Click the link for your operating system. Each operating system has different instructions to set up R.

    Installing R on Mac

    If you are installing R on Mac, you will be presented with a lot of detail about the different R releases. Most people will simply go to the area toward the middle of the page under the heading Latest release as shown in Figure 1-3: and then click the file that ends in with the .pkg file extension. The exact name of the file will be different based on the most current release of the installer.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig3_HTML.jpg

    Figure 1-3

    Mac R installer

    Click the pkg link to install the most recent version of R. Note that if you have a special need for an older version of R, you can scroll down to see options on installing previous version of R. The pkg file will appear in your Downloads folder. Go to your Downloads folder and click the pkg file to install R. A screen like Figure 1-4 will appear.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig4_HTML.jpg

    Figure 1-4

    Installing R on Mac

    You will get a series of screens like the one in Figure 1-4. Click Continue for each screen. At one point, a model dialog box will pop up asking for you to agree to the software license. Click Agree to move on. Next, you will be presented with an option to install to a specific disk as shown in Figure 1-5.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig5_HTML.jpg

    Figure 1-5

    Choosing R location

    Most people will simply choose the option to install for all users. Choose the first option and click the Continue button. At the next screen, click the Install button. You will be prompted for your Mac password since the R installer will make changes to your Mac. Type that in to continue. R will install, and when everything is done you should see a screen like in Figure 1-6.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig6_HTML.jpg

    Figure 1-6

    Successful R installation

    Click the Close button and R will be installed on your Mac. You will find R in your Applications folder. Double click the R.app program in your Applications folder to verify that you have R installed and working. The native R Console screen will appear. You can play around with the system here if you already know a little R, or you can simply exit the program. We will revisit using R once RStudio is installed.

    Installing R on Windows

    Once you click the R for Windows link, you will see a page of instructions. Click on install R for the first time as shown in Figure 1-7.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig7_HTML.jpg

    Figure 1-7

    Installing R on Windows

    On the next page, there will be a link to download the R installer. Click that to get the windows installer. It will be named Download R for Windows. Click that to download the R installer. In a moment, you will find the R install executable file in your Downloads folder.

    Double click the installer file and click through the prompts. Simply select the defaults and then let the installer finish.

    Installing R on Linux

    Each version of Linux has different set up instructions to follow to install R. Generally, you will use a package manager to install R from a command line. You can do something like this:

    sudo apt-get update

    sudo apt-get install r-base r-base-dev

    However, each version of Linux might be a little bit different here, and you should double check the CRAN website to see any more detail on what you may need to do for your version of Linux. Click Download R for Linux link on https://cran.r-project.org and then choose your version of Linux to get extra guidance.

    Install Git

    Git is a popular version control system that is used to manage different versions of your code files. RStudio will integrate git into your workflow and help you visualize your work.

    Install Git on Mac

    To install git on Mac, go to this URL: https://git-scm.com/download/mac and if your download does not start immediately, click the text click here to download manually to download the git installer. Double click the file that appears in your Downloads folder. In the folder that appears, click the pkg file to begin the installation process. You may get a security notification that looks like the dialog box pictured in Figure 1-8.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig8_HTML.jpg

    Figure 1-8

    Security warning on Mac

    You can override this security feature by going to your Mac’s Security and Privacy setting’s general tab and then selecting Open Anyway next to the file that you downloaded. See Figure 1-9 for an example.

    ../images/478254_1_En_1_Chapter/478254_1_En_1_Fig9_HTML.jpg
    Enjoying the preview?
    Page 1 of 1