On 23-Mar-07 16:55:40, Marc Schwartz wrote:
> [...]
> How about something like this:
> 
> 
> DistPlot <- function(x, digits = 1, ...)
> {
>   x <- round(x, digits)
>   
>   Tab <- table(x)
> 
>   Vals <- sapply(Tab, function(x) seq(x) - mean(seq(x)))
> 
>   X.Vals <- unlist(Vals, use.names = FALSE)
>   tmp <- sapply(Vals, length)
>   Y.Vals <- rep(names(tmp), tmp)
> 
>   plot(X.Vals, Y.Vals, ...)
> }
> 
> 
> Vec <- exp(rnorm(200, sd = 0.25) + 2) / 5
> 
> DistPlot(Vec, pch = 19)

Very pretty, Marc -- and magic code!!

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
Fax-to-email: +44 (0)870 094 0861
Date: 23-Mar-07                                       Time: 19:20:04
------------------------------ XFMail ------------------------------

______________________________________________
[email protected] 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.

Reply via email to