Category: R
How to filter by data frame row number in R
RStudio data viewer is a great tool to look into data, but sometimes it is necessary to filter by data frame row number in R. By importing files, you might get a warning from parsing with a specified row number, and it might be necessary to do further investigation.
How to extract the pattern of numbers from text in R
Here is how to extract phone numbers, ids, or any other pattern of numbers from text in R. With the help of regex, it is possible to do this seemingly complicated task easily.
dplyr: Adding missing grouping variable
The dplyr message about adding missing grouping variable might appear during a data wrangling process. In my case, when I was using function select from dplyr, the “Adding missing grouping variable” message was displayed, and an unnecessary column appeared in the result. You cannot remove this column as easily as usual.
filter in R
Here are more than 5 examples of how to apply a filter in R to take a look or get a subset of your data. Depending on your goals solution might differ.
find and change where R packages are installed
Here is how to quickly find out where R packages are installed. You can change the location where R packages are stored or loaded if necessary.
How to add a column to the R data frame
If you are new to R, one of the first questions might be how to add a column to the R data frame. Here are multiple scenarios that will help you to handle this task.
determine rank in R
Sometimes you have to calculate a rank in R to indicate an order by one or multiple criteria. It is done by using multiple principles and in various order. I will use dense rank that will not create gaps between ranks, and in the situation when something is identical, the ranks will also be identical.
Use data frame row as a column names in R
Here is how to use data frame row as a column names in R, or, in other words, convert the data frame row as a header in R.