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 Overview of the practicals of advanced data analysis

Note
-
Vendu
1
Pages
14
Publié le
22-05-2024
Écrit en
2023/2024

Overview of the most important things in the practicals of advanced data analysis including the take home assignment.










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

Infos sur le Document

Publié le
22 mai 2024
Nombre de pages
14
Écrit en
2023/2024
Type
Resume

Aperçu du contenu

Input R-studio
Practicum 1
nrow(myData)
ncol(myData)
dim(myData)

A vector is the elementary structure for data handling in R. It is a set of
simple elements, all being objects of the same class.
1:3
seq(from=1, to=3, by = 1)
c(1,2,3)

A factor is a data structure for categorical variables. The levels of the
factor can be extracted by
Levels(myData$gender)

You can assign more descriptive names to the factor levels in the
following way.
myData$workshop <- factor(myData$workshop, levels = c(1,2,3) , labels
= c("R","SAS","SPSS") )

4 main types (or classes) of variables
- Numeric: integer or floating point
- Character: text string (names)
• (for example: myData$ID <- as.character(myData$ID)
• Make a character vector yourself:
• c(“john”,”paul”,”george”)
• as.character
- Factor:
• Categorical variable with limited number of levels
• Ordered or nat
- Logical: TRUE/FALSE

Exporting a modified table: write.table(myData, file =
"myFirstOutputFile")

Make a matrix: demo.matrix<-matrix(1:12, nrow =3,byrow=T)
Example :
genetics <-matrix(c(230,198,72,249,207,44),nrow=2,byrow=T)
colnames(genetics) <- c("AA","AG","GG")
rownames(genetics) <- c("Case","Control")

to make:
AA AG GG
Case 230 198 72
Control 249 207 44


1

, Sorting data :
 order(myData$exam)
 o <- order(myData$exam)
myData[o,]

Conditional selection: selection related to indexing, but instead of a
row/column number we now put a condition that the row/column elements
need to fulfill to be selected
 myData[myData$workshop == "SPSS" & myData$sex == "female" ,
]
 select <- myData$workshop == "SPSS"
select
myData[select,]
-> the comma means that we are selecting a subset of rows, while all the
columns are included

 The subset function is doing almost the same but observations
with missing values are omitted (weggelaten): subset(myData,
exam>10)

Splitting, stacking and merging files
Stacking: rbind() function
 myData.male <- myData[myData$sex == "male",]
myData.female <- myData[myData$sex == "female" ,]
rbind(myData.male,myData.female)

Split: split()
 split(myData, myData$sex)
 when you don’t only want to see the splitted data, but you also want
your data to be splitted in your library
o myData.split<-split(myData,myData$sex)


Plotting in R
Pch = plotting characters



Lty = line type
(0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash,
5=longdash, 6=twodash)

When you want to apply a color to the data for example a different color
for different species:
plot(Petal.Length~Sepal.Length,data=irisData,col=irisData$Species)

Tapply function can be used if you want to have a visual representation
of the ‘mean…’
Used in combination with barplot function
2
€7,66
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
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
AVL2 Universiteit Antwerpen
Voir profil
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
91
Membre depuis
4 année
Nombre de followers
49
Documents
90
Dernière vente
1 semaine de cela

4,3

4 revues

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