[Rcpp-devel] Problems with Rcout
Serguei Sokol
serguei.sokol at gmail.com
Tue Nov 27 16:51:28 CET 2018
Le 27/11/2018 à 16:35, Barth Riley a écrit :
> Dear Rcppers
>
> I am encountering a problem with Rcout. Even with basic string output,
> when I run the function containing the call to Rcout, no output is
> generated. Here is a simple example of what I’m trying to do:
>
> // [[Rcpp::export]]
>
> void testFunc() {
>
> Rcpp::Rcout << "testFunc begins" << std:endl;
>
> . . .
>
> }
>
This example works for me:
library(Rcpp)
sourceCpp(code="#include <Rcpp.h>\n// [[Rcpp::export]]\nvoid testFunc()
{\nRcpp::Rcout << \"testFunc begins\" << std::endl;\n}")
testFunc()
#testFunc begins
May be in your session you have redirected stdout elsewhere?
Serguei.
> My code is part of a package I’m developing, using R 3.51 and Rcpp
> 0.12.19. The Rcpp code compiles without a problem.
>
> Thanks
>
> Barth
>
>
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
More information about the Rcpp-devel
mailing list