Hello,
If you're just looking to 'zoom in' as it were, this should do it:
plot(density(j), xlim = c(98, 102))
HTH,
Josh
On Tue, Jul 6, 2010 at 8:50 AM, Albert Vilella <avilella at gmail.com>
wrote:> Hi,
>
> (I googled for this answer but didn't find anything)
>
> I am using density plot and I want to trim the ends of the line. eg:
>
> i = rnorm(100,100,2)
> j = subset(i,i<102 & i>98)
> summary(j)
> plot(density(j))
>
> I only want the line to go from 98 to 102. How can I limit the line
> (and the axis)
> to the values I specify?
>
> Cheers,
>
> Albert.
>
> ______________________________________________
> 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.
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/