Hello can anyone help,

I have been running the following script to obtain a PCA plot but the end result is rather disappointing as the points are very very small and there are no titles etc

geochemdata<-read.csv(file.choose(),header=TRUE)

names(geochemdata)

library(vegan)

bstick<-function(n, tot.var=1) rev(cumsum(tot.var/n:1)/n)

geopca<-rda(geochemdata, scale=TRUE)

geopca

geopca$CA$eig/geopca$tot.chi

summary(geopca, scaling=2)

apply(scores(geopca, choices=1.6, display= "species"),
+   2,function(x) x/sd(x))

plot(geopca$CA$eig, type= "o", col= "red", xlab= "PCA Axis",
ylab= "Variance", main= "Scree plot for the PCA of the Geochem Data")

bstick.env<- bstick(19, tot.var=19) #must change number based on number in bstick model

bstick.env

geopca

plot(bstick.env, type="o", lty="dotted", ylim=range(bstick.env,
geopca$CA$eig), xlab="PCA Axis", ylab="Inertia",
main="Geochemical ITRAX Data: Bstick")

points(geopca$CA$eig, type="o", col="red")

plot(geopca, scaling=2)

env.sc<- scores(geopca)$species

plot(geopca, scaling=2)

arrows(0, 0, env.sc[,1]*0.85, env.sc[,2]*0.85,
col="red", length=0.05)

Does anyone know a more suitable code? I have also tried

eochemdata<-read.csv(file.choose(),header=TRUE)

names(geochemdata)

fit <- princomp(geochemdata, cor=TRUE)

summary(fit) # print variance accounted for

loadings(fit) # pc loadings

plot(fit) # scree plot

fit$scores # the principal components

write.csv(fit$scores, file="trial.csv") # export output of PCA

which does work but again I cannot seem to adjust the output. All the titles become squashed/un-readable and the points are in text format rather than appear as mere dots. Is there code to allow the user to move things about as they so wish and set their own style? I have used all the online suggestions but they keep coming back with error comments.

	[[alternative HTML version deleted]]

