title: Why manipulated netCDF file in R environment produces rasters with a different resolution compared to the ones created in ArcGIS?
body: <p>I'm dealing with a netcdf4 file downloaded from the Marine Environment Monitoring Service of Copernicus and I think I miss something here...</p>
  <p>Consider my approach in the following code to extract values from the nc file. My scope is to reanalyze the data stored in the time series with a linear regression in order to get the mean SST change per day per pixel (not quite sure if I'm getting the statistic I want here! I'm open to suggestions! anyway this is not the point of my thread).</p>
  <pre><code>library(ncdf4)
  library(raster)
  nc_data &lt;- nc_open('L4_analyzed_sst_005res_25081981_31122018.nc')
  print(nc_data) #it shows metadata
  
  lon &lt;- ncvar_get(nc_data, &quot;lon&quot;)
  lat &lt;- ncvar_get(nc_data, &quot;lat&quot;, verbose = F)
  t &lt;- ncvar_get(nc_data, &quot;time&quot;)
  t1 &lt;- as.POSIXct(t, origin=&quot;1981-01-01&quot;, format=&quot;%Y-%m-%d&quot;, tz = &quot;UTC&quot;)
  
  sst.array &lt;- ncvar_get(nc_data, &quot;analysed_sst&quot;) # store the data in a 3-dimensional array (long, lat, time)
  dim(sst.array)
  
  fillvalue &lt;- ncatt_get(nc_data, &quot;analysed_sst&quot;, &quot;_FillValue&quot;)
  fillvalue
  nc_close(nc_data)
  
  sst.array[sst.array == fillvalue$value] &lt;- NA #fill the no value with NA
  
  str(sst.array)
  
  ##################################################################################################
  #1. sst change for the entire period
  #######################################################################################
  slope_matrix &lt;- matrix(nrow = length(lon), ncol = length(lat))
  for (i in 1:dim(sst.array)[1]){
    for (j in 1:dim(sst.array)[2]){
      value &lt;- sst.array[i,j,]
      if (anyNA(value)==FALSE){ #this &quot;if&quot; speed up the process because in my case the only NA are noValue
      extracted_data &lt;- data.frame(value=value, t=t1)
      extracted_data$quarter &lt;- &quot;null&quot;
      extracted_data$quarter &lt;- ifelse(substr(extracted_data$t, 6,7)==&quot;01&quot;|substr(extracted_data$t, 6,7)==&quot;02&quot;|substr(extracted_data$t, 6,7)==&quot;03&quot;, &quot;Q1&quot;, extracted_data$quarter)
      extracted_data$quarter &lt;- ifelse(substr(extracted_data$t, 6,7)==&quot;04&quot;|substr(extracted_data$t, 6,7)==&quot;05&quot;|substr(extracted_data$t, 6,7)==&quot;06&quot;, &quot;Q2&quot;, extracted_data$quarter)
      extracted_data$quarter &lt;- ifelse(substr(extracted_data$t, 6,7)==&quot;07&quot;|substr(extracted_data$t, 6,7)==&quot;08&quot;|substr(extracted_data$t, 6,7)==&quot;09&quot;, &quot;Q3&quot;, extracted_data$quarter)
      extracted_data$quarter &lt;- ifelse(substr(extracted_data$t, 6,7)==&quot;10&quot;|substr(extracted_data$t, 6,7)==&quot;11&quot;|substr(extracted_data$t, 6,7)==&quot;12&quot;, &quot;Q4&quot;, extracted_data$quarter)
      model &lt;- lm(value ~ time(t) + quarter, data = extracted_data)
      slope_matrix[i,j] &lt;- mean(predict(model) - extracted_data$value)
      }
    }
  }
  
  slope_raster &lt;- raster(t(slope_matrix), xmn=min(lon), xmx=max(lon), ymn=min(lat), ymx=max(lat), crs=CRS(&quot;+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs+ towgs84=0,0,0&quot;))
  plot(slope_raster)
  slope_raster &lt;- flip(slope_raster, direction='y')
  writeRaster(slope_raster, &quot;sst_change_1981-2018.tif&quot;, &quot;GTiff&quot;, overwrite=TRUE)
  </code></pre>
  <p>I used the nc file as an array and built a nested for loop in order to model the time series in each pixel. Then, I transformed the matrix of values into a raster, flip it to reorient it, and wrote it as a GeoTIFF for further uses.
  Now, when I open it in ArcGIS, it does not perfectly overlap with the raster created with the &quot;make netCDF raster layer&quot; tool. The raster created in R has slightly a smaller resolution (0.049 vs 0.050).</p>
  <p>Do you know what's the problem here?</p>
  <p>Thank you for the help!</p>
  <p><strong>EDIT</strong>: <a href="https://drive.google.com/file/d/1l9zR6I12kV-ncZVex-4DPoEGK6BmOgxQ/view?usp=sharing" rel="nofollow noreferrer">here</a> you can download the data.</p>