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

Summary practical Data-mining: Rsudio commands

Beoordeling
-
Verkocht
2
Pagina's
7
Geüpload op
12-05-2025
Geschreven in
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.

Meer zien Lees minder
Instelling
Vak









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

Geschreven voor

Instelling
Studie
Vak

Documentinformatie

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

Onderwerpen

Voorbeeld van de inhoud

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
$3.59
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
WillemsenAmber
4.0
(1)

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
WillemsenAmber Universiteit Antwerpen
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
8
Lid sinds
1 jaar
Aantal volgers
0
Documenten
42
Laatst verkocht
1 week geleden

4.0

1 beoordelingen

5
0
4
1
3
0
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