06.09.2021 Views

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 4.1: The packages panel.<br />

.......................................................................................................<br />

Rstudio. You’ll see a tab labelled “Packages”. Click on the tab, <strong>and</strong> you’ll see a list of packages that<br />

looks something like Figure 4.1. Every row in the panel corresponds to a different package, <strong>and</strong> every<br />

column is a useful piece of in<strong>for</strong>mation about that package. 4 Going from left to right, here’s what each<br />

column is telling you:<br />

• The check box on the far left column indicates whether or not the package is loaded.<br />

• The one word of text immediately to the right of the check box is the name of the package.<br />

• The short passage of text next to the name is a brief description of the package.<br />

• The number next to the description tells you what version of the package you have installed.<br />

• The little x-mark next to the version number is a button that you can push to uninstall the package<br />

from your computer (you almost never need this).<br />

4.2.2 Loading a package<br />

That seems straight<strong>for</strong>ward enough, so let’s try loading <strong>and</strong> unloading packades. For this example,<br />

I’ll use the <strong>for</strong>eign package. The <strong>for</strong>eign package is a collection of tools that are very h<strong>and</strong>y when R<br />

needs to interact <strong>with</strong> files that are produced by <strong>other</strong> software packages (e.g., SPSS). It comes bundled<br />

<strong>with</strong> R, so it’s one of the ones that you have installed already, but it won’t be one of the ones loaded.<br />

Inside the <strong>for</strong>eign package is a function called read.spss(). It’s a h<strong>and</strong>y little function that you can use<br />

4 If you’re using the comm<strong>and</strong> line, you can get the same in<strong>for</strong>mation by typing library() at the comm<strong>and</strong> line.<br />

- 75 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!