source('/home/pw/wessanet/cretab')



myrfcuid = ''

x <- array(list(fall3',24.1,66.3,122,fall4',24.5,59.9,130,s3',24.6,62.1,108,s4.rat',23.9,62.3,89,s5A.rat',23.9,63.3,109),dim=c(4,5),dimnames=list(c('label','logWb','logWbr','SWS',''),1:5))
 y <- array(NA,dim=c(4,5),dimnames=list(c('label','logWb','logWbr','SWS',''),1:5))
 for (i in 1:dim(x)[1])
 {
 	for (j in 1:dim(x)[2])
 	{
 		y[i,j] <- as.numeric(x[i,j])
 	}
 }
par1 = '2'
par1 <- '2'
#'GNU S' R Code compiled by R2WASP v. 1.2.327 (Sun, 16 Jul 2017 10:28:45 +0200)
#Author: root
#To cite this work: Wessa P. (2017), Factor Analysis (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL https://www.wessa.net/rwasp_factor_analysis.wasp/
#Source of accompanying publication: 
#
library(psych)
par1 <- as.numeric(par1)
x <- t(x)
nrows <- length(x[,1])
ncols <- length(x[1,])
y <- array(as.double(x[1:nrows,2:ncols]),dim=c(nrows,ncols-1))
colnames(y) <- colnames(x)[2:ncols]
rownames(y) <- x[,1]
print(y)
fit <- principal(y, nfactors=par1, rotate='varimax')
fit
fs <- factor.scores(y,fit)
fs
postscript(file="/home/pw/wessanet/rcomp/tmp/1iqob1621123716.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(fs$scores,pch=20)
text(fs$scores,labels=rownames(y),pos=3)
dev.off()

a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Rotated Factor Loadings',par1+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variables',1,TRUE)
for (i in 1:par1) {
a<-table.element(a,paste('Factor',i,sep=''),1,TRUE)
}
a<-table.row.end(a)
for (j in 1:length(fit$loadings[,1])) {
a<-table.row.start(a)
a<-table.element(a,rownames(fit$loadings)[j],header=TRUE)
for (i in 1:par1) {
a<-table.element(a,round(fit$loadings[j,i],3))
}
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file="/home/pw/wessanet/rcomp/tmp/2uy6x1621123716.tab") 

try(system("convert /home/pw/wessanet/rcomp/tmp/1iqob1621123716.ps /home/pw/wessanet/rcomp/tmp/1iqob1621123716.png",intern=TRUE))
