[R] Create Pie chart from .csv file

Thomas Roth (geb. Kaliwe) hamstersquats at web.de
Tue May 5 18:08:21 CEST 2009


Sorry for mailing to you personally...

for types

read.csv(file.choose())
freqTable = table(types)
pie(freqTable)


##example for some data
temp = data.frame(types = 1:10)
pie(table(temp))

Thomas Roth

PS: use barplot instead of pie

DonkeyRhubarb schrieb:
> Hi all,
>
> 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.
>
> This is part of my final software project which is due in one week. I would
> very much appreciate any help.
>
> Many thanks in advance
>
>




More information about the R-help mailing list