Practical solutions

R Howtos How-To Guides

Solve the problem. Keep building. Collection of R how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Change Point Size in Graphs in RThis tutorial introduces how to change the size and shape of points in graphs in R. How to Replace NA With Zero in RIn this article, you will learn about two methods to replace NA values in a data frame with zero values. One of them uses the Base R subset reassigns, while the other is included in the dplyr package and runs up to 30% faster. How to Clear Memory in RIn this tutorial, you will learn how to clear memory taken by the R system without having to restart it or to restart the computer where it runs. How to Visualize Confusion Matrix Using Caret Package in RThis article introduces how to visualize confusion matrix using caret package in R How to Normalize the Values in Matrix RThis article demonstrates how to add a line to normalize the values in matrix R How to Merge Two Data Frames With Different Number of Rows in RThis article introduces how to merge two data frames with different number of rows in R How to Find Maximum Absolute Values by Row in Data Frame in RThis article demonstrates how to find maximum absolute values by row in data frame in R How to Add Transparent Rectangle to Boxplot in RThis article introduces how to add tranparent rectangle to a boxplot in R How to Add a Line to a Plot With the Lines() Function in RThis article demonstrates how to add a line to a plot with the lines() function in R How to Use grepl to Find Matches for Any Character String in the R Character VectorThis article demonstrates how to use grepl find matches for any character string in the R character vector. How to Split Column Into Two Columns in RThis article demonstrates how to split a column into two columns using the separate function in R How to Remove Duplicate Rows by Column in RThis article demonstrates how to remove duplicate rows by column in R How to Draw Legend Items With Different Colors in RThis article introduces how to draw legend items with different colors in R How to Create Side by Side Boxplots in RThis article introduces how to create side by side boxplots in R How to Create Histogram With ggplot in RThis article introduces how to create a histogram with ggplot in R How to Create Grouped Boxplots in RThis article introduces how to create grouped boxplots in R How to Create Custom Legend With ggplot in RThis article introduces how to create custom legend with ggplot in R How to Remove the First Character From a String in RThis article demonstrates three techniques to remove the first character from a string or a vector of strings. It demonstrates the use of the substr function, the sub-function with a regular expression, and the str_sub function of the stringr package. How to Calculate the R-Squared Statistic in RThis article shows how to obtain the R-squared statistic in R from the summary of a linear regression model. It also shows how to calculate the R-squared statistic manually, both directly and by using a custom function. How to Export a Data Frame From R to Microsoft ExcelThis article shows how to export a data frame from R to Microsoft Excel using the write.csv() function and functions provided by other packages. It also addresses problems that may occur in opening CSV files. How to Stop Running R Code With the Keyboard or MouseThis article shows how to stop running R code with the keyboard or mouse. How to Drop Multiple Columns From a Data Frame Using DplyrThis article shows how to drop multiple columns from a data frame using dplyr. The example code demonstrates the use of different selection helper functions and operators to drop multiple columns with a single line of code. How to Install R Packages From SourceThis article shows how to use the install.packages() function to install R packages from source. It points out the two conditions that need to be met for the installation from source to be successful. How to Use Vectorized if Function With Multiple Conditions in RThis article shows how to use multiple conditions in the vectorized ifelse and if_else functions in creating or updating a column in a data frame. It also draws attention to the vectorized AND and OR operators.