/usr/lib/R/site-library/dplyr/include/dplyr/Result/VectorSliceVisitor.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 | #ifndef dplyr_Result_VectorSliceVisitor_H
#define dplyr_Result_VectorSliceVisitor_H
#include <tools/wrap_subset.h>
namespace dplyr {
template <int RTYPE>
class VectorSliceVisitor {
public:
typedef typename Rcpp::traits::storage_type<RTYPE>::type STORAGE;
VectorSliceVisitor(const Vector<RTYPE>* data_, const SlicingIndex& index_) :
data(*data_),
n(index_.size()),
index(index_)
{}
inline STORAGE operator[](int i) const {
return data[index[i]];
}
inline int size() const {
return n;
}
inline operator SEXP() const {
return wrap_subset<RTYPE>(data, index);
}
private:
const Vector<RTYPE>& data;
int n;
const SlicingIndex& index;
};
}
#endif
|