[R] Yield to maturity calculation - bndyield equivalent of MATLAB in R

Marc Schwartz marc_schwartz at me.com
Wed Apr 5 19:48:38 CEST 2017


Good distinction...

For clarification, I was referring to the "whole object approach" versus an "object oriented" approach.



> On Apr 5, 2017, at 12:43 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> ... Probably need to distinguish "whole object approach" from "object
> oriented" approach. They are different and almost orthogonal in R. R
> tutorials discuss such matters, and there are many good ones on the
> Web, including the "Intro to R" tutorial that ships with R. The OP
> should spend some time with one or more to learn more about this. This
> list cannot provide such extended explanation.
> Cheers,
> Bert
> Bert Gunter
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> On Wed, Apr 5, 2017 at 10:28 AM, Marc Schwartz <marc_schwartz at me.com> wrote:
>>> On Apr 5, 2017, at 11:34 AM, Tunga Kantarcı <tungakantarci at gmail.com> wrote:
>>> Thanks a lot Marc, for informing that R is object oriented, implying
>>> that one should always try to vectorise the code (although I am not so
>>> clear why this should be the case) but also for all the references you
>>> provide.
>> Hi,
>> The reason for taking an object oriented approach using vectorized code, is that frequently, the R code that you write is internally calling compiled C code to perform the actual iterations over the object structure. Thus, being that compiled C code is much faster than interpreted R code, there is significant efficiency to be achieved by taking an object oriented approach to key operations.
>> In addition, when used, a single line of vectorized code and/or a vectorized function can replace multiple lines of code in a different language. Thus, from a coding efficiency and readability standpoint, it is far more efficient.
>> Regards,
>> Marc
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list