1. rpy2
  2. rpy2
  3. rpy2
  4. Issues

Issues

Issue #412 invalid

question: how to suppress output

Nikos Skalis
created an issue

Hi,

In a Python shell, and using rpy2 when I issue the following command

In [93]: x = robjects.r.bfast(data, h=0.1, season="none", max_iter=1)
[1]
 "No seasonal model will be fitted!"

I get this non-desirable output

[1]
 "No seasonal model will be fitted!"

Is there any way to suppress this output ? I would like to wrap this call to a function and then to an api call. Thus, redirecting output to stdout is non-desirable.

Is there anything that can be done ?

My complete rpy2 script is:

from rpy2.robjects.packages import importr
import rpy2.robjects as robjects
importr("bfast")
data = robjects.FloatVector(data)
data = robjects.r.ts(data, frequency=1)
x = robjects.r.bfast(data, h=0.1, season="none", max_iter=1)
list(x[1][0][4][0])

Comments (3)

  1. Log in to comment