[R] Error in Fields TPS function {svd ...} again

Roger Bivand Roger.Bivand at nhh.no
Thu Oct 31 10:56:58 CET 2002


> Thanks for all the helpful responses.  I include the data file and the
> syntax file for reference.  Again, if I use the fields function, as is,
>
It helped to have your example:

> data <- read.table("splus-data-black.dat")
> dim(data)
[1] 606   2
> summary(data)
       V1               V2
 Min.   :0.0000   Min.   :   0.0
 1st Qu.:0.0000   1st Qu.:   3.0
 Median :0.0000   Median :  36.0
 Mean   :0.3977   Mean   : 247.6
 3rd Qu.:0.0000   3rd Qu.: 149.9
 Max.   :7.0000   Max.   :4680.0
> table(data[1])

  0   1   2   3   4   5   6   7
488  64  24  10   7   9   2   2

Tps(x, Y, ...) expects x to be a matrix, in the geostatistical "world
view" of the locations of the observations in say 2d or 3d:

> Tps(data[,2], data[,1])
Error in svd(tempM) : error  159  in dsvdc

The distribution of your Y makes it look like counts, both x and Y have
smaller numbers of unique values than n=606:

> length(unique(data[,1]))
[1] 8
> length(unique(data[,2]))
[1] 161
> plot(data[,2], data[,1])

shows that the data are rather different from the ones in example(Tps). So
this doesn't look like a typical numerical problem, but Tps being used on
data for which it was not designed, and failing to trap this state.

Roger



 I  get the message:
>
> Error in svd(tempM) : error  159  in dsvdc
>
> using traceback, I get:
>
>  > traceback()
> 4: stop(paste("error ", z$info, " in dsvdc"))
> 3: svd(tempM)
> 2: Krig(x, Y, cov.function = rad.cov, m = m, decomp = decomp, scale.type
> =  scale.type,
>         outputcall = Tpscall, p = p, ...)
> 1: Tps(bvolcap, bdsm)
>  >
>
>
> if I change the occurrence of svd in the fields package to La.svd, I get
>  the error message
>
>  > bout <- Tps( bvolcap, bdsm)
> Error in "[<-"(*tmp*, (nt + 1):np, (nt + 1):np, value = temp$v) :
>          number of items to replace is not a multiple of replacement
> length
>  >
>
> traceback() then gives:
>
>  > traceback()
> 2: Krig(x, Y, cov.function = rad.cov, m = m, decomp = decomp, scale.type
> =  scale.type,
>         outputcall = Tpscall, p = p, ...)
> 1: Tps(bvolcap, bdsm)
>  >
>
> Sorry to be so useless, I am a R (S) newbie.  Any advice is greatly
> appreciated.


-- 
Roger Bivand
NHH, Breiviksveien 40, N-5045 Bergen, Norway
(travelling but still accessible)


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list