How to transpose data frame in R
Here are multiple scenarios of how to transpose data frame in R. Not the most frequently used transformation, but might be necessary, especially if you are getting your data from Excel.
in
count in R, more than 10 examples
Count in R might be one of the calculations that can give a quick and useful insight into data. Sometimes it might be all that’s necessary for a simple analysis. In this post, I collected more than 10 useful and different examples of how to count values in R.
in
Add or subtract days from date or datetime in R
There are multiple ways how to add or subtract days from date in R, and here are some of them. The lubridate package is essential in these tasks. It has multiple functions that help do deal with even more difficult situations. You can easily calculate the first or last days of the month or age…
in
Return matching patterns in R
Imagine that you are looking for multiple text patterns in a data frame column that contains the text. The question is which of the matching patterns in R are detected in text. There might be multiple different matches, or something is matching multiple times. Which of the patterns is used to filter records? Which one…
in
Detect strings that start or end with in R
Here is how to detect strings that start or end with certain parameters in R. You can do that by using grepl and a little bit of regex or package stringr. In this case, function grepl is a better choice than grep because it returns a logical vector that is useful to detect and filter…
in
7 tips on how to speed up filtering in Excel
In large Excel spreadsheets, auto filters might work slowly and periodically crash. Here are 7 tips on how to speed up filtering in Excel and sometimes work with filters in general. When you have multiple filtering criteria or complex calculations that are involved typical Excel auto filter usage, it is not the best tool for…
in
How to quickly drop columns in R in data frame
Here are multiple ways how to drop one or multiple columns in the R data frame. You can use R base functionality or package like dplyr, but it is not the most time-consuming operation. By knowing how to do that in different ways, you can choose a suitable approach.
in
Logarithmic transformation in R, inverse logarithmic transformation in R
Logarithmic transformation in R is one of the transformations that is typically used in time series forecasting. If your forecasting results have negative values, then log transformation of the target value will prevent from going below zero. In other words, logarithmic transformation stabilizes the variance of the time series and ensures that predictions stay positive.
in
Calculate weighted average in Excel PivotTable in 2 ways
Here are a few methods on how to calculate the weighted average in Excel PivotTable or DAX. It is not so simple as a weighted average by using calculation in an Excel worksheet. The good news is that you can use that method to validate your results.