Category: R
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).
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.
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.
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.
How to clear RStudio panes with code
Here is how to clear the RStudio console, environment, and plot windows (panes) individually or at the same time by using code (a combination of functions).
dplyr error in select: unused argument
An unused argument error might appear with any function (for example, dplyr), and the primal cause is a misunderstanding. If the function appears with the same name in multiple active libraries, then make sure which of them you are using. If you are not using from the library what you think you are using, then…
How to run R script from another R script and use as a source
Here is a solution with running R script from another R script and using as a source. It comes handy when R script uses different bit version R, or you want to continue script execution with another one.
How to create group index with Power Query or R
It is possible to generate a group index (unique row ids) by one or many groups in Power Query. It comes handy when you have to detect the first or last record in each group. Here is 2 solutions: group index with M language and group index with R.