If you are curious about the history of R as a programming language the Wikipedia page is also a good place to start ( (programming_language) ). The base language has been around for quite some time (around 1997, see ) and is designed to allow anyone to write instructions to perform specific actions (called packages) which are generally freely downloadable and can be used by anyone. R is a great language to answer statistical questions.
Either you are a student who is told that you must use RStudio for class or you are someone who has a statistical question you want an answer for (either for yourself or someone else) and want to know how to get the answer without spending a lot of time and money to get it. For example, to see the help about the mean function, run ?mean.If you are reading this post then you are tasked with learning how to use R and/or RStudio to perform statistics. To access the help of a function, run help("name of the function") or simply ?name of the function.
Furthermore, note that an internet connection is required to install a package, while it is not required to load a package Note that you will need to install packages only once, 1 but load packages each time you open RStudio.
To load the package, find the package you want to load in the Packages window (you can use the search box), then click on the checkbox next to the name of the package.
You will see that the code appears in the console. For this, click on the button Install under Packages, type the name of the package you want to install and then click on Install. You also have the possibility to install and load packages via the buttons under the Packages tab. To load a package, run library(name of the package) (this time "" around the name of the package are optional, but can still be used if you wish). Once the package is installed, you must load the package and only after it has been loaded you can use all the functions it contains.
Some packages are installed by default, all others must be installed by running install.packages("name of the package") (do not forget "" around the name of the package!). You are then able to use this package (and all functions built inside this package) for free. Remind that R is open source everyone can write code and publish it as a package. Everything else must be installed from packages. Only fundamental functionalities come with R.
In this pane you can also see a tab with a history of the code executed and a button to import a dataset (more on importing a dataset in RStudio). This means that you can now perform any computations with a, such that if you execute a + 1, RStudio will render 2 in the console.