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

Summary practical Data-mining: Rsudio commands

Puntuación
-
Vendido
2
Páginas
7
Subido en
12-05-2025
Escrito en
2024/2025

This is a summary of the commands used in the practical lessons of the course Data-mining. The commands are retrieved from the instruction documents that were given on blackboard. I made an overview of each practical (1-5 and the take-home assignment) in table format. This gives an overview of the used commands with their explanation.

Mostrar más Leer menos
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
12 de mayo de 2025
Número de páginas
7
Escrito en
2024/2025
Tipo
Resumen

Temas

Vista previa del contenido

Rstudio Commands
General
Command Meaning
Setwd(“C:/wherever your files are”) Change working directory
- Can be done like this:
o ‘session’ -> ‘set working directory’ ->
‘choose directory’
- Can also be done like this:
("C:/temp/whereverYourFilesAre")
Getwd() Get the current working directory

List.files() You get an overview of the files that are in your working
directory
Read.table() Read in a table
- File = “name” - Header: every column needs to have a header 
- Header = T or F manually fixed = TRUE
- Stringsasfactors = T or F - Stringsasfactor: columns with strings are read in as
- Dec = “,” or “.” factors = TRUE
- Na.string = “NA” or “?” - Dec: R needs to recognize it as a character and not
- Sep = “\t” as a calculation factor
- Na.string: missing value
- Sep: to tell R that only tabs (and not white space)
should be used to seperate columns
myData<-read.table() Assign table to an R-object
Write.table() Exporting an object to a pdf file
- X = name of data frame -
- File = “name”
- Quote = T or F
- Na = “NA” or “?”
- Dec = “,” or “.”
- Row.names = T or F
- Sep = “\t”
As.numeric() Convert data type
As.character()
As.factor ()
As.logical()
Summary() Summary of the dataset




1

, Practical 1
COMMAND MEANING
Class(myData) What kind of data structure
Str(myData) A more comprehensive overview of data
structure
Names(myData) Gives the headers
Dim(myData) Dimensions of a table
Nrow(myData) Number of rows and columns
Ncol(myData)
Length(myData$exam) Points of exam that are represented in a vector
 gives length of the vector
1:3 Vector of the numbers one to three
seq(from=1, to=3, by = 1)
c(1,2,3)
Levels(myData$gender) Levels of the factor
- Factor is a data structure for categorical
variables
myData$workshop <- Assign more descriptive names tot he factor
factor(myData$workshop, levels
levels = c(1,2,3) , labels =
c("R","SAS","SPSS") )
c(“John”,”Paul”,”George”, To make a character vector yourself
”Ringo”)
Ifelse() Make a new binary variable
- F.e. if a person passed the exam
[…] To select a part of a data structure
- [ ,j] - Columns
- [i, ] - Rows
Names()[3]<-“sex” Change the variable names
- [3]: row name you want to change
- <-“sex”: change to sex
Demo.matrix<- Construct a matrix
matrix(1:12,nrow=3,byrow - This is a 2 dimensional table
=T) - 1:12: because 12 observations
- Nrow:
- Byrow: added since by default, a matrix
is filled up by columns
Demo.matrix[3,1] If you want element on 3th row and 1st column
[,1:2] No index for the rows, which meas all rows are
selected  only a selection in the columns
Order() Order dataset according to …
O<-order(myData$exam) Sort entire data frame according to exam
+myData[o,] results  ASCENDING
O<-order(-myData$exam) Sort entire data frame according to exam
+myData[o,] results  DESCENDING
== Condition that the row/column need to fulfill in
order tob e selected
myX or myY Vecotr with X- or Y-values
Plot() Generate a plot
- Pch - Pch: argument to change a plot
- Itl character
- Col - Itl: argument to change the type of line
- Col: argument to change the colors
2
$4.22
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
WillemsenAmber
4.0
(1)

Documento también disponible en un lote

Conoce al vendedor

Seller avatar
WillemsenAmber Universiteit Antwerpen
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
10
Miembro desde
2 año
Número de seguidores
0
Documentos
47
Última venta
1 mes hace

4.0

1 reseñas

5
0
4
1
3
0
2
0
1
0

Recientemente visto por ti

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