Hi I am getting an error "__result was not declared in this scope". There is no variable "result" any more. "outResult" was named "result" before. But renamed.
I did cut down the code. It makes no sense but is simple now and I get the error.
Are there any temporary files which I could delete?
Thanks in advance
#include <Rcpp.h>
using namespace Rcpp;
// Rf_warning
// [[Rcpp::export]]
// Function findPIPs_cpp
NumericVector findPIPs_cpp(NumericVector x, NumericVector y) {
IntegerVector PIPs(x.size());
IntegerVector outResult(x.size());
NumericVector PIPLine(x.size()); // Interpolated Values
outResult[0] = 0;
outResult[1] = y.size()-1;
int i = 0;
int n = 1;
// sort the existing PIPs
PIPs = outResult[outResult > 0];
std::sort(PIPs.begin(), PIPs.end());
// first point of the interpolated line
PIPLine[0] = y[PIPs[0]];
PIPLine[n] = margin * (x[PIPs[i]]-x[PIPs[i+1]]) + y[PIPs[i]];
return PIPLine;
}
tooke me some time to figure it out. It is the line between
and the function name which is the problem. After removing the comment it runs
So for others - DO NOT COMMENT there. Still would be fine to know why. ;)
Thanks and best regards.