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

samenvatting statistiek 3

Beoordeling
-
Verkocht
1
Pagina's
70
Geüpload op
13-05-2025
Geschreven in
2024/2025

Dit is een samenvatting van de 12 hoofdstukken die we in studio.R moesten lezen. Ik heb dit aangevuld met extra info wanneer iets niet duidelijk was. Er staan ook veel foto's in zodat je steeds weet welke code je moet invullen.












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

Documentinformatie

Geüpload op
13 mei 2025
Aantal pagina's
70
Geschreven in
2024/2025
Type
Samenvatting

Voorbeeld van de inhoud

Statistiek 3
Hst 2: getting started with R
2.1 Typing commands
 G typo’s
 Spacing maakt n uit/ tenzij in een woord

add 10 + 20
Substract 10-20
R-handleiding citeren Citation ()

2.2 Doing simple calculations
 Vb operation = addition
- Operator = +




 Order of operations: BEDMAS
- Brackets ()
- Exponents ^
- Devision / and Multiplication *
- Addition + and Substraction –

2.3. Storing a nr as a variable
Assign a value to variable: assignment operator Sales <- 350
350 -> sales
Sales < - 350
Sales = 350
350 = sales


2.4. Working with variables
Assign new value to variable Sales <- 250
Sales

2.5. Doing calculations using variables
Multiplication Sales <- 350

1

, Royalty <- 7
----------------------------------------------------------------
Sales * royalty (= 350 * 7)
Assign output calculation to new variable Revenue <- sales * royalty
Revenue
Overwrite previous value (donation of 550 €) Revenue <- revenue + 550
Revenue


2.6. Storing many nr’s as a vector
 Vector = variable that can store multiple values
- Between ( )  elements (12 in vb)

Combine function C () Sales.by.month <- c(0, 100, 200, 50, 0, 0, 0, 0, 0, 0, 0, 0)
Sales.by.month


 Flexible with c ()  works on nr’s and vectors at the same time

Add sales in a new month Sales.by.month.extended <- c(sales.by.month, 99)
Sales.by.month.extended
C( ) wordt gebruikt voor

 Data te groeperen in een vector
 Dataset te maken en te verwerken
 Rekenen met meerdere getallen tegelijk

2.7. Working with a vector
Get info out of a vector Sales.by.month[2]
- boeken in feb
Create new variables February.sales <- sales.by.month[2]
February.sales
Get access to more elements Sales.by.month[c(1,2,3)]
Change a value stored in a vector Sales.by.month[5] <- 25
- 25 extra boeken in mei Sales.by.month


Sales.by.month [c(1,2,3,4,5,6)] Sales.by.month [1:6]




Use it to alter (wijzig) elements of a vector Sales.by.month[3:7] <- 2
Sales.by.month


2

,  3 nr’s wijzigen en je geeft er twee lukt niet
 4 wijzigen en je geeft er 2 lukt wel  recycling rule




2.8. Doing calculation with vectors
Alter all the elements of a vector at once (+/*-) Sales.by.month * 7
- = profit ----------------------------------------------------------------
0 700 1400 350 0 0 0 0 0 0 0 0
Bonus 1€ in jan, 2 in feb… Bonus <- 1:12
- The nth element of bonus is added Bonus
to the nth element of profit
Profit_bonus <- profit + bonus
Profit_bonus
---------------------------------------------------------------
1 702 1403 354 5 6 7 8 9 10 11 12
Wil weten hoeveel geld je per dag krijgt Days.per.month <- c(31, 28, 31, 30, 31, 30, 31,
- Divide every element of profit by 30, 31, 30, 31, 30, 31)
the corresponding element of
days.per.month Profit/days.per.month



The recycling rule




 R has recycled the value of the shorter vector Y several times
- The first element of x is added to the first element of y
- Second element of x is added to the second element of y
- Third element of x  isn’t any corresponding element in y  returns to the beginning
 R also does it when the length of the longer vector isn’t an exact multiple of the length of the shorter one
- Gives warning, but we will ignore it



3

, 2.9. Using functions to do calculations
Square root function Sqrt ()
225th element of sqrt Sqrt []
Absolute value function Abs ()
Use a function to do something Calling the function
Values typed into the function Arguments of that functions
1. Calculate value abs (-8)



2. Sqrt (1 + 8)

Sqrt (c (25, 49, 36)) 576
Does it on each element separately = vector element-wise
Know how many elements there are in a vector length ()


2.10 Combining stuff and the work-from-within-rule
Sqrt( abs(-25) ) First take the absolute value of -25 and then take the
square root
= work-from-within-rule




4
€10,46
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
mirtedeboeck

Maak kennis met de verkoper

Seller avatar
mirtedeboeck Thomas More Hogeschool
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1
Lid sinds
1 jaar
Aantal volgers
0
Documenten
4
Laatst verkocht
8 maanden geleden

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

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