[R-SIG-Finance] How to suppress getSymbols error message

George Kumar grgkumar4 at gmail.com
Tue Dec 29 20:58:37 CET 2015


Hi Michael,

Thanks a lot for replying. This is exactly I ended up doing. I wrapped the
offending code around sink("/dev/null") and sink(). This seems to have
solved my problem for the time being.

Best Regards.
George

On Tue, Dec 29, 2015 at 9:38 AM, Michael Weylandt <
michael.weylandt at gmail.com> wrote:

> You can use a sink(NULL) (R equivalent of >/dev/null) to suppress all
> output temporarily.
>
> As far as I know, there's no simple way to just catch this one cat().
>
> On Tue, Dec 29, 2015 at 12:34 AM, George Kumar <grgkumar4 at gmail.com>
> wrote:
> > Hi all,
> >
> > I am using getSymbols to with the following options:
> >
> > setDefaults(getSymbols,src='csv')
> >
> > The problem is that when it cannot find the file locally it gives an
> error
> > message like the following:
> >
> > file  abcd.csv does not exist  in   ....skipping ..
> >
> > It is coming from the following lines of source code:
> >
> >  if(!file.exists(sym.file)) {
> >       cat("\nfile ",paste(Symbols[[i]],extension,sep='.')," does not
> exist ",
> >           "in ",dir,"....skipping\n")
> >       next
> >  }
> >
> > If would have been nice if the cat statement above was under a if
> (verbose)
> >
> > check.
> >
> > Anyway to suppress this message ? I have tried using try statement too.
> > Still no luck.
> >
> > Thanks in advance.
> > George
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-SIG-Finance at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only. If you want to post, subscribe first.
> > -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list