Reproducible Finance with R: Pulling and Displaying ETF Data

It’s the holiday season, and that can mean only one thing: time to build a leaflet map as an interface to country Exchange Traded Fund (ETF) data! In previous posts, we examined how to import stock data and then calculate and display the Sharpe Ratio of a portfolio. Today, we’re going to skip the calculations and focus on a nice interface for pulling and displaying data. Specifically, our end product will enable users to graph country ETF prices by clicking on those countries in an interactive map, instead of having to use the ETF ticker symbol.

Read more

Share Comments · · ·

December '16 RStudio Tips and Tricks

Here is this month’s collection of RStudio Tips and Tricks. Thank you to those who responded to last month’s post; many of your tips are included below! Be sure to subscribe to @rstudiotips on Twitter for more. This month’s tips fall into two categories: Keyboard Shortcuts and Easier R Markdown. Keyboard Shortcuts The RStudio IDE is built upon “hooks”. Hooks are actions that the IDE can take. For instance, there is a hook to create a new file.

Read more

Share Comments · · · ·

November Package Picks

November was a prolific month for R developers: 189 new packages landed in CRAN. I have selected more than a quarter of them for this post, but I haven’t listed everything that is worth a look. My November 2016 picks are organized into four categories: Biotech (4 picks), Data (6 picks), Machine Learning (9 picks) , Statistics (9 picks), Time Series (4 picks) and Utilities (20 picks). The relatively large number of Utilities packages listed seriously over-represents this category.

Read more

Share Comments ·

Writing Good R Code and Writing Well

If you are aspiring to write good R code, you may find it helpful to occasionally spend some time reading about writing: reading about writing R code, and reading about writing about R code that you’ve written. (If you write some excellent R code, you will likely have the opportunity to write about it.) For reading about writing good R code, a place to start might be one of the many R style guides available.

Read more

Share Comments ·

Missing Values, Data Science and R

One great advantages of working in R is the quantity and sophistication of the statistical functions and techniques available. For example, R’s quantile() function allows you to select one of the nine different methods for computing quantiles. Who would have thought there could be so many ways to do something that seems to be so simple? The issue here is not unnecessary complication, but rather an appreciation of the nuances associated with inference problems gained over the last hundred years of modern statistical practice.

Read more

Share Comments · · ·

Some Technical Reading

I am ever-optimistic that on the weekend I will have enough time and brainpower to do some serious technical reading. The following are five articles on my list. I hope that at least one of them resonates with you too. Happy reading. In this paper from Nature Communications, Kun-Hsing Yu et al. use machine learning to diagnose cancer. The authors write: We extract 9,879 quantitative image features and use regularized machine-learning methods to select the top features and to distinguish shorter-term survivors from longer-term survivors with stage I adenocarcinoma (P<0.

Read more

Share Comments ·

October Package Picks

In my August Package Picks post, I explained that my selection criteria favor packages with vignettes. (I find skimming through a package’s vignettes to be an effective method of “grokking” what a package is all about.) I also questioned why a person would go to all of the trouble to develop a package and put it on CRAN without writing a vignette. Since writing that post, I have had the opportunity to speak with experienced package authors who argue, with some considerable authority, that the object documentation (what you get when you type “?

Read more

Share Comments ·

Reproducible Finance with R: A Sharpe Ratio Shiny App

In this previous post, we used an R Notebook to grab the monthly return data on three stocks, build a portfolio, visualize portfolio performance, and calculate the Sharpe Ratio. The Notebook format emphasized reproducibility and reuse by other R coders. Today, we’ll convert that Notebook into a Shiny application that allows end users to build their own portfolios, and then calculate performance/Sharpe Ratio. Friday = fun day! Here is the link to the app.

Read more

Share Comments · · · · ·

Make R a Legitimate Part of Your Organization

How R Enters Through the Back Door In many organizations, R enters through the back door when analysts download the free software and install it on their local workstations. Jamie has been an avid R programmer since college. When she takes a new job at a large corporation, she finds that she is the only analyst in the company who knows and uses R. In addition to the other tools her company gives her, Jamie decides to download R onto her laptop.

Read more

Share Comments · · ·

RStudio IDE Easy Tricks You Might've Missed

The RStudio IDE reached version 1.0 this month. The IDE has come a long way since the initial release 5 and a half years ago. Many major features have been built: projects, package building tools, notebooks. During that same period, often hidden in the shadows, a growing list of smaller features has been changing lives. In celebration of version 1.0 this post hopes to spread fanfare for a few of these easy-to-miss tools.

Read more

Share Comments · · · ·