Читать книгу R For Dummies - Vries Andrie de - Страница 5

Part I
Getting Started with R Programming
Chapter 2
Exploring R

Оглавление

In This Chapter

▶ Looking at your R editing options

▶ Starting R

▶ Writing your first R script

▶ Finding your way around the R environment

In order to start working in R, you need two things. First, you need a tool to easily write and edit code (an editor). You also need an interface, so you can send that code to R. Which tools you use depend to some extent on your operating system. The basic R install gives you these options:

Windows: A basic user interface called RGui.

Mac OS X: A basic user interface called R.app.

Linux: There is no specific interface on Linux, but you can use any code editor (like Vim or Emacs) to edit your R code. R itself opens by default in a terminal window.

At a practical level, this difference between operating systems and interfaces doesn’t matter very much. R is a programming language, and you can be sure that R interprets your code identically across operating systems.

Still, we want to show you how to use a standard R interface, so in this chapter we briefly illustrate how to use R with the Windows RGui. Our advice also works on the Mac R.app.

Fortunately, there is an alternative, third-party interface called RStudio that provides a consistent user interface regardless of operating system. RStudio increasingly is the standard editing tool for R, so we also illustrate how to use RStudio.

In this chapter, after opening an R console, you flex your R muscles and write some scripts. You do some calculations, create some numeric and text objects, take a look at the built-in help, and save your work.

R For Dummies

Подняться наверх