[R] random between two values

2009-08-06 Thread damien landais
Hi,
I would obtain a random value between two (for example between 40.15 and 56.58 
I would have only one value).
I'm looking for a package/a function which could do this.
Could anybody help me please?

Cordialement
Damien Landais

__
R-help@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.


[R] to raise in a loop more than 1

2009-06-26 Thread damien landais
I would raise x,y and z in a loop but I won't raise of 1. I tried this but it 
doesn't work

mydata=matrix(nrow=1500,ncol=3)
i=1
for(x in 0:10){
for(y in 0:20){
for(z in 0:10){
mydata[i,]=c(x,y,z)
i=i+1
z=z+2}
y=y+4}
x=x+2}

And I would have something like that 
x   y   z
0   0   0
0   0   2
0   0   4
0   0   6
0   0   8
0   0   10 
0   4   0
0   4   2
...

Could anybody help me?
I don't work on a special package to do it...

Thanks

Cordialement
Damien Landais

__
R-help@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.


[R] Variogram fitted by Cauchy

2009-06-11 Thread damien landais
Hi
I'm using R(2.9.0)  and gstat package under Windows  to  plot sample variograms.
When I want to fit them, I don't have the possibility to choose Cauchy 
functions. Under Mathematica for example, we have it and it seems to be the 
best one to fit the variograms I have
I tested the others functions, they can fit but I would,if possible, use the 
Cauchy one. If anybody knows something about it, I would know, even with 
another package

To show what I want to do, here is my code

mydata=read.table(97MHz_15cm_V3.txt)
colnames(mydata)=c(x,y,z,E,taille)
g=gstat(id=zinc,formula=mydata[,4]~1,locations=~x+y+z,data=mydata)
g.var=variogram(g,cutoff=2500,width=100)

modele=vgm(model=Exp,range=2000)
vario=fit.variogram(g.var,modele)


Thanks!

Cordialement
Damien Landais

__
R-help@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.


[R] plot two variograms on a same graph

2009-06-10 Thread damien landais
Hi,
I would know how to plot two variograms on a same graph. I can plot one by one 
but I would draw both on the same one.
Is it possible? Do i need any special package?

Thanks!

Cordialement
Damien Landais

__
R-help@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.