Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow silent R output #1126

Closed
Closed
@DavZim

Description

@DavZim

As outlined in aSO question, when sourcing acpp-file with embedded R code, there is no option to silence the R output.

This can be seen by running:

Rcpp::sourceCode(code='#include <Rcpp.h>// [[Rcpp::export]]Rcpp::NumericVector timesTwo(Rcpp::NumericVector x) {  return x * 2;}/*** Rtimes_two <- function(x) timesTwo(x)*/')#> times_two <- function(x) timesTwo(x)

I opened this issue so we can discuss if this is needed.

I use embedded R code to define an R wrapper around a cpp function in one file, reducing the number of files needed (e.g., define a cpp function, which returns a data.frame, then call somedplyr ordata.table code on the data.frame). I would like to prevent printing the R code when I callsourceCpp(), for example in some kinds of rmarkdown format.

As pointed out byMrFlick, it would require changing theAttributes.R L217 call tosource(), which could include an optionshowROutput orsilenceR or similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp