[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
under
> 'types' e.g. 3 x statistics 2x education etc. Im looking to have a
piechart
> 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
do
> 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
create
> 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.
?read.csv
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.
?pdf
Regards,
Richie.
Mathematical Sciences Unit
HSL
------------------------------------------------------------------------
ATTENTION:
This message contains privileged and confidential inform...{{dropped:20}}
More information about the R-help
mailing list