[R] pcalg library : names of the variables ?

varin sacha v@r|n@@ch@ @end|ng |rom y@hoo@|r
Thu May 12 15:45:28 CEST 2022


Dear R-experts,

Here below my R code working but I would like to get the names of the variables to appear on the graph instead of 1 ; 2 ; 3 and 4.
Is it possible ? I have tried something with colnames(x) but I get an error message.
Many thanks for your help.

#############################
library(pcalg)
library("Rgraphviz")

x1<-c(505,530,419,486,608,468,519,486,532,289,529,474,571,546,458,476,376,474,598,419,479,615,507,473,532,392,496,426,480,583,490,499,513,444,542)

x2<-c(508,516,390,520,375,499,478,534,553,485,405,478,542,523,491,363,456,498,506,529,574,478,411,571,512,487,518,515,467,513,536,555,508,507,535)

x3<-c(469,500,394,486,653,453,494,546,453,431,448,635,444,473,416,561,644,435,582,513,424,696,435,476,467,595,566,567,495,557,494,372,660,432,586)
 
x4<-c(562,459,505,640,319,492,539,651,635,505,533,344,422,424,623,420,429,556,606,435,406,178,473,571,542,597,491,348,513,499,576,465,380,563,571)

x=c(x1,x2,x3,x4)
A=matrix(x,nrow=35)
A
colnames(x)<-c("engagement des élèves","engagement des enseignants","engagement des parents","efficacité")

suffStat<-list(C=cor(A),n=nrow(A))
adaptive.pag<-fci(suffStat,indepTest=gaussCItest ,p=4, alpha=0.1,type="adaptive")
par(mfrow=c(1,2))
plot(adaptive.pag)
#############################



More information about the R-help mailing list