imicola wrote:
Sorry, this is probably quite an easy question, but I'm new to R and couldn't
find the answer anywhere.

I'm using geoR and geoRglm, but can't figure out how to get a border in my
geodata object.  Does this need to be defined when I'm importing my data, or
afterwards, and how do I go about doing this?

Thanks
You can define the border previously and import it to R with read.table or read.csv or you can define it from your geodata object in R. In the first case don't forget to close the polygon by repeating the first vertex at the end of the file. In the second case you can use a convex hull function in R, such as chull(), to define the polygon with your geodata object. Say your geodata object is called my.geo, then my.geo$coords would be the coordinates. Then try this,
bor <- chull(my.geo$coords)
bor <- c(bor, bor[1]) # close polygon by appending the first vertex
plot(my.geo$coords)
lines(my.geo$coords[pol,])
HTH
Ruben

______________________________________________
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.

Reply via email to