hi, I use the example code from a R book , > x = rnorm( 100 ) > hist( x, probability = TRUE, col = gray(.9), main="normal mu = 0 , sigma = 1") #this works well > curve( dnorm(x),add =T) # but this does not work and it gives a warning . I am using Leopard and does anybody has ever met the problem? -------------------------- Peng Jiang ?? Ph.D. Candidate Antai College of Economics & Management ???????? Department of Mathematics ??? Shanghai Jiaotong University (Minhang Campus) 800 Dongchuan Road 200240 Shanghai P. R. China
curve does not work well??
4 messages · Peng Jiang, Duncan Murdoch, Sean Davis +1 more
On 16/06/2008 6:07 AM, Peng Jiang wrote:
hi, I use the example code from a R book ,
> x = rnorm( 100 ) > hist( x, probability = TRUE, col = gray(.9), main="normal mu = 0 ,
sigma = 1") #this works well
> curve( dnorm(x),add =T) # but this does not work and it gives a
warning . I am using Leopard and does anybody has ever met the problem?
What warning do you get? This is probably not Mac related, but the error might tell us differently. It would also help if you printed the result of sessionInfo(), to show R versions, etc. Duncan Murdoch
On Mon, Jun 16, 2008 at 6:07 AM, Peng Jiang <jp021 at sjtu.edu.cn> wrote:
hi, I use the example code from a R book ,
x = rnorm( 100 ) hist( x, probability = TRUE, col = gray(.9), main="normal mu = 0 , sigma = 1") #this works well
curve( dnorm(x),add =T) # but this does not work and it gives a warning .
I am using Leopard and does anybody has ever met the problem?
Hi, Peng. Generally, you will want to write to R-help for questions. Only if there is evidence that the problem is Mac-specific should you use the R-SIG-Mac list. Also, if you are reporting a problem, you will want to include the code that you use, any error messages or output, and also include the output of sessionInfo(). In particular, it isn't possible to know what you mean by "this does not work" and you did not include the warning message in the output. The example seems to work for me, though. Sean
On 16/06/2008, at 8:07 PM, Peng Jiang wrote:
hi, I use the example code from a R book ,
x = rnorm( 100 ) hist( x, probability = TRUE, col = gray(.9), main="normal mu = 0 ,
sigma = 1") #this works well
curve( dnorm(x),add =T) # but this does not work and it gives a
warning . I am using Leopard and does anybody has ever met the problem?
This works fine for me using R 2.7.0 under 10.5.3. It may be that something previous in your R session has caused the problem, so try restarting R. Ken