title: extracting data from raster file for specific coordinate and merge in R
body: <p>I have gridded data files ( each file consist of monthly rainfall and is label pYYYYMM) <a href="https://www.dropbox.com/sh/63z166tjxyu12s5/AAAs3Ccn1zdVoBYMj8Y1o303a?dl=0" rel="nofollow">https://www.dropbox.com/sh/63z166tjxyu12s5/AAAs3Ccn1zdVoBYMj8Y1o303a?dl=0</a></p>
  
  <pre><code>library(raster)
  files= list.files( ,pattern='*.grd',full.names=TRUE)
  df = NULL
  for(i in seq_along(files)) {
  r2 &lt;- raster(files[i])
  # setting the missing values to NA
  r2[r2 &gt;= 170141000918782798866653488190622531584.00] &lt;- NA_real_
  # Setting the projection
  crs(r2) &lt;- "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +datum=WGS84"
  plot(r2)
  #Doing this, got me the value for a given point but you will have to manual edit:
  d1&lt;- getValuesBlock(r2, row=42, nrows=1, col=26, ncols=1)
  # Combine data to get one dataframe 
  rbind(df,d1)-&gt;df
  # then write to a csv file
  }
  </code></pre>
  
  <p>The loop above works for me to an extent but it means that I have to manually change each point and then I will also have manually input the date.  </p>
  
  <p>I am kindly asking for some guidance on how I can modify my code to the data for the latitude and and longitude of my interest which is in this file 
  <a href="https://www.dropbox.com/s/3p4u4pyxkyo2q15/latandlong.csv?dl=0" rel="nofollow">https://www.dropbox.com/s/3p4u4pyxkyo2q15/latandlong.csv?dl=0</a></p>