Re: [R] Help with Error

From: <Richard.Cotton_at_hsl.gov.uk>
Date: Thu, 17 Jan 2008 16:52:08 +0000


> d <- read.table("C:\\rep.csv", head=TRUE, sep=",")
> > pie(d$Votes,
> + labels=d$Name,
> + main="Class Rep Results\n(Final Results)")
>
> Error:
> Error in pie(d$votes, labels = d$name, main = "Class Rep Results\n(Final
> Results)") :
> 'x' values must be positive.

The first input to the pie function represents the size of the pie slice, so it's values must be non-negative.

Take a look at what you have stored in the data frame d; it is possible that the data has been read into R incorrectly. Type d and str(d) at the command line to see this.

Also, you might want to use read.csv to read in your data if it is comma separated value format.

Regards,
Richie.

Mathematical Sciences Unit
HSL



ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}

R-help_at_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. Received on Thu 17 Jan 2008 - 16:55:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jan 2008 - 17:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive