[R-sig-eco] scatter plot of coordinates
Gavin Simpson
gavin.simpson at ucl.ac.uk
Wed Jan 27 18:45:33 CET 2010
On Wed, 2010-01-27 at 10:28 +0100, Julia Tchernova wrote:
> Hello!
> I have a dataset with the date and positions - Lat and Long columns
> How do I make a scatter plot?
> Do I have to cbind the Lat and Long columns?
> Any suggestions will be much appreciated!
> Thank you
> Julia
The spatial stack of software will probably be useful here if you need
to think about projections etc. Others have suggested something suitable
for simple graphs but for anything even a bit more advanced, the spatial
software will be helpful.
For example:
require(sp)
dat <- data.frame(X = rnorm(3), lat = c(20,30,40), lon = c(10,20,30))
coordinates(dat) <- c("lon","lat")
plot(dat)
box()
axis(1)
axis(2)
## or
##spplot(dat)
HTH
G
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-sig-ecology
mailing list