Plz provide a reproducible example (using dput). Anyway, I suspect your data to be 'factor' and not numeric. y=rbinom(100,1,0.5) x=runif(100) plot(x,y) #OK plot(x,as.factor(y))
See ?factor and ?as.numeric. Regards, Eloi On 12-08-01 11:41 AM, Georgiana May wrote: > Hello, > Anyone know why the command: >> plot(x,y) where y is a 0,1 result > sometimes plots the y values as 1,2 rather than 0,1? > > And how to prevent this? > > Thank you, > Georgiana May > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org 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. > > -- Eloi Mercier Bioinformatics PhD Student, UBC Paul Pavlidis Lab 2185 East Mall University of British Columbia Vancouver BC V6T1Z4 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.