[R] Simple Function doesn't work?

2009-11-27 Thread Anastasia
Hello, I am new to R program, therefore, I am sorry if this is a really stupid question. I wrote a simple function and for some reason it doesn't work ReturnsGrid = function(x,y,m){ for (i in 1:m){ grid[i] <- x + (i-1)*(y-x)/m } grid } xx=ReturnsGrid(0,9,3) Thanks a lot! [[alternati

[R] post

2009-11-27 Thread Anastasia
Dear all, I have the following problem which I cannot solve: data <- numeric (100) for (i in 1:100){ p <- runif(1,min=0,max=1) data[i] <- rnorm(1,mean=2,sd=1) } ke <- density(data,bw="sj",n=61) How can I now find the value of this density function for example ke(0), ke(2) etc. Maybe this is