100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Samenvatting

Samenvatting statistiek, deel 3: software - Using R in RStudio

Beoordeling
-
Verkocht
-
Pagina's
10
Geüpload op
25-04-2024
Geschreven in
2023/2024

Dit is een samenvatting van statistiek, deel 3: software over Using R in RStudio Geslaagd van de eerste keer met 17/20












Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Documentinformatie

Geüpload op
25 april 2024
Aantal pagina's
10
Geschreven in
2023/2024
Type
Samenvatting

Onderwerpen

Voorbeeld van de inhoud

Introduction to R: Using R in RStudio
Table of contents
1. Credit and license.......................................................................................2

2. Working in RStudio.....................................................................................3

3. Working in the Console Panel......................................................................3
3.1. R can sometimes tell that you’re not finished yet (but not often)............................3
3.2. Autocomplete using “tab......................................................................................... 3
3.3. Browsing your command history..............................................................................4

4. Using the History panel for accessing your command history........................4

5. Using the Environment Pane for managing the workspace............................4
5.1. Listing the content of the workspace.......................................................................4
5.1.1. Doing it using the R console..............................................................................5
5.2. Removing variables from the workspace.................................................................5
5.2.1. Doing it using the R console..............................................................................5

6. Using the Files pane for navigating the file system (and more!)....................5
6.1. Setting the working directory...................................................................................5

7. Using the Help panel to, well, get help........................................................6
7.1. How to reach the help documentation.....................................................................6
7.2. How to read the help documentation.......................................................................6

8. Using the Packages pane for dealing with R packages..................................6
8.1. Downloading and installing new R Packages...........................................................7
8.2. Loading R packages................................................................................................. 7
8.3. Unloading a package............................................................................................... 7
8.4. Packages and the environment................................................................................7
8.5. Updating R packages............................................................................................... 7
8.6. A few extra comments............................................................................................. 8

9. Using the Files or Environment panes for importing data files......................8

10. Using the Plots panel................................................................................8

11. Using scripts in the Source panel..............................................................8
11.1. Why use scripts?.................................................................................................... 9
11.2. Writing our first script............................................................................................ 9
11.3. Running our first script.......................................................................................... 9
11.4. Using RStudio to write and run scripts...................................................................9
11.5. Commenting your script......................................................................................10
11.6. Differences between scripts and the command line............................................10


1

,12. Quitting R............................................................................................... 10




1. Credit and license
Not important




2

, 2. Working in RStudio
RStudio has different panes  choosing which panes you see and where by going
to View/Panes/Panes layout (recommendation: stay in the default setting)

Two different ways of doing things
o Using the menu-based or panel-based options provided by RStudio
o Command-based (= text-based interface) options from R


3. Working in the Console Panel
Panel labelled “Console”: R will execute the commands you ask it to perform here


3.1. R can sometimes tell that you’re not finished yet (but
not often)

R can sometimes tell that you’re not finished yet, for example:
o Recap: adding 10 and 20: 10 + 20
If you type in 10+ R thinks you haven’t finished typing so there appears a
blinking cursor next to the plus sign on the new line
o If you type in citation( R thinks you haven’t finished typing because it
misses the )

R cannot always tell that you’re not finished yet, for example:
o You can’t hit enter in the middle of a word: after citat you will get an error
because R thinks you are interested in an object called citat and can’t find
it
o If you type citation: a lot of output, but ignore it




If you make an error, for example: citblation( and you don’t want R to execute the
command, just hit the “escape” key and R will return to the normal command
prompt without attempting to execute the command (in R: CTRL-C)


3.2. Autocomplete using “tab

R has a lot of functions with their own arguments  you don’t have to remember
them




Autocomplete ability in RStudio, for example:




3

, o If you want to round a number, you start typing ro and then hit the “tab”
key  you will get a display with a little window with two panels and you
can choose an option by clicking it or using the arrow keys
o Left: list of variables and functions that start with the letters you
typed in and grey text that had to do with packages
o Right: information about the option you choose
o If you already typed the full name of the function and you are trying to
type the arguments, you can hit the “tab” key  you will get a display with
a little window with two panels
o Left: list of argument names of the function
o Right: information about the option you choose


3.3. Browsing your command history

RStudio keeps track of your command history and you can access it in different
ways
o Using the up and down arrow keys  very handy if you’ve typed a long
command that had one typo in it
o If you hit the up key, R console will show you the most recent
command you’ve typed
o Hit the “escape” key if you want the text to go away
o If you start to type some text and hit the “command” key and the up arrow
together, you get a window showing the recent command that started with
the same text as you typed


4. Using the History panel for accessing your
command history

History panel on the upper right-hand side of the RStudio window to see all your
recent commands

If you want one of the commands copied to the R console
o Double click on the command in the History panel
o Select the command you want and click on the “to console” button


5. Using the Environment Pane for managing the
workspace
The workspace or the global environment: abstract location in which R variables
are stored


5.1. Listing the content of the workspace

To examine the contents of the workspace: Environment panel in the top right-
hand corner lists all the variables and their values



4

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
emilievanhecke Katholieke Universiteit Leuven
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
231
Lid sinds
2 jaar
Aantal volgers
108
Documenten
15
Laatst verkocht
10 uur geleden

4,6

36 beoordelingen

5
22
4
12
3
2
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen