<div dir="ltr"><div>Hello,</div><div><br></div><div>I&#39;m trying to set attributes to an r object using interop.  For some attributes everything works fine and for others the attribute is not set.</div><div><br></div><div>Here what I&#39;m trying in R:<br></div><div><br></div><div>R.eval(&lt;&lt;-R)<br>  vect = c(1, 2, 3, 4, 5, 6);<br>  names(vect) = c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;, &quot;f&quot;);<br>  print(vect);<br>  dim(vect) = c(3, 2);<br>  print(vect)<br>R<br></div><div><br></div><div>The first print show the names set:</div><div><br></div><div>a b c d e f <br>1 2 3 4 5 6 </div><div><br></div><div>and the second print shows the dimension change.  Changing the &quot;dim&quot;</div><div>attribute erases the names attribute:<br></div><div>     [,1] [,2]<br>[1,]    1    4<br>[2,]    2    5<br>[3,]    3    6<br></div><div><br></div><div>Now, doing this using interop:</div><div><br></div><div># pp to allow printing: already reported bug<br></div><div>pp = Polyglot.eval(&quot;R&quot;, &quot;function(x) print(x)&quot;)</div><div><br></div><div>vec = Polyglot.eval(&quot;R&quot;, &quot;c&quot;).call(1, 2, 3, 4, 5, 6)<br>nams = Polyglot.eval(&quot;R&quot;, &quot;c&quot;).call(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;, &quot;f&quot;)<br>Polyglot.eval(&quot;R&quot;, &quot;`names&lt;-`&quot;).call(vec, nams)<br>pp.call(vec)<br></div><div><br></div><div>this prints as expected the vector with the names attribute:</div><div><br></div><div>a b c d e f <br>1 2 3 4 5 6 <br></div><div><br></div><div>dims = Polyglot.eval(&quot;R&quot;, &quot;c&quot;).call(3, 2)</div><div>Polyglot.eval(&quot;R&quot;, &quot;`dim&lt;-`&quot;).call(vec, dims)<br>pp.call(vec)<br></div><div><br></div><div>a b c d e f <br>1 2 3 4 5 6 <br></div><div><br></div><div>method dim&lt;- does not seem to  have worked.  There is no error message or anything after calling `dim&lt;-`<br></div><div><br></div><div>Is this a bug or did I do something wrong here?  Its strange that some attributes work and others don&#39;t.</div><div><br></div><div><br></div><div><br></div><div><br>-- <br><div dir="ltr" class="gmail_signature">Rodrigo Botafogo<br><br></div></div></div>