> sqrt(-3) Storing/manipulating data using vectors and matrices Creating vectors and extraction of its elements NA is the value R uses for a missing or undefined value. Note that angles are specified in radians so if you want sin of 90 degrees, type: Note that the use of brackets in the typical way is recommended, if not needed, for large mathematical expressions. You can use R for many mathematical calculations. Because Splus and R are quite similar in most cases, searching Google using Splus instead of R will most likely yield some information.Ībove all, if you know know something about R, ask someone who might know! Mathematical calculations
Note that the keyword, R, is not particularly helpful when specified in Google because it is generic. Search for the particular subject in R using the Google newsgroups. Some other ways of searching for help on a particular subject are: Note that if you do not know the command in R that you want help on, the above methods of searching the R help files for relevant information concerning a particular subject are (most of the time) not useful. These can be accessed from the internet using the following links:
You may also find additional information in R manuals or FAQ's. This is also a way to list all of the R commands.
How to obtain a list of the help files for all R commands Getting help How to get help on a particular R command In this case, all objects can then be easily input into future R sessions. In general, it is recommend that you use a text editor, like that discussed above, or at the very least save all of your R commands using the script command, to save all of the R commands that were used during your R session. For instance, you may overwrite a particular object and then can't remember how that object was obtained. Answering "c" cancels quitting and you are returned to an R prompt.Ĭaution: it is not advisable to rely on saving the workspace image so that all objects are saved and ready for your next R session. If you answer "n", all objects are removed. If you answer "y", all of the objects you have created are saved and are available the next time you start R. Refer to managing the workspace image for a more detailed description of the workspace image. When you quit R, you will be asked whether you want to save the workspace image. To interrupt an R command, use the Ctrl-C key combination to stop execution of the command. If you are running an intensive program, you can run it using BATCH mode.To stop the script from copying, simply quit R and at the Unix prompt, type: Rsession1, that will copy everything in your R session. Using the script command, you can create a file, say Rsession1, that is an exact copy of every keystroke that you perform in a Unix window as well as everything that is echoed onto the screen after you invoke the command.Use a text editor (emacs, for example), write your commands in it and copy-paste them into your R window.Also, when you write a command, R doesn't allow you to go back and correct a typo so you will have to retype your command. The disadvantage is that your commands are not saved. Type all of your commands directly into the R window.Once you have started R, you must also decide if you want the commands that you type to be saved. For those students with a graduate account, R is available on the following graduate machines: pythagoras and beta. To obtain a Unix prompt, you must login to one of these machines by typing "rlogin maddison". R is installed on the following undergrad machines: bacon, agnesi, blanch, fenchel, fitch, maddison, magnus, merrill and rees. You start R by typing "R" at the Unix prompt on a machine that has R installed on it. If you are not familiar with working in a Unix environment, please take the following Unix tutorial. Invoking/interrupting/quitting Before you begin this tutorial. Storing/manipulating data using vectors and matrices.The following tutorial provides a basic introduction to using R in a Unix environment.