Re: [R] Error for atomic vectors and integers issue

2013-09-29 Thread peter dalgaard
On Sep 29, 2013, at 02:06 , Guy Wachsman wrote: > Hi all, > > I was doing a PCA o the iris data set but when trying to rbind the "Species" > column back from the original data set, it turned into 1:3 integers instead > of the original ones. I noticed that the original names of the species are

Re: [R] Error for atomic vectors and integers issue

2013-09-29 Thread Prof Brian Ripley
Please do read the help for cbind(). 'iris' is a data frame, and you created a matrix. Most likely you intended iris.bind <- data.frame(x = iris.sub.pca$x, Species = iris$Species) On 29/09/2013 01:06, Guy Wachsman wrote: Hi all, I was doing a PCA o the iris data set but when trying to rbin

[R] Error for atomic vectors and integers issue

2013-09-29 Thread Guy Wachsman
Hi all, I was doing a PCA o the iris data set but when trying to rbind the "Species" column back from the original data set, it turned into 1:3 integers instead of the original ones. I noticed that the original names of the species are of type "integer", but I don't understand why, and how to p