Код: Выделить всё
#include
using namespace Rcpp;
// Helper function to extract a row slice from a NumericMatrix
NumericVector extract_row_slice(const NumericMatrix& data, int row, int start, int end) {
if (end >= data.ncol()) end = data.ncol() - 1;
NumericVector slice(end - start + 1);
for (int i = start; i
Подробнее здесь: [url]https://stackoverflow.com/questions/78407972/fixing-compilation-errors-and-creating-an-r-function-from-rcpp-code[/url]
Мобильная версия