http://r.789695.n4.nabble.com/file/n3389613/Life_Expectancies_2008.csv Life_Expectancies_2008.csv I am trying to plot a histogram base on the file i uploaded above. I am facing a trouble in sorting out the frequency of the life expectancies. I wanted to plot a graph of life expectancies at birth versus frequency,but i have no idea how to change the locations into frequencies taking the range of life expectancies at birth from 40 to 90. I tried using table(Life.Expectancies.at.Birth) to show the frequencies of each number and I do not know how to continue. -- View this message in context: http://r.789695.n4.nabble.com/Plotting-graph-problem-tp3389613p3389613.html Sent from the R help mailing list archive at Nabble.com.
On Mar 19, 2011, at 9:10 AM, andrew456 wrote:> http://r.789695.n4.nabble.com/file/n3389613/Life_Expectancies_2008.csv > Life_Expectancies_2008.csv > > I am trying to plot a histogram base on the file i uploaded above. I > am > facing a trouble in sorting out the frequency of the life > expectancies. I > wanted to plot a graph of life expectancies at birth versus > frequency,but i > have no idea how to change the locations into frequencies taking the > range > of life expectancies at birth from 40 to 90. I tried using > table(Life.Expectancies.at.Birth) to show the frequencies of each > number and > I do not know how to continue.You should show how you turned that data into an R object first. Then someone may offer a hint to take the next step in your homework. -- David Winsemius, MD West Hartford, CT
>data1<-read.delim("C:\\Users\\wenyin\\desktop\\Life_Expectancies_2008.txt",header=T)> attach(data1) > names(data1) > table(Life.Expectancies.at.Birth)so this thing showed up: Life.Expectancies.at.Birth 42 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 2 2 1 4 4 1 2 2 5 5 1 2 3 5 3 2 6 6 3 3 1 5 6 7 8 6 72 73 74 75 76 77 78 79 80 81 82 83 13 11 14 9 8 2 5 3 12 8 5 2 -- View this message in context: http://r.789695.n4.nabble.com/Plotting-graph-problem-tp3389613p3389759.html Sent from the R help mailing list archive at Nabble.com.
You should probably tell us which part of a<- read.csv("http://r.789695.n4.nabble.com/file/n3389613/Life_Expectancies_2008.csv") hist(a) doesn't do what you expect. (Though often when people say "histogram" they want something else - what's with that anyhow?) Allan On 19/03/11 13:10, andrew456 wrote:> http://r.789695.n4.nabble.com/file/n3389613/Life_Expectancies_2008.csv > Life_Expectancies_2008.csv > > I am trying to plot a histogram base on the file i uploaded above. I am > facing a trouble in sorting out the frequency of the life expectancies. I > wanted to plot a graph of life expectancies at birth versus frequency,but i > have no idea how to change the locations into frequencies taking the range > of life expectancies at birth from 40 to 90. I tried using > table(Life.Expectancies.at.Birth) to show the frequencies of each number and > I do not know how to continue. > > -- > View this message in context: http://r.789695.n4.nabble.com/Plotting-graph-problem-tp3389613p3389613.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.