<div dir="ltr"><div style="font-family:comic sans ms,sans-serif;display:inline" class="gmail_default">Dear all,<br></div><div style="font-family:comic sans ms,sans-serif;display:inline" class="gmail_default">Greetings!<br><br></div><div style="font-family:comic sans ms,sans-serif;display:inline" class="gmail_default">I want to convert a big raster (see attached) a matrix, however, I get the error below from the script. Anybody with an Idea on what is going wrong in my script?<br></div><div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"></div><div class="gmail_default" style="font-family:comic sans ms,sans-serif"><br>###Errors at the following point in the script<br><br><pre tabindex="0" class="gmail-GCWXI2KCJKB" id="gmail-rstudio_console_output" style="font-family:"lucida console";font-size:14pt;outline:medium none;border-width:medium;border-style:none;border-color:-moz-use-text-color;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:22px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)"><span class="gmail-GCWXI2KCPKB gmail-ace_keyword" style="color:blue;white-space:pre">> </span><span class="gmail-GCWXI2KCPJB gmail-ace_keyword" style="color:blue">mat <- as.matrix(rast)
</span><span class="gmail-GCWXI2KCDKB gmail-ace_constant" style="color:rgb(197,6,11)">Error in .local(x, ...) : 'x' has no values<br><br></span></pre><pre tabindex="0" class="gmail-GCWXI2KCJKB" id="gmail-rstudio_console_output" style="font-family:"lucida console";font-size:14pt;outline:medium none;border-width:medium;border-style:none;border-color:-moz-use-text-color;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:22px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)"><span class="gmail-GCWXI2KCDKB gmail-ace_constant" style="color:rgb(197,6,11)">#####script<br></span></pre><br clear="all"></div><br><div style="font-family:comic sans ms,sans-serif" class="gmail_default">library(raster)<br>library(rgdal)<br><br>setwd('D:/Mobile_testdata')<br>image <- raster('D:/Mobile_testdata/SOSug_mean2qgis.tif')<br><br>rast <- raster(image)<br>mat <- as.matrix(rast)<br><br></div><div style="font-family:comic sans ms,sans-serif" class="gmail_default">Thanks for your help<br><br></div><div style="font-family:comic sans ms,sans-serif" class="gmail_default">Rgds John<br></div><br></div></div>