Creating a progress update by replacing output in the R console from C/C++
问题 Is it possible to overwrite R console output with the C/C++ print functions for R? Rcpp::sourceCpp( code = ' #include <Rcpp.h> // [[Rcpp::export]] void print_test() { for(int i = 0; i < 10; i++) { std::stringstream strs; strs << "number: " << i; std::string temp_str = strs.str(); char const* char_type = temp_str.c_str(); REprintf(char_type); } }' ) print_test() The output of this function is number: 0number: 1number: 2number: 3number: 4number: 5number: 6number: 7number: 8number: 9 but I want