Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4.2 TrustPilot
logo-home
Resume

Summary practical Data-mining: Rsudio commands

Note
-
Vendu
2
Pages
7
Publié le
12-05-2025
Écrit 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.

Montrer plus Lire moins









Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

Infos sur le Document

Publié le
12 mai 2025
Nombre de pages
7
Écrit en
2024/2025
Type
Resume

Aperçu du contenu

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
€2,99
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
WillemsenAmber
4,0
(1)

Document également disponible en groupe

Thumbnail
Package deal
Summary data mining: theory and practicals
-
4 2025
€ 23,46 Plus d'infos

Faites connaissance avec le vendeur

Seller avatar
WillemsenAmber Universiteit Antwerpen
Voir profil
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
10
Membre depuis
1 année
Nombre de followers
0
Documents
44
Dernière vente
2 jours de cela

4,0

1 revues

5
0
4
1
3
0
2
0
1
0

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions