[R-SIG-Finance] quantmod calling barChart from a function .. problematic

Brian G. Peterson brian at braverock.com
Sat Apr 21 11:34:48 CEST 2012


First, please don't repost.  We all got your first message, and someone
likely would have responded.

On Sat, 2012-04-21 at 02:19 -0400, slava zimine wrote:
> below is an example which shows a problem when barChart with complex  TA
>  argument is called from within a function, in this case chartingfoo()
<...>
> Rationale:   I wish to make a package  which contains some S4 Objects  and
> i would like to put charting functions inside S4 methods.

Really?  Why use S4.  They're a pain, don't work all that well, and
interfere with other code dispatch way too easily.  S3 and Reference
Classes both work better.

> The current workaround   is to  externalize  charting code in separate R
> files and requiring user to  source them at session start.

If you need to source files into an environment, you may be having
scoping issues, but these could always be worked around by not creating
naming collisions, or by scoping them explicitly using get() and
do.call()

> Any comments will be appreciated.

For you and all the other folks who keep commenting on chartSeries and
addTA and barChart and so-on, development has moved on to the new
chart_Series, add_TA, etc.  They're faster and the code is much more
manageable.  Basically no effort is going to be put into the old code by
anyone with commit access to quantmod and xts. This has been discussed
on this list before.  

Patches that are very well formed, well-demonstrated, and easy to test
and commit would likely still be accepted. However, I can count on one
hand the number of patches I've received over the last few years that
didn't need modification before committing (and one of the people who
sent *those* patches now has commit rights on the impacted packages). 

What does that mean?  It means that you should also move your energies
to the new functions.  

Regards,

     - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list