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 -- View this message in context: http://www.nabble.com/Create-Pie-chart-from-.csv-file-tp23387025p23387025.html Sent from the R help mailing list archive at Nabble.com.
You could go to rseek.org and search for pie chart; that will give you lots of ideas and examples, including discussion of why pie charts are a bad idea. Sarah On Tue, May 5, 2009 at 9:02 AM, DonkeyRhubarb <michaeligoe at gmail.com> wrote:> > 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 >-- Sarah Goslee http://www.functionaldiversity.org
Hi, I used ggplot2 for plotting recently, you should give it a try - it's excellent. http://had.co.nz/ggplot2/ All the best Philipp DonkeyRhubarb wrote:> 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 >
> 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 entriesunder> 'types' e.g. 3 x statistics 2x education etc. Im looking to have apiechart> 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 cando> 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 tocreate> 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}}
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 > >