/usr/lib/R/site-library/dplyr/include/dplyr/RowwiseDataFrame.h is in r-cran-dplyr 0.7.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | #ifndef dplyr_tools_RowwiseDataFrame_H
#define dplyr_tools_RowwiseDataFrame_H
#include <tools/SlicingIndex.h>
#include <dplyr/Result/RowwiseSubset.h>
#include <tools/SymbolString.h>
namespace dplyr {
class RowwiseDataFrame;
class RowwiseDataFrameIndexIterator {
public:
RowwiseDataFrameIndexIterator() : i(0) {}
RowwiseDataFrameIndexIterator& operator++() {
++i;
return *this;
}
RowwiseSlicingIndex operator*() const {
return RowwiseSlicingIndex(i);
}
int i;
};
class RowwiseDataFrame {
public:
typedef RowwiseDataFrameIndexIterator group_iterator;
typedef RowwiseSlicingIndex slicing_index;
typedef RowwiseSubset subset;
RowwiseDataFrame(SEXP x):
data_(x),
group_sizes()
{
group_sizes = rep(1, data_.nrows());
}
group_iterator group_begin() const {
return RowwiseDataFrameIndexIterator();
}
DataFrame& data() {
return data_;
}
const DataFrame& data() const {
return data_;
}
inline int ngroups() const {
return group_sizes.size();
}
inline int nvars() const {
return 0;
}
inline SymbolString symbol(int) {
stop("Rowwise data frames don't have grouping variables");
}
inline SEXP label(int) {
return R_NilValue;
}
inline int nrows() const {
return data_.nrows();
}
inline int max_group_size() const {
return 1;
}
inline subset* create_subset(SEXP x) const {
return rowwise_subset(x);
}
private:
DataFrame data_;
IntegerVector group_sizes;
};
}
namespace Rcpp {
using namespace dplyr;
template <>
inline bool is<RowwiseDataFrame>(SEXP x) {
return Rf_inherits(x, "rowwise_df");
}
}
#endif
|