Hi,<br><br>I&#39;m fairly new to R, but finding the experience a good one.  However I am a little overwhelmed by the number of packages and not sure I am necessarily using the most appropriate ones.<br><br>Here is the background to what I am trying to achieve:  I have a CSV file which contains weather forecast data for latitude and longitude points (see attached out.csv, the data I understand is on WGS84 <a href="http://www.ready.noaa.gov/faq/geodatums.html">http://www.ready.noaa.gov/faq/geodatums.html</a>).  The sample points are at half degree intervals.  My objective is to work out what the forecast data is at any specific given latitude/longitude by interpolating data from the 0.5x0.5 degree grid.  I am doing this for a number of different time points using the following functions:<br>
<br><div style="margin-left: 40px;">library(akima)<br>library(rgdal)<br><br>gks &lt;- function(inLat,inLon,dframe,variab) {<br>    wind.grid &lt;- expand.grid(lat=inLat, lon=inLon)<br>    coordinates(wind.grid) &lt;- ~ lat+lon<br>
    proj4string(wind.grid) &lt;- CRS(&quot;+init=epsg:4326&quot;)<br>    pnt&lt;-interpp(coordinates(dframe)[,1], coordinates(dframe)[,2], z=as.data.frame(dframe)[,1], coordinates(wind.grid)[,1],coordinates(wind.grid)[,2],linear=TRUE)<br>
    return(pnt$z)<br>}<br><br>interp_gk &lt;- function(lat, lon) {<br>    wind&lt;-read.csv(file=&quot;/Users/greg/Out.csv&quot;,head=TRUE,sep=&quot;,&quot;, colClasses=c(&quot;POSIXct&quot;,&quot;numeric&quot;,&quot;numeric&quot;,&quot;numeric&quot;,&quot;numeric&quot;))<br>
    coordinates(wind)=~lat+lon<br>    proj4string(wind) &lt;- CRS(&quot;+init=epsg:4326&quot;)<br><br>    times&lt;-unique(wind$vt)<br>    columns&lt;-names(wind)[2:length(names(wind))]<br><br>    dOut&lt;-data.frame(dateTime=times[1])<br>
<br>    for (i in 1:length(times)) {<br>    dOut[i,&quot;dateTime&quot;]&lt;-times[i]<br>        for (j in 1:length(columns)) {<br>            sset&lt;-subset(wind, wind$vt==times[i], select=c(columns[j]))<br>            dOut[i,columns[j]]&lt;-gks(lat,lon,sset,columns[j])<br>
        }<br>    }<br>    dOut&lt;-cbind(dOut, mag=sqrt(dOut$ugrd_0^2+dOut$vgrd_0^2))<br>    return(dOut)<br>}<br><br></div>However, I have the following concerns:<br><ul><li>Should I really be using akima?  The documentation states it is not for use on regularly spaced grids - what are my alternatives?</li>
<li>The interp funcrtion will not work for cubic spline &quot;linear=FALSE&quot; interpolation (is it because my data is regularly gridded?).  How can I achieve cubic spline interpolation?</li><li>Is my function really using the Cordinate reference system specified?  When I comment out the CRS lines, my functions return the same values?<br>
</li></ul>Lots of questions I appreciate, but I am curious!  It seems R can achieve what I am trying to do... but I may just be missing some vital bits of information.<br><br>Thanks,<br><br>Greg<br><br>