[R-sig-Geo] basic question about plotKML

Roman Luštrik roman.lustrik at gmail.com
Fri Sep 28 10:30:43 CEST 2012


Your code works for me?

http://tinypic.com/r/iblw5w/6

Cheers,
Roman



On Fri, Sep 28, 2012 at 5:43 AM, Struve,Juliane <jstruve at ufl.edu> wrote:
>
> Dear list,
>
> I am trying to plot some spatial data in Google Earth but have a hard time with the plotKML manual. What is missing in my script that will make plotKML() work ?
>
> Thank you for your time,
>
> Juliane
>
> xc = round(runif(10,-1,1)+27.2, 2)
> yc = round(runif(10,-1,1)+-82.5, 2)
> xy = cbind(xc, yc)
> xy.sp = SpatialPoints(xy)
> df = data.frame(z1 = round(5 + rnorm(10), 2), z2 = 20:29)
> SP.spdf = SpatialPointsDataFrame(xy.sp, df)
> plot(SP.spdf)
> #add a projection
> proj4string(SP.spdf) = CRS("+proj=longlat +datum=WGS84")
> plotKML(SP.spdf)
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo




--
In God we trust, all others bring data.



More information about the R-sig-Geo mailing list