I have read the R online help and wiki and I cannot seem to get something to
work the way I need it to.
I want to create a new data frame from an subset of an existing data frame
which has no reference to the original superset. If you following this
example, what I am trying to do may make more sense.
I have a file with values like this:
shirt,size,40
shirt,color,10
shirt,length,10
shirt,brand, 1
shoes,style,5
shoes,brand,4
shoes,color,1
and I read it into a dataframe like:
x <- data.frame(read.delim("temp2.txt", sep=",", header=FALSE))
I then want to plot just a subset of this data (say shirts only)...
y <- data.frame(subset(x, V1 == "shirt"))
plot(x2[,2:3])
when I do, the resulting plot contains an empty value for 'color' even
though my subset has no value in column V2 that equals 'color' anymore.
Is it possible create a new data.frame that truly deletes the rows from the
original data frame that I am excluding with the subset parameter?
Thanks,
Michelle
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.