How to fill down values in R data frame
There are at least two ways how to fill down values in R data frame columns. The fastest way is to use zoo package function na.locf that is combined with dplyr function mutate. Besides, sometimes in R, it is necessary to replace NA with 0. All of those things in this post.
in
How to combine numbers and find sums with R
In this post, I will explain the approach on how to combine numbers with R to find out which of them makes a certain sum. First of all, we will generate all possible number combinations from the vector or data frame column. That will give us multiple matrices. Then we will combine them in a…
in
How to add leading zeros in R, Power Query, DAX or Excel
Here are multiple examples of how to add leading zeros in different ways and places. In these examples, I will add them to number 123. As a result, I will get 5 digits (00123).
in
How to create BoxPlot in R and extract outliers
Outlier detection is a very broad topic, and boxplot is a part of that. Here is how to create a boxplot in R and extract outliers. There are few things to consider when creating a boxplot in R or anywhere else. Is boxplot showing all the necessary information? Sometimes it is important how many data…
How to restore closed unsaved script in RStudio
If you just recently closed the unsaved (untitled) source tab in RStudio, there is a good chance that you can get it back. Try to restore unsaved RStudio script in 3 different ways.
How to quickly build R data frame from scratch with Excel
If you know some of the Excel text functions, you can quickly build R data frame from scratch. Also, you should understand how to build a data frame in R, what kind of functions will be necessary.
Run Windows command line scripts by condition
In the Windows command line, it is possible to build loops that periodically execute scripts. You can see how to do that in one of my previous posts. Let’s say you want to run R script from the Windows command line but with a condition or multiple conditions. For example, run R script from the…
in
How to combine Excel sheets with Power Query
Here is a simple and easy way how to combine tables from multiple Excel sheets with Power Query in Excel or Power BI. With this approach, merging will continue even if new sheets with new tables will be created in the future.
How to unlist a nested list in R
Here is a simple tutorial on how to unlist a nested list with the help of R. Problems may appear when nested lists are a different length for each record. For example, chat sessions and corresponding lists of conversations that differ in length.
in
How to combine files with R and add filename column
Here is a simple way how to combine CSV or text files with R and, at the same time, add a column with filenames. Here is all the code with more detailed explanations below.
in