<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you very much Wilfried.<br>
Best,<br>
<br>
Manuel<br>
<br>
On 11/09/2010 06:59 a.m., Wilfried Thuiller wrote:
<blockquote
cite="mid:7F5D84CB-D74A-4CCF-AB96-D2AD07D87006@ujf-grenoble.fr"
type="cite">
<div>You have different way.</div>
<div>Either your data are already in a shapefile with associated
coordinate files, or they are simply a txt files with
coordinates and you know the projection system</div>
<div><br>
</div>
<div>1- Use the rgdal package.</div>
<div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(176, 20, 12);"><span style="color: rgb(0, 113, 40);">library</span><span
style="color: rgb(4, 34, 153);">(</span><span style="color:
rgb(0, 113, 40);">rgdal</span><span style="color: rgb(4, 34,
153);">)</span><span style="font: 13px 'Lucida Grande';
color: rgb(4, 34, 153);"><br>
</span><span style="color: rgb(0, 113, 40);">poly</span><span
style="color: rgb(4, 34, 153);"> <- </span><span
style="color: rgb(0, 113, 40);">readOGR</span><span
style="color: rgb(4, 34, 153);">(</span>"path_to_the_right_folder"<span
style="color: rgb(4, 34, 153);">, </span><span
style="color: rgb(0, 113, 40);">layer</span><span
style="color: rgb(4, 34, 153);">=</span>"name_of_the_files_without_extension"<span
style="color: rgb(4, 34, 153);">)</span><span style="font:
13px 'Lucida Grande'; color: rgb(4, 34, 153);"><br>
</span><span style="color: rgb(0, 113, 40);">summary</span><span
style="color: rgb(4, 34, 153);">(</span><span style="color:
rgb(0, 113, 40);">poly</span><span style="font: 13px 'Lucida
Grande'; color: rgb(4, 34, 153);">)</span></div>
</div>
<div><span style="font: 13px 'Lucida Grande'; color: rgb(4, 34,
153);"><br>
</span></div>
<div><font class="Apple-style-span" size="3" color="#042299"
face="'Lucida Grande'"><span class="Apple-style-span"
style="font-size: 13px;"><br>
</span></font></div>
<div><font class="Apple-style-span" size="3" color="#042299"
face="'Lucida Grande'"><span class="Apple-style-span"
style="font-size: 13px;">2- In a text file you import in R
with the name 'plots'</span></font></div>
<div><font class="Apple-style-span" size="3" color="#042299"
face="'Lucida Grande'"><span class="Apple-style-span"
style="font-size: 13px;">Let's say you use the WGS84
projections and the coordinates are in columns X_WGS84 and
Y_WGS84</span></font></div>
<div><font class="Apple-style-span" size="3" color="#042299"
face="'Lucida Grande'"><span class="Apple-style-span"
style="font-size: 13px;">
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(176, 20, 12);"><span style="color: rgb(4, 34, 153);"> </span><span
style="color: rgb(0, 113, 40);">pointsWGS84</span><span
style="color: rgb(4, 34, 153);"> <- </span><span
style="color: rgb(0, 113, 40);">plots</span><span
style="color: rgb(4, 34, 153);">[,</span><span
style="color: rgb(0, 113, 40);">c</span><span
style="color: rgb(4, 34, 153);">(</span>"X_WGS84"<span
style="color: rgb(4, 34, 153);">, </span>"Y_WGS84"<span
style="color: rgb(4, 34, 153);">)]</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);"> </span>colnames<span
style="color: rgb(4, 34, 153);">(</span>pointsWGS84<span
style="color: rgb(4, 34, 153);">) <- </span>c<span
style="color: rgb(4, 34, 153);">(</span><span
style="color: rgb(176, 20, 12);">"x"</span><span
style="color: rgb(4, 34, 153);">,</span><span
style="color: rgb(176, 20, 12);">"y"</span><span
style="color: rgb(4, 34, 153);">)</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);"> </span>coordinates<span
style="color: rgb(4, 34, 153);">(</span>pointsWGS84<span
style="color: rgb(4, 34, 153);">) <- </span>c<span
style="color: rgb(4, 34, 153);">(</span><span
style="color: rgb(176, 20, 12);">"x"</span><span
style="color: rgb(4, 34, 153);">, </span><span
style="color: rgb(176, 20, 12);">"y"</span><span
style="color: rgb(4, 34, 153);">)</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);">###
stipulate to R what is the projection. Look at the help
file for proj4string</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(176, 20, 12);"><span style="color: rgb(4, 34, 153);"> </span><span
style="color: rgb(0, 113, 40);">proj4string</span><span
style="color: rgb(4, 34, 153);">(</span><span
style="color: rgb(0, 113, 40);">pointsWGS84</span><span
style="color: rgb(4, 34, 153);">) <- </span><span
style="color: rgb(0, 113, 40);">CRS</span><span
style="color: rgb(4, 34, 153);">(</span>"+proj=latlong
+datum=WGS84"<span style="color: rgb(4, 34, 153);">) </span><span
style="color: rgb(169, 65, 203);"># WGS84 projection
string</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);"> </span>head<span
style="color: rgb(4, 34, 153);">(</span>pointsWGS84<span
style="color: rgb(4, 34, 153);">@</span>coords<span
style="color: rgb(4, 34, 153);">)</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);"><br>
</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);">#if
you want to transform the coordinates in another
projection system. For instance here in Lambert for
France II étendu.</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);">#
first create the projection file: </span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><br>
</div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);">
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(176, 20, 12);"><span style="color: rgb(0, 113, 40);">proj4NTFII</span><span
style="color: rgb(4, 34, 153);"> <- </span>"+proj=lcc
+lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742
+x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515
+towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m
+no_defs"</div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(169, 65, 203);"><span style="color: rgb(4, 34,
153);"> </span>#EPSG Projection 27582 - NTF (Paris)
/ France II</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);"><span style="color: rgb(4, 34, 153);"></span>pointsNTFII<span
style="color: rgb(4, 34, 153);"> <- </span><b>spTransform</b><span
style="color: rgb(4, 34, 153);">(</span>pointsWGS84<span
style="color: rgb(4, 34, 153);">, </span>CRS<span
style="color: rgb(4, 34, 153);">(</span>proj4NTFII<span
style="color: rgb(4, 34, 153);">))</span></div>
<div style="margin: 0px; font: 13px 'Courier New'; color:
rgb(0, 113, 40);">head<span style="color: rgb(4, 34,
153);">(</span>pointsNTFII<span style="color: rgb(4, 34,
153);">@</span>coords<span style="color: rgb(4, 34,
153);">) </span></div>
</span></font></div>
<div><font class="Apple-style-span" size="3" color="#042299"
face="'Lucida Grande'"><span class="Apple-style-span"
style="font-size: 13px;"><br>
</span></font></div>
<div>You have most of the projection system here:</div>
<div><br>
</div>
<div><a moz-do-not-send="true"
href="http://www.remotesensing.org/geotiff/proj_list/">http://www.remotesensing.org/geotiff/proj_list/</a></div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div>
<div>Le 10 sept. 2010 à 22:36, Manuel Spínola a écrit :</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div> Dear list members,<br>
<br>
How do I import data in geographical coordinates to R?<br>
<br>
ref1 ref2<br>
N10 41 08.7 W84 10 46.3<br>
N10 41 06.8 W84 10 46.4<br>
N10 41 06.4 W84 10 44.6<br>
N10 41 05.6 W84 10 46.0<br>
<br>
Best,<br>
<br>
Manuel<br>
<br>
-- <br>
Manuel Spínola, Ph.D.<br>
Instituto Internacional en Conservación y Manejo de Vida
Silvestre<br>
Universidad Nacional<br>
Apartado 1350-3000<br>
Heredia<br>
COSTA RICA<br>
<a moz-do-not-send="true" href="mailto:mspinola@una.ac.cr">mspinola@una.ac.cr</a><br>
<a class="moz-txt-link-abbreviated" href="mailto:mspinola10@gmail.com">mspinola10@gmail.com</a><br>
Teléfono: (506) 2277-3598<br>
Fax: (506) 2237-7036<br>
<br>
_______________________________________________<br>
Biomod-commits mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Biomod-commits@lists.r-forge.r-project.org">Biomod-commits@lists.r-forge.r-project.org</a><br>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits</a><br>
</div>
</blockquote>
</div>
<br>
<div>
<div style="word-wrap: break-word;">
<div style="word-wrap: break-word;">
<div><span class="Apple-style-span" style="font-size: 12px;">
<div>--------------------------</div>
<div>Dr. Wilfried Thuiller</div>
<div>Laboratoire d'Ecologie Alpine, UMR CNRS 5553</div>
<div>Université Joseph Fourier</div>
<div>BP53, 38041 Grenoble cedex 9, France</div>
<div>tel: +33 (0)4 76 51 44 97</div>
<div>fax: +33 (0)4 76 51 42 79</div>
<div><br>
</div>
<div>Email: <a moz-do-not-send="true"
href="mailto:wilfried.thuiller@ujf-grenoble.fr">wilfried.thuiller@ujf-grenoble.fr</a><br>
Home page: <a moz-do-not-send="true"
href="http://www.will.chez-alice.fr/">http://www.will.chez-alice.fr</a><br>
Website: <a moz-do-not-send="true"
href="http://www-leca.ujf-grenoble.fr/equipes/tde.htm">http://www-leca.ujf-grenoble.fr/equipes/tde.htm</a><br>
<br>
FP6 European MACIS project: <a moz-do-not-send="true"
href="http://www.macis-project.net/">http://www.macis-project.net</a><br>
FP6 European EcoChange project: <a
moz-do-not-send="true"
href="http://www.ecochange-project.eu/">http://www.ecochange-project.eu</a></div>
<div><br>
</div>
</span></div>
</div>
<br class="Apple-interchange-newline">
</div>
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
</div>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
<a class="moz-txt-link-abbreviated" href="mailto:mspinola@una.ac.cr">mspinola@una.ac.cr</a>
<a class="moz-txt-link-abbreviated" href="mailto:mspinola10@gmail.com">mspinola10@gmail.com</a>
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036</pre>
</body>
</html>