{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 02 - 102A_2_ho - Getting out and Getting Help UCLA...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Jan de Leeuw October 4, 2010 Jan de Leeuw 102A_2 UCLA Department of Statistics Getting out and Getting Help Out ! Two things are extremely important for any software system. They are usually taken care of with menus items in a GUI (or in RStudio), but you may choose for the stark beauty of the command line. First, how do we get out ? In R just type q () or quit () at the prompt. Of course if R is running in a native GUI, there will be a “quit” menu item, which sends the q () command to R . Jan de Leeuw 102A_2 UCLA Department of Statistics Getting out and Getting Help Help ! The preferred way to get help is to say, at the beginning of your session, help . start () . This will open a web browser with an interface to the complete R help system (including the manual and the FAQ). If you want information about a particular R command, say the command foo , you simply say help (foo) or abbreviated ?foo . The command help . search (‘‘foo ’’ ) will give a page will all names and keywords containing foo , either in the terminal or the browser if started. Jan de Leeuw 102A_2 UCLA Department of Statistics Foo, Bar, Baz, ... By the way, the somewhat mysterious looking use of the words foo, bar, and foobar throughout these slides is explained in considerable detail at http://www.faqs.org/rfcs/rfc3092.html Jan de Leeuw 102A_2 UCLA Department of Statistics
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
If we use RStudio or one of the native GUI’s, then opening the interface will already start an R interpreter in a dedicated window, or it will continue the previous session where we left off. In the terminal we start R by typing “R”. The R interpreter then goes into its Read-Evaluate-Print loop and sits there waiting for you to type a command after the prompt “>”. If you have typed a complete R expression and then hit return, R will execute. If the expression is incomplete, R will show the secondary prompt “+”. Jan de Leeuw 102A_2 UCLA Department of Statistics 1 > x <- 2 * 3 * 2 + 4 3 > print ( 4 + x) 5 [1] 24 6 > There are some variations: R can be run in batch mode and you can give some command line arguments to customize your session. Jan de Leeuw 102A_2 UCLA Department of Statistics Customizing your session To see which capabilities have been compiled into your version of R , say capabilities () . To customize your session, use options () . For instance, if you want your floats to be printed with only 2 digits, use options (digits = 2) . If you want to change the prompt, say, for instance, options ( prompt = "JansR > " ) . There are many other options. Using getOption ( "foo" ) will give the value of a single option. Jan de Leeuw 102A_2 UCLA Department of Statistics 1 > pi 2 [1] 3.141593 3 > options (digits = 2) 4 > pi 5 [1] 3.1 6 > options (digits = 22) 7 > pi 8 [1] 3.141592653589793 9 > options ( prompt = "JansR > " ) 10 JansR > pi 11 [1] 3.141592653589793 Jan de Leeuw 102A_2 UCLA Department of Statistics
Background image of page 2
The Workspace When starting R a workspace is created, which is a piece of memory that contains everything you have created and loaded into R in this session.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '10
  • JandeLeeuw
  • Binary file, Executable, UCLA Department of Statistics, Comparison of statistical packages, Jan de Leeuw, Leeuw 102A_2 UCLA

{[ snackBarMessage ]}