The remove () function removes the object from your workspace. They can also occupy ls () to see a list of created objects.
they will generate an error message in the console, because they are not the same as result and help (mean).
One of the main virtues of R is that the code is open source (open source), which allows it to be developed and updated permanently and that different people can extend this program by developing “packages” or “libraries” so that R is able to carry out new analyzes.
For example, a library that we are going to occupy a lot is “psych”, which includes a series of functions typically used in research in psychology.
Before you can use these functions in R, you need to install “psych”. To do this, you can go to the “Packages” menu in the bottom right window – next to “Help” – press the “Install” button and write “psych” in the dialog box. This will download the library and install it on your computer. As always, it is also possible (and easier) to do this by occupying a function, in this case:
After a library is installed, it must be opened before it can take over its functions. It is a good idea to add the libraries used at the beginning of the file with the analyzes. The function to load an installed library is
they can see a description of all the new features that are now available. In addition to functions, this library includes databases that we can use as examples. The command
creates a new object, a database called “personality”, using the data available in the psych library (epi.bfi). The database includes 13 personality variables measured in 231 people. This information appears in the window on the right (Workspace), where the objects that we have created in our workspace are listed. In RStudio, they can click on this object to see the data, or run
Just as an example, we can now ask for a scattergram showing the relationship between extraversion and openness to experience. This command has two lines (although you could have written it in one), so before executing it you have to select both.
The graph that appears in “Plots” shows that in general the more outgoing people also have higher scores for openness to the experience.
Before finishing this section I would like to note the importance of writing neat syntax. Obviously, R does not care exactly the same if the syntax is ordered or not.