[R] trivial syntax question!
Nicolas Degallier
n|co|@@@deg@|||er @end|ng |rom |ree@|r
Mon May 15 18:05:23 CEST 2023
Dear R-users,
I'm probably using R too sparsely to solve a very trivial difficulty, as I didn't find any clear example in the tutorials on the net.
My matrix is as follows (18 rows-individuals x 4 variables-columns:
L/l L/L_ely L/e L/L_car
LT 1.21875 1.56 1.857142857 5.2
PLT 1.290322581 1.568627451 1.904761905 5.333333333
ND1 1.426470588 1.732142857 2.255813953 4.85
ND2 1.301587302 1.673469388 1.952380952 3.037037037
ND3 1.235294118 1.555555556 2.8 4.666666667
JML 1.188405797 1.576923077 1.863636364 5.466666667
US1 1.338709677 1.693877551 1.886363636 5.045180795
US3 1.333333333 1.67032967 2.08566708 4.832587575
US5 1.328358209 1.679245283 2.08566708 5.045180795
US7 1.279411765 1.673076923 2.175 4.93725
Ml1 1.2 1.659574468 2.228571429 4.875
Ml2a 1.298507463 1.673076923 2.175 5.045180795
Ml2b 1.303030303 1.68627451 1.755102041 5.058823529
Ml3 1.234375 1.645833333 1.975 4.981388889
cri 1.291338583 1.673469388 2.08566708 5.045180795
nat 1.323529412 1.698113208 2.195121951 5.1075
nat 1.307692308 1.603773585 2.361111111 4.473684211
Sall� 1.266666667 1.648433128 1.9 7.6
I ran an ACP and a classification with the following script:
library(ade4)
library(stats)
library(cluster)
x<-read.table(file.choose (),sep="\t",header=T) # lecture des donn�es: sp�cimens en lignes, variable en colonnes s�par�es par des tabulations
labels <- x[,1] # �tiquettes des sp�cimens
x <- x[,-1] # s�lection des valeurs
acp<- dudi.pca(x , scannf= F,scale=T,center=T,nf=4) # analyse en composantes principales
s.label(acp$li, xax = 1, yax = 2, labels) # affichage des �tiquettes des specimens
s.corcircle(acp$co) # corr�lation entre les variables et les axes principaux
mat<-dist(x) # distances entre sp�cimens deux � deux
specimens<-mat
plot(hclust(specimens,"ward.D2"),hang=-1,ylab="distance",main="Classification des sp�cimens")
The resulting dendrogram is nice but I would like to have on the resulting plot the labels of each specimen in place of the number of the rows.
I really would be very happy if someone has some time to complete/fix my script or indicate an explicit tutorial.
Cheers
Nicolas Degallier
120 rue de Charonne
F-75011 Paris
<nicolas.degallier using free.fr>
<omalodes using yahoo.fr>
Publications :
https://www.documentation.ird.fr/listes/parauteur/DEGALLIER/NICOLAS/tout/annee
� Je regarde la carte des vins pour �viter les bouchons � (Raymond Devos)
[[alternative HTML version deleted]]
More information about the R-help
mailing list