x = iris$Sepal.Width;
y = iris$Species;
m = cbind(x,y);
the output of m is:
x y
[1,] 3.5 1
[2,] 3.0 1
[3,] 3.2 1
[4,] 3.1 1
[5,] 3.6 1
[6,] 3.9 1
but I want 'setosa', etc in column y instead of a number
how can I do that?
I want to combine the 2 Vectors because I want to filter afterwards with
m[m[,"y"]=="virginica",]
or is ther another oportunity to do that without cbind?
cbind.data.frame
overdata.frame
(i guess it's more explicit...) – Filial