<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>I am helping a student build some R code in Rcpp for his first time.  He is working with 3-dimensional arrays, so I am hopeful to be working with arma::cube objects.</div>
<div> </div>
<div>When I simply try to bring the array in as an argument I can’t seem to use the same as<[TEMPLATE]> construction as other objects.</div>
<div> </div>
<div>arma::cube X=Rcpp::as<arma::cube>(arg1);</div>
<div><font face="Times New Roman"> </font></div>
<div>This line fails to compile.</div>
<div> </div>
<div>I can build this cube from an input vector using explicit nested loops.  I also notice that wrap() does a fine job of returning the array back to R.</div>
<div><font face="Times New Roman"> </font></div>
<div>Is there anything else I need to know to more simply bring the array in as an SEXP and land it in the arma::cube.</div>
<div><font face="Times New Roman"> </font></div>
</span></font>
</body>
</html>