Publications by John Mount

Timing the Same Algorithm in R, Python, and C++

06.01.2019

While developing the RcppDynProg R package I took a little extra time to port the core algorithm from C++ to both R and Python. This means I can time the exact same algorithm implemented nearly identically in each of these three languages. So I can extract some comparative “apples to apples” timings. Please read on for a summary of the res...

1821 sym 4 img 2 tbl

A Beautiful 2 by 2 Matrix Identity

08.01.2019

While working on a variation of the RcppDynProg algorithm we derived the following beautiful identity of 2 by 2 real matrices: The superscript “top” denoting the transpose operation, the ||.||^2_2 denoting sum of squares norm, and the single |.| denoting determinant. This is derived from one of the check equations for the Moore–Penrose in...

834 sym 2 img

R Tip: Use seqi() For Indexes

11.01.2019

R Tip: use seqi() for indexing. R‘s “1:0 trap” is a mal-feature that confuses newcomers and is a reliable source of bugs. This note will show how to use seqi() to write more reliable code and document intent. The issue is, contrary to expectations (formed in working with other programming languages) the sequence 1:0 is not empty. It is i...

2766 sym R (483 sym/3 pcs)

Practical Data Science with R, 2nd Edition discount!

12.01.2019

Please help share our news and this discount. The second edition of our best-selling book Practical Data Science with R2, Zumel, Mount is featured as deal of the day at Manning. The second edition isn’t finished yet, but chapters 1 through 4 are available in the Manning Early Access Program (MEAP), and we have finished chapters 5 and 6 which a...

1171 sym 2 img

R Tip: Use Inline Operators For Legibility

14.01.2019

R Tip: use inline operators for legibility. A Python feature I miss when working in R is the convenience of Python‘s inline + operator. In Python, + does the right thing for some built in data types: It concatenates lists: [1,2] + [3] is [1, 2, 3]. It concatenates strings: 'a' + 'b' is 'ab'. And, of course, it adds numbers: 1 + 2 is 3. The i...

3917 sym

Make Teaching R Quasi-Quotation Easier

17.01.2019

To make teaching R quasi-quotation easier it would be nice if R string-interpolation and quasi-quotation both used the same notation. They are related concepts. So some commonality of notation would actually be clarifying, and help teach the concepts. We will define both of the above terms, and demonstrate the relation between the two concepts. ...

2433 sym R (683 sym/8 pcs) 4 img

Fully General Record Transforms with cdata

20.01.2019

One of the design goals of the cdata R package is that very powerful and arbitrary record transforms should be convenient and take only one or two steps. In fact it is the goal to take just about any record shape to any other in two steps: first convert to row-records, then re-block the data into arbitrary record shapes (please see here and here ...

2948 sym R (1578 sym/7 pcs) 4 tbl

Function Objects and Pipelines in R

03.02.2019

Composing functions and sequencing operations are core programming concepts. Some notable realizations of sequencing or pipelining operations include: Unix’s |-pipe CMS Pipelines. F#‘s forward pipe operator |>. Haskel’s Data.Function & operator. The R magrittr forward pipe. Scikit-learn‘s sklearn.pipeline.Pipeline. The idea is: many imp...

5826 sym R (2438 sym/35 pcs)

cdata Control Table Keys

11.02.2019

In our cdata R package and training materials we emphasize the record-oriented thinking and how to design a transform control table. We now have an additional exciting new feature: control table keys. The user can now control which columns of a cdata control table are the keys, including now using composite keys (that is keys that are spread acro...

3020 sym R (1310 sym/5 pcs) 4 tbl

PDSwR2 Free Excerpt and New Discount Code

14.02.2019

Manning has a new discount code and a free excerpt of our book Practical Data Science with R, 2nd Edition: here. This section is elementary, but things really pick up speed as later on (also available in a paid preview). Related To leave a comment for the author, please follow the link and comment on their blog: R – Win-Vector Blog. R-blogg...

622 sym