R -1- First steps

Starting with R might be a bit confusing if you are used to softwares and programs that have a complete interface with icons, buttons, options, menus and ready-to-use functions. Providing that you work with a Windows-based OS, R starts up with a menu bar, a series of icons such as “open”, “save”, “copy”, “paste”, “print”, and a console (the R console) which is nothing more than a terminal made to receive and interpret your “command”. In these circumstances, it may be a bit hard to know how and where to start…


script to console2
When starting up R, you might be confronted with a feeling of “being lost at sea”. Few icons, few menus, not much of a welcoming screen… just a menu bar and the R console. You’ll soon realize that you can write “stuff” in this R console. You can write arithmetical operations, […]

1. Start working with the editor, not the console


combination
It is fairly easy to perform simple arithmetic operations in R. You simply need to type in the operations as command directly in the editor (script), right after the > sign, and press ENTER to validate. Use +, -, * and / for additions, subtractions, multiplications and divisions, respectively. Try to […]

2. Using R as a calculator


if nothing happens
Sooner or later, everyone needs help… and working with R does not constitute any exception. There are several ways to get help with R. In R: As indicated in the R console when starting up R, you may get help by typing help(). This command opens immediately a new page/tab in […]

3. Finding help in R



setwd()
When working with multiple datasets belonging to different projects, it is best to keep things organised. By this, you have to understand that it is best to save your data files, processed datasets and the content of the workspace in R (script, etc) in a specific folder, the working directory. […]

4. Setting up a working directory


library()
Because it is open source, R has a constantly growing list of updated packages to be added to the core functions of the program. The packages are usually built by advanced users and programmers who wish to add functionalities, to simplify procedures that may require a long list of commands… […]

5. Installing packages


citation
If your research project, data and results are to be published and you have used R to perform calculations, you will have to cite R in the appropriate manner. There is a function in R which provides you with the proper citation. Just type citation() to obtain the following screen: [code language=”r”] […]

6. Citing R in publications