12#ifndef ROOT_R_TRDataFrame
13#define ROOT_R_TRDataFrame
203 Rcpp::CharacterVector names =
fDf.attr(
"names");
206 if (names[i] ==
fName.Data()) {
217 Rcpp::List nDf(
size + 1);
218 Rcpp::CharacterVector nnames(
size + 1);
219 for (i = 0; i <
size; i++) {
221 nnames[i] = names[i];
225 nDf.attr(
"class") =
fDf.attr(
"class") ;
226 nDf.attr(
"row.names") =
fDf.attr(
"row.names") ;
227 nDf.attr(
"names") = nnames ;
240 Rcpp::CharacterVector names =
fDf.attr(
"names");
243 if (names[i] ==
fName.Data()) {
251 Rcpp::List nDf(
size + 1);
252 Rcpp::CharacterVector nnames(
size + 1);
253 for (i = 0; i <
size; i++) {
254 nDf[i] = obj.
fDf[i] ;
255 nnames[i] = names[i];
260 nDf.attr(
"class") = obj.
fDf.attr(
"class") ;
261 nDf.attr(
"row.names") = obj.
fDf.attr(
"row.names") ;
262 nDf.attr(
"names") = nnames ;
293 Rcpp::CharacterVector names =
fDf.attr(
"names");
296 if (names[i] ==
fName.Data()) {
304 Rcpp::List nDf(
size + 1);
305 Rcpp::CharacterVector nnames(
size + 1);
306 for (i = 0; i <
size; i++) {
308 nnames[i] = names[i];
313 nDf.attr(
"class") =
fDf.attr(
"class") ;
314 nDf.attr(
"row.names") =
fDf.attr(
"row.names") ;
315 nDf.attr(
"names") = nnames ;
320 template <
class T>
operator T()
324 template <
class T>
operator T()
const
384 operator SEXP()
const
405 Rcpp::CharacterVector names =
df.attr(
"names");
429 if (label && !label[0]) {
std::vector< TString > TVectorString
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
#define ClassDefOverride(name, id)
Binding operator=(T var)
template method for operator assignation
Binding & operator>>(T &var)
Template method for operator >> that lets to use dataframes like streams example: df["v"]>>vector;.
Binding operator=(Binding obj)
method for operator assignation of Binding class
Binding(Rcpp::DataFrame &_df, TString name)
Construct a Binding nestead class for facilities with operators.
Binding & operator<<(T var)
Template method for operator << that lets to use dataframes like streams example: df["v"]<<vector;.
Binding(const Binding &obj)
Copy constructor for Binding nestead class.
This is a class to create DataFrames from ROOT to R.
Binding operator[](const TString &name)
Int_t GetNcols()
Method to get the number of columns.
TMatrixT< T > AsMatrix()
Method to get dataframe as matrix.
void Print(const Char_t *label="")
Method to print the dataframe in stdout or a column given the label.
TRDataFrame(SEXP obj)
TDataFrame constructor.
TRDataFrame()
Default TDataFrame constructor.
TRDataFrame & operator=(TRDataFrame obj)
Int_t GetNrows()
Method to get the number of rows.
TVectorString GetColNames()
Method to get labels of dataframe.
TRDataFrame & operator=(SEXP obj)
TRDataFrame(const Rcpp::DataFrame &_df)
TDataFrame constructor for Rcpp::DataFrame.
TRDataFrame & operator=(TRDataFrame &obj)
This is a class to pass functions from ROOT to R.
TObject()
TObject constructor.
const char * Data() const
namespace associated R package for ROOT.
const Rcpp::internal::NamedPlaceHolder & Label
SEXP wrap(const TString &s)