Articles by R-SquareD

Pipe Dream

December 7, 2016 | R-SquareD

Plusses and Arrows and Percents, oh my!. - Do you continually substitute “%__%” for “+” when switching between data wrangling and data visualization? I’ve got just the solution for you! Count myself as one of those ...
[Read more...]

The End of the Line

October 5, 2016 | R-SquareD

Adding labels to the end of lines indicating the last value - Often, the value of the last data point in price series data is important to the viewer. Adding these yourself is always clumsy. I considered creating my own geom to...
[Read more...]

Lightweight Timer Using a Closure

September 29, 2016 | R-SquareD

Your very own swiss chronograph - I am always looking for a way to speed up processing in R before giving up and porting to C++. To find bottlenecks, I used to put timing variables all over code with print statements. When I di...
[Read more...]

Scatterplot Me

September 28, 2016 | R-SquareD

Plot the data within a png for fun - Just for fun, I took my avatar image and plotted the png data into a scatterplot. It was relatively easy to do using the png package. library(dplyr) library(tidyr) library(ggplot2) library(...
[Read more...]

I Hate You paste!

September 25, 2016 | R-SquareD

Don't call me anymore. - I really don’t hate the paste function, it is actually quite useful when working with vectors. I just hate using it for simple string concatenation. var = 4.345 paste0("The value is: ", var) ## [1] "...
[Read more...]

Date Wrangling with dplyr and lubridate

September 23, 2016 | R-SquareD

Converting data.frames to different periods - When I’m working with financial time series data, I usually use xts objects. I convert the data to a data.frame when I’m ready to plot. Sometimes, I find that I want to adjust the ... [Read more...]

It’s Time!

September 14, 2016 | R-SquareD

...to ggplot some xts objects. - The xts package is fantastic for time-series data manipulation. You can easily convert to and apply functions to different frequencies, merge with other time series vertically and horizontally, and...
[Read more...]

Breaking the Ellipsis

September 6, 2016 | R-SquareD

Dot Dot Dot - I have often found instances where I want to pass a list to a function that accepts multiple items though an ellipsis. If you pass the list, the function considers that one item. Lists are handy structures to use ...
[Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)