<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Vero,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you for your response. The only issue I have running the EOF in R is the data size.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My raster stack is a MODIS time series. <o:p></o:p></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">> stk<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">class       : RasterStack <o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">dimensions  : 2423, 2470, 5984810, 690  (nrow, ncol, ncell, nlayers)<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">resolution  : 499.9339, 499.9718  (x, y)<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">extent      : -85163.44, 1149673, 5656775, 6868207  (xmin, xmax, ymin, ymax)<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">coord. ref. : NA <o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">names       : X2001.01.01, X2001.01.09, X2001.01.17, X2001.01.25, X2001.02.02, X2001.02.10, X2001.02.18, X2001.02.26, X2001.03.06, X2001.03.14, X2001.03.22, X2001.03.30,
 X2001.04.07, X2001.04.15, X2001.04.23, ... <o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">min values  :           0,           0,           0,           0,           0,           0,           0,           0,           0,           0,           0,           0, 
          0,           0,           0, ... <o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">max values  :         100,         100,         100,         100,         100,         100,         100,         100,         100,         100,         100,         100, 
        100,         100,         100, ...<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">The size of raster stack is ~8 mb.
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">>object.size(stk)<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">8699416 bytes<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But, when I try to export it to a table, it becomes several GBs, which is too much for my desktop. (Though, my desktop has ~32 GB RAM with 8 cores)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Therefore, I am looking for the possibility of running i.pca but on transposed raster time series stack.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am motivated by the nice grasswiki on PCA which compares the i.pca outputs against the R equivalent functions.<o:p></o:p></p>
<p class="MsoNormal"><a href="https://grasswiki.osgeo.org/wiki/Principal_Components_Analysis">https://grasswiki.osgeo.org/wiki/Principal_Components_Analysis</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I would appreciate any help on this.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Shiva<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> Veronica Andreo <veroandreo@gmail.com> <br>
<b>Sent:</b> Friday, July 13, 2018 1:40 AM<br>
<b>To:</b> shiva_khanal@hotmail.com<br>
<b>Cc:</b> grass-user <grass-user@lists.osgeo.org><br>
<b>Subject:</b> Re: [GRASS-user] About Spatial PCA in GRASS<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Shiva,<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">El jue., 12 jul. 2018 a las 2:45, Shiva Khanal (<<a href="mailto:shiva_khanal@hotmail.com">shiva_khanal@hotmail.com</a>>) escribió:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="color:black">Hi,</span><span style="font-size:12.0pt;color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I am interested to run the spatial-mode PCA on raster time series. In R it is implemented as an ‘EOF’ function in spacetime Package. The function transposes the raster stack and applies ‘prcomp’ function.  I would like to know if there
 is any possible way to implement i.pca similar to this approach.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Interestingly, I found a very good tutorial on GRASS raster time series at
<a href="https://grasswiki.osgeo.org/wiki/Temporal_data_processing/GRASS_R_raster_time_series_processing" target="_blank">
https://grasswiki.osgeo.org/wiki/Temporal_data_processing/GRASS_R_raster_time_series_processing</a> This includes the example using spacetime package to read GRASS raster time series into R.<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">there's also an alternative way to export raster time series from GRASS that was not there at the moment of creating the wiki: the add-on
<a href="http://t.rast.out.xyz">t.rast.out.xyz</a> [0] that produces a table with xy coordinates and all dates in columns. You can then import that into R, transpose and run prcomp, EOF or others. Do you want it for gap-filling?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you dare to implement EOF in GRASS, please go ahead!! I will be very happy to test and provide feedback, I've been wishing for such a thing (and also DINEOF) for a while :)
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Maybe the devs can provide hints and advice on how to address it. 
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Vero<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[0] <a href="https://grass.osgeo.org/grass74/manuals/addons/t.rast.out.xyz.html">
https://grass.osgeo.org/grass74/manuals/addons/t.rast.out.xyz.html</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>