[R] Create Pie chart from .csv file

Richard.Cotton at hsl.gov.uk Richard.Cotton at hsl.gov.uk
Tue May 5 16:30:06 CEST 2009

> I am looking to create a pie chart from a given column in a .csv file. 
> My class variables are as follows:
> entry_type,   uniquekey,   types, title,    url, abstract, journal, 
> author, month,
> year, howpublished
> So say I want to export a pie chart that groups together all  entries 
> 'types' e.g. 3 x statistics 2x education etc. Im looking to have a 
> represent this graphically that shows which type of entry is in most
> frequently. Preferably I'd like to export to a PDF chart and while I can 
> this by typing variables directly into the R console, I cannot manage it
> from a .csv file.
> If you cannot help me with this specific problem, just knowing how to 
> a generic pie chart would be a great help.

Split the problem up into different stages.

1. Read in your data form the csv file.

2. Plot something.
?pie if you really must, but a bar chart will almost certainly be better. 
See ?barplot and ?barchart (lattice package).

3. Export the graph to PDF.


Mathematical Sciences Unit


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

More information about the R-help mailing list