100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Resumen

samenvatting statistiek 3

Puntuación
-
Vendido
1
Páginas
70
Subido en
13-05-2025
Escrito en
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.

Institución
Grado











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

Subido en
13 de mayo de 2025
Número de páginas
70
Escrito en
2024/2025
Tipo
Resumen

Temas

Vista previa del contenido

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
$12.71
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
mirtedeboeck

Conoce al vendedor

Seller avatar
mirtedeboeck Thomas More Hogeschool
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1
Miembro desde
1 año
Número de seguidores
0
Documentos
4
Última venta
8 meses hace

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes