Hi everyone, I am new in R, just used it for 2 weeks and I have a basic question. I have data, for example table$attrib that I would like to plot its cumulative distribution in logarithmic scale. How do I do that? After browsing internet, I tested this command:> plot.ecdf(1:100, log ="y", table$attrib)I got a plot, but I am not really sure what 1:100 and log="y"did to produce the plot. Any help is appreciated. Thank you, Zuki
Zuki, You did not provide any information on what table$attrib is. Using a log scale for the y-axis doesn't make much sense to me, since the y-axis is the cumulative proportion of observations, from 0 to 1. Perhaps you are interested in the log scale for the x-axis, instead? In any case, log is not an argument to the plot.ecdf function. You could take the log of the values then plot the ecdf, like this: plot.ecdf(log(1:100), axes=F) axis(1, at=log(tix), labels=tix) axis(2) box() Jean Zuki <zuki12@gmail.com> wrote on 08/15/2012 04:16:06 AM:> > Hi everyone, > > I am new in R, just used it for 2 weeks and I have a basic question. I > have data, for example table$attrib that I would like to plot its > cumulative distribution in logarithmic scale. How do I do that? After > browsing internet, I tested this command: > > > plot.ecdf(1:100, log ="y", table$attrib) > > I got a plot, but I am not really sure what 1:100 and log="y"did to > produce the plot. Any help is appreciated. > > Thank you, > Zuki[[alternative HTML version deleted]]
If you don't know what 1:100 is, you should (re)read the "Introduction to R" document that comes with the software. You can also try typing expressions like this alone at the command line to see what they are. If you don't know what the first argument to the ecdf function is, you need to learn to use the help system, e.g. ?ecdf --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Zuki <zuki12 at gmail.com> wrote:>Hi everyone, > >I am new in R, just used it for 2 weeks and I have a basic question. I >have data, for example table$attrib that I would like to plot its >cumulative distribution in logarithmic scale. How do I do that? After >browsing internet, I tested this command: > >> plot.ecdf(1:100, log ="y", table$attrib) > >I got a plot, but I am not really sure what 1:100 and log="y"did to >produce the plot. Any help is appreciated. > >Thank you, >Zuki > >______________________________________________ >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.