Mac keyboard on laptop

Tag R

Using strftime for Date Formatting

photo shows an zoomed in watch face with weekday, date, and month dials.

For some reason when I’m working with dates in Ruby or R, I forget that there is a super handy method that can be used to format a date, or even a string, so that it looks completely different. Most…

Why is Rounding so Difficult?

photo with hundreds of pennies on a table with a jar.

I was today years old when I learned that the way I learned to round in school was not how everyone rounded. I was taught that the value 1.65, when rounded to one decimal point, would result in 1.7. Today…

Calculating Time Difference in R

Photo of old-school clocks with different times on the face.

Recently, I needed to calculate the time difference between two times that were exported from a system. The times in the report were formatted like “07:30:00 AM” or “04:00:00 PM”. This data in this particular data set does do not…

Two Ways to Benchmark Your R Scripts

Timex clock showing time

Sometimes you need to know how long your scripts take to process in order to make improvements or to get an idea of how long it will take to process in the future. Most times, I could care less about…

What is a Data Frame in R?

RStudio IDE showing code to create a data frame.

I use data frames nearly every time I write a script in R. I’m usually reading and storing the contents of several CSV files to process its contents. The more you work in R, the more you are likely to…