Dear Edzer and Henny
A few more clues, and found the solution. Sorry to have wasted your time Edzer. For all you newbies on R and myself.
I did:
> detach("package:geoR")
> plot.variogram(vgm1,model=vgm(1,"Sph",300,1))
Error: couldn't find function "plot.variogram"
# ???????????? I am lost here
> ?plot.variogram
# This brings up the help file for plot.variogram from gstat
> plot(vgm1,model=vgm(1,"Sph",300,1))
# That works (I might almost say of course, I can hear Edzer laugh in the background)


Sorry to have wasted your time

Willem

willem vervoort wrote:

Henny Mehner gave the clue:
It has to do with the mix-up between geoR and gstat.

args(plot.variogram)
function (x, max.dist, vario.col = "all", scaled = FALSE, var.lines = FALSE,
envelope.obj = NULL, pts.range.cex, bin.cloud = FALSE, ...)
NULL


Clearly this is the geoR version of plot.variogram. ?plot.variogram actually tells me that! I am not an expert on R. Is there any way to keep the preferred package in and unload the non-essential one?

Or is there something to do about the confusion in the naming.

Willem

Edzer J. Pebesma wrote:

Willem, could you retry the commands under the
current version of R, 1.8.1?
--
Edzer

Willem Vervoort wrote:

Hi all
I am using R 1.8.0 under Windows XP
I have installed gstat from CRAN
I am having problem ploting the variograms

vgm1<-variogram(clay~x+y, loc=~x+y, PC.spdata,witdh=cutoff/50)





tmp<-fit.variogram(vgm1,vgm(1,"Sph",300,1),print.SSE=TRUE)





[1] "SSErr: 31366.3780209903"


All this works

plot.variogram(vgm1,model=vgm(1,"Sph",300,1))





Error in if (x$output.type == "bin") Ldots$type <- "p" : argument is of length zero

In addition: Warning message:
no finite arguments to max; returning -Inf

?plot.variogram





The help text is there!


plot.variogram(vgm1)





Error in if (x$output.type == "bin") Ldots$type <- "p" : argument is of length zero

In addition: Warning message:
no finite arguments to max; returning -Inf

Not good, I seem to think it has to do with me. Am I getting the class of my data right? The data is pretty simple:

PC.spdata[1:10,]





x y clay sand fsand EC McN Tikh


1 0 0.5 49.49 34.19 28.27 266 198.3690 126.33059

2 0 1.5 47.65 28.75 25.06 911 288.6718 124.15259

3 0 2.5 56.88 26.41 18.78 1251 315.1554 121.83433

4 0 3.5 61.94 25.00 16.33 1140 302.2132 119.25082

5 0 4.5 65.02 21.75 12.62 1188 273.8793 116.30404

6 0 5.5 59.79 24.61 13.97 1112 244.8895 112.92241

7 0 6.5 61.01 21.72 12.38 1046 220.6816 109.05847

8 0 7.5 43.58 52.30 8.54 725 206.2891 104.68629

9 0 8.5 51.16 47.36 7.38 713 206.7454 99.79917

10 50 0.5 48.10 33.34 27.96 253 157.0218 102.49656

This is a data.frame. ?spatial.data.frame gives error

Any clues would be appreciated

Regards
Willem Vervoort





--
R.W. Vervoort
McCaughey Lecturer Hydrology and Catchment Management
Bldg A03 The University of Sydney, NSW 2006


ph:     +61 2 9351 8744 (w)
        +61 2 9713 5625 (h)
fax:    +61 2 9351 5108




Reply via email to