Using strftime for Date Formatting

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…
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…
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…
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…
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…
Recently, I needed to be able to extract the number of weekdays from a date range and calculate a percentage so that accruals could be mapped to the appropriate month. I wasn’t able to find exactly what I needed to…
Excel is a fantastic tool and a workhorse of an application. Anywhere you work, it’s there! However, when you really try to get some serious analysis done, you will find that you quickly run into walls with limits on what…
When I was first learning R in a Coursera course from Johns Hopkins University, subsetting and filtering was one of the first things I learned how to do in R. Subsetting is essentially scaling down your data frame so that…
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…
One of the first things I struggled with when learning to write R code, was how to add a new column to a data frame in R. For example, we have a data frame, userdata, with the following three columns…