Thanks a lot for help. Kevin.
You are correct, both df.attr("names") and df.names() work.
Chaomei
On Thu, Jul 10, 2014 at 5:14 PM, Kevin Ushey wrote:
> df.attr("names") ? data.frames do not have a column names attribute.
> Neither do matrices, for that matter, which have an (optional) `dimn
df.attr("names") ? data.frames do not have a column names attribute.
Neither do matrices, for that matter, which have an (optional) `dimnames`
attribute.
Please see: http://gallery.rcpp.org/articles/setting-object-attributes/,
and also try looking at what e.g. `attributes(data.frame(x=1))`, for
ex
I have a R data frame pass to the Rcpp function, for example in below-
void myDataFrame(Rcpp::DataFrame df) {
}
I would need to know the column names first before I retrieve the data but
df.colnames() does not work but the df.length() and df.nrows() work.
Thanks for help !
Chaomei
_
Thanks a lot, sorry for my question, it was indeed here in front of me ...
R.
- Mail original -
De: "Dirk Eddelbuettel"
À: "Dirk Eddelbuettel"
Cc: "Robin Girard" , "rcpp-devel"
Envoyé: Jeudi 10 Juillet 2014 19:35:52
Objet: Re: [Rcpp-devel] Rational number and the BH package
Robin,
H
Robin,
Here is a quick example for using the BH package from CRAN to get rational
numbers:
R> sourceCpp("/tmp/ratEx.cpp")
R> invisible(quicktest())
Half is 1/2
Sum of two halves is 1/1
R>
where the code in /tmp/ratEx.cpp follows below. I enable C++11 merely for
convenience as R (and g++) o
On 10 July 2014 at 18:00, Robin Girard wrote:
| Dear list, I want to use the rational number class from boost
http://www.boost.org/doc/libs/1_53_0/libs/rational/rational.html
| to use it in my package (to be pushed on CRAN). Is BH cran compatible ?
Please define 'cran compatible'.
It has bee
Dear list, I want to use the rational number class from boost
http://www.boost.org/doc/libs/1_53_0/libs/rational/rational.html
to use it in my package (to be pushed on CRAN). Is BH cran compatible ? and is
it planned to add rational to the BH package ?
Thanks in advante
Regards
Robin
Dr. Gira