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 Omit NA in RThis tutorial demonstrates how to remove unnecessary NA values using na.omit() in R. How to Inverse a Matrix in RThis tutorial demonstrates how to find the inverse of a matrix in R. How to Increase the Memory for R ProcessesThis tutorial demonstrates how to increase memory in R. How to Create Combinations and Permutations of Vectors in RThis article demonstrates how to use R to make vector combinations and permutations, as well as how to count the amount of combinations and permutations. It demonstrates one method for dealing with identical items in vectors when the output requires unique combinations and permutations. How to Test Hypothesis in RThis article shows how to test hypotheses about sample statistics in R. It illustrates the syntax of the tests using different options of the t test and the Wilcoxon test as examples. It also shows how the user can discover many other test functions that are built into base R. How to Perform Normal Distribution in RThis tutorial demonstrates how to perform and plot normal distribution in R. How to Perform Lasso Regression in RThis tutorial demonstrates how to perform lasso regression in R. How to Create a 3D Perspective Plot in RThis article shows using persp() function in R to create 3D perspective plots of a surface over the xy plane in R. It first explains the format of the arguments of the function and then illustrates the same with simple examples. How to Delete Multiple Columns in RThis tutorial demonstrates how to delete multiple columns in R. How to Use the %*% Operator in RWith simple examples, this article illustrates how to use the %*% operator in R to multiply two conformable matrices or to get the dot product of vectors of equal length. How to Perform Piecewise Regression in R This tutorial demonstrates how to perform piecewise regression in R. How to Paste Strings Without Spaces in RUsing strings, vectors and a data frame for demonstration, this article shows how to remove spaces that are added when merging/concatenating strings, how to remove leading and trailing spaces from strings, and how to remove all spaces from a string. How to Filter a Data Frame With Multiple Conditions in RThis article shows how to filter the rows of a data frame using multiple conditions. It shows how to combine multiple conditions using Boolean operators, and how to control the order of evaluation using parentheses. How to Create a Random Matrix With Constant Row Sums in RIn this article, we will see how to create a matrix with randomly chosen non-negative values in each row such that the row sum is constant for all rows. How to Use the Predict Function on a Linear Regression Model in RIn this article we will learn how to correctly use R's predict function on a linear regression model. In particular, we will see that the function expects the input to be in a specific format with specific column names. How to Include a Local Image File in an R PresentationIn this article, we will learn how to insert a local image file in an R presentation easily, and also how to align and size it using CSS. How to Identify R Object PropertiesIn this article we will look at functions that help us identify the objects that we work with in R. Using functions such as str(), class(), typeof(), is.___() and attributes(), we can gain valuable information about various properties of our R objects. How to Size Plots in Beamer Slides Made Using R MarkdownIn this article, we will see how to create plots of the desired size in a Beamer presentation PDF file created using R Markdown. We will use the R Markdown package to create the source file, and we will need a LaTeX installation to produce the PDF file. How to Locate R Script and Data Files Without Changing the Working DirectoryThis article shows how to combine an R Studio Project, the here package and the file.path() function to enable R to locate script and data files needed for the project without manually changing the working directory to the location of the current script. How to Check for Missing Values Using a Boolean Operator in RThis article shows why we may get the missing value where TRUE/FALSE needed error when using a Boolean condition in R, and then shows what we need to do to avoid that error. $ Operator Is Invalid for Atomic Vectors Error in RIn this article we will learn how to extract elements of a vector using the extract operators or the getElement function. In particular, we will also see why the $ operator does not work on vectors, and will learn how to use that by converting the vector to a data frame. R Cannot Allocate Vector of SizeThis tutorial demonstrates the error r cannot allocate vector of size. The table() Function in RThis tutorial demonstrates how to use the table() function in R. Contingency Table in RThis article shows how to create a contingency table in R.