에서이 수정 질문모호한 오버로드 연산자는 특히 Rcpp
연구에서이며, 나 또한 데이터 프레임은 두 개의 문자로 된 문자열이 포함 Row_Labels
라는이 string def;
로 Rcpp 나는 문자열, "AA"를 선언, "BB"등 지금은이 작업을 수행하려고 .. 내가 오류를 얻고있다
#include <Rcpp.h>
#include <string.h>
//using namespace Rcpp;
//using namespace std;
// [[Rcpp::export]]
Rcpp::DataFrame process_Data(Rcpp::DataFrame df,Rcpp::DataFrame Row_Labels, Rcpp::DataFrame Column_Labels){
Rcpp::Rcout << "Test value from 'cout' " << std::endl;
Rcpp::Rcout << "Number of rows in df = " << df.nrow() << std::endl;
std::string abc;
abc = "test value";
std::string def;
def = "zz";
for(int i = 0; i < Row_Labels.nrow() ; i++)
{
def = Row_Labels[i]; // error here
Rcpp::Rcout << "Row_Labels = " << i;
Rcpp::Rcout << i << " " << Row_Labels[i] << std::endl; // error here
}
return Rcpp::DataFrame::create(Rcpp::_["a"]= df);
}
... use of overload operator'=' is ambiguous (with operand types 'string' (aka 'based_string <char, char traits <char>, allocator <char> >') and 'Proxy' (aka 'generic proxy<19>'))
내가 도움을 주셔서 감사합니다이 개정 희망 더 도움이 됨
'using namespace Rcpp;를 사용하지 마십시오. using namespace std;'명시 적'::'참조를 사용하라. –
_complete 및 reproducible_ 예제를 제공하십시오. 이것은 하나가 아닙니다. –
감사합니다. 두 개의 네임 스페이스 문을 제거했습니다. 오류가 계속 발생합니다. 여기에 완전한 기능을 붙여 넣으려고했으나 오류가 발생했습니다. – K17