Julia,

Plotting geographic locations is a bit of a special case because you will 
want to control the aspect ratio to prevent distortion of your map.  I'm 
sure this issue is of some general interest, so....

Simplest is to use 'asp=1' as an argument to plot.   As you can see, you 
do not need to combine the vectors of coordinates before using them for 
plotting, though you may do so in several ways.  I varied values for 
aspect ratios so you will see the effect.

x <- 1:10
y<- rnorm(10,x,2)
plot(x,y,asp=0.1)

...or...

df <- data.frame(x,y)
with(df, plot(x,y,asp=1))

...or...

mat <- cbind(x,y)
plot(mat,asp=2)

Another way is to set up a coordinate window and plot points on the 
window.  Execute this one line at a time to see how this approach 
facilitates building plots from components, exactly the way you want. Very 
useful when writing functions!

plot.new()
plot.window(xlim=c(0,20),ylim=c(0,20))
points(x,y)
axis(side=1)
axis(side=2)
box()
mtext("Example")

The neatest approach for data such as yours is to use functions in the 
package "maptools," particularly "readShapePoly()" to import a shapefile 
and use and the associated plotting method... but you will need to 
understand S4 classes pretty well.  See "Applied Spatial Data Analysis 
with R" by Bivand et al. (Springer) if you plan to do this sort of thing 
on a regular basis.

Good luck,

Glen

*************************************************
Glen A. Sargeant, Ph.D.
Research Wildlife Biologist/Statistician
Northern Prairie Wildlife Research Center
8711 37th Street SE
Jamestown, ND  58401

Phone: (701) 253-5528
E-mail:  glen_sargeant@usgs.gov
FAX:     (701) 253-5553
*************************************************



From:
Christian Parker <cparker@pdx.edu>
To:
Julia Tchernova <tchernova@npolar.no>
Cc:
r-sig-ecology@r-project.org
Date:
01/27/2010 08:50 AM
Subject:
Re: [R-sig-eco] scatter plot of coordinates
Sent by:
r-sig-ecology-bounces@r-project.org



Julia,

## Lets say that you read your data in and called it x
x<-read.csv("mydata.csv")
## and that dataset had 3 columns in it; date, lat and long
plot(lat~long,x)
## or
plot(x$lat~x$long)
## or
plot(x$long, x$lat)
## for more help with the plot function (additional arguments and the 
like) enter
?plot

-Chris

Abraham de Alba A. wrote:
> Please elaborate Julia,
>
> I gather you have 3 columns, data, lat, long ?
>
> the easiest is a GIS, say Arcview  but don't know what you are after, a 
geostatistical program would also do, say GS+
> 
> Abraham de Alba Avila
> Terrestrial Plant Ecology
> INIFAP-Ags
> Ap. postal 20,
> Pabellón Arteaga, 20660
> Aguascalientes, MEXICO
> 
> SKYPE: adealba55
>  Tel: (465) 95-801-67, & 801-86 ext. 126, FAX ext 102
> alternate: dealba.abraham@inifap.gob.mx 
> cel: 449-157-7070
>
>
>
>
> ________________________________
> From: Julia Tchernova <tchernova@npolar.no>
> To: "r-sig-ecology@r-project.org" <r-sig-ecology@r-project.org>
> Sent: Wed, January 27, 2010 3:28:37 AM
> Subject: [R-sig-eco] scatter plot of coordinates
>
> 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?
> [[elided Yahoo spam]]
> Thank you
> Julia
>
>     [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>
> 
>                [[alternative HTML version deleted]]
>
> 
> ------------------------------------------------------------------------
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



	[[alternative HTML version deleted]]

