[R] Integration + Normal Distribution + Directory Browsing Processing Questions
Nils Hoeller
mail at nhoeller.de
Sun Jan 21 20:27:35 CET 2007
Hi everyone,
I am new to R, but it's really great and helped me a lot!
But now I have 2 questions. It would be great, if someone can help me:
1. I want to integrate a normal distribution, given a median and sd.
The integrate function works great BUT the first argument has to be a
function
so I do integrate(dnorm,0,1) and it works with standard m. and sd.
But I have the m and sd given.
So for fixed m and sd I work around with a new function mynorm
mynorm <- function(n) {
ret <- dnorm(n,0.6,0.15)
ret
}
for example.
BUT what can I do for dynamic m and sd?
I want something like integrate(dnorm(,0.6,0.15),0,1), with the first
dnorm parameter open for the
integration but fixed m and sd.
I hope you can help me.
2. I am working with textfiles with rows of measure data.
read.table("file") works fine.
Now I want R to read.table all files within a given directory and
process them one by the other.
for(all files in dir xy) {
x <- read.table(nextfile)
process x
}
Is that possible with R? I hope so. Can anyone give me a link to examples.
Thanks for your help
Nils
More information about the R-help
mailing list