Re: [R] density plot not smooth

2015-03-18 Thread Fix Ace
Thank you very much! I do need to learn more about R!! On Tuesday, March 17, 2015 9:26 PM, William Dunlap wrote: Fix Ace wrote    What is the default "n"? 512:   > length(density(rnorm(10^6))$x)   [1] 512   > args(density.default)    function (x, bw = "nrd0", adjust = 1, kernel = c(

Re: [R] density plot not smooth

2015-03-18 Thread S Ellison
> I have a dataset with 6187 elements, ranged from 3 to 104028. When I tried to > examine only small range of data, I found that the plot was not smooth (as > shown below): > plot(density(test$V2), xlim=c(0,1000)) > > >  Is there away to make it smoother? For small ranges, use 'from' and 'to' i

Re: [R] density plot not smooth

2015-03-17 Thread Fix Ace
Thank you for the email. What is the default "n"? Thanks! On Tuesday, March 17, 2015 4:06 PM, William Dunlap wrote: Increasing the value of 'n' given to density will give an estimate at more points so it will look smoother.  Try n=2^18. Bill Dunlap TIBCO Software wdunlap tibco.com

Re: [R] density plot not smooth

2015-03-17 Thread William Dunlap
Fix Ace wrote What is the default "n"? 512: > length(density(rnorm(10^6))$x) [1] 512 > args(density.default) function (x, bw = "nrd0", adjust = 1, kernel = c("gaussian", "epanechnikov", "rectangular", "triangular", "biweight", "cosine", "optcosine"), weights = NULL, w

Re: [R] density plot not smooth

2015-03-17 Thread William Dunlap
Increasing the value of 'n' given to density will give an estimate at more points so it will look smoother. Try n=2^18. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Mar 17, 2015 at 12:06 PM, Fix Ace wrote: > > > I have a dataset with 6187 elements, ranged from 3 to 104028. When I > tr

[R] density plot not smooth

2015-03-17 Thread Fix Ace
I have a dataset with 6187 elements, ranged from 3 to 104028. When I tried to examine only small range of data, I found that the plot was not smooth (as shown below): plot(density(test$V2), xlim=c(0,1000))  Is there away to make it smoother? Thanks a lot!!     ___