[R] space-time k function problem

Roger Bivand Roger.Bivand at nhh.no
Fri Jun 11 21:35:55 CEST 2004


On Fri, 11 Jun 2004, hkang wrote:

> I am intersted in time-space clustering of local industry.
> 
> I made the point file, polygons and time table then run 'stkhat' function in Splancs,
> 
> but it generates only time k function. I noticed that it has only one ks value. ...
> 
> 
> 
> Can anybody help me?. 
> 

I think you need to coerce manufacpt to be a two-column matrix, now it is 
a data.frame, which is a different object structure.

as.matrix(manufacpt) should help, look at str(manufacpt) to see what is 
inside.

> thanks in advance.
> 
> 
> 
> 
> 
> countiespt <- read.table('d:/dissertation/dailynew/jun10/countiespt_ok.txt', sep=",")
> 
>  polymap(countiespt)
> 
>  
> 
>  manufacpt <- read.table('d:/dissertation/dailynew/jun10/manufacpt.txt', sep=",")
> 
>  names(manufacpt)<-c("x", "y")
> 
>  
> 
>  
> 
>  manufac23<-read.table('d:/dissertation/dailynew/jun10/manufac23.txt', sep=",")
> 
>  names(manufac23)<-c("x", "y", "t")
> 
> 
> 
> manufac23<-read.table('d:/dissertation/dailynew/jun10/manufac23.txt', sep=",")
> names(manufac23)<-c("x", "y", "t")
> bur2 <- stkhat(manufacpt, manufac23$t, countiespt, c(34060, 37712),  seq(1,60,60), seq(91,1005,60))
> oldpar <- par(mfrow=c(2,1))
> plot(bur2$s, bur1$ks, type="l", xlab="distance", ylab="Estimated K",
>   main="spatial K function")
> plot(bur2$t, bur2$kt, type="l", xlab="time", ylab="Estimated K",
>   main="temporal K function")
> par(oldpar)
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-help mailing list