Visualizations in R
R
How to Create a Correlation Heatmap in R (With Example)
You can use the following basic syntax to create a correlation heatmap in R:
#calculate correlation between each pairwise combination of variables
cor_df #melt the data...
R
How to Perform Linear Regression with Categorical Variables in R
Linear regression is a method we can use to quantify the relationship between one or more predictor variables and a response variable.
Often you may...
R
How to Plot a Subset of a Data Frame in R
You can use the following methods to plot a subset of a data frame in R:
Method 1: Plot Subset of Data Frame Based on...
R
How to Draw Boxplots with Mean Values in R (With Examples)
You can use the following methods to draw a boxplot with a mean value in R:
Method 1: Use Base R
#create boxplots
boxplot(df$values~df$group)
#calculate mean value by...
R
How to Change Legend Size in Base R Plot (With Examples)
The easiest way to change the size of a legend in a base R plot is to use the cex argument:
legend('topright', legend=c('A', 'B'), col=1:2,...
R
How to Use Bold Font in R (With Examples)
You can use the following basic syntax to produce bold font in R plots:
substitute(paste(bold('this text is bold')))
The following examples show how to use this...
R
How to Create a Scatterplot Matrix in R (2 Examples)
A scatterplot matrix is a matrix of scatterplots that lets you understand the pairwise relationship between different variables in a dataset.
There are two common...
Subscribe
- Never miss a story with notifications
- Gain full access to our premium content
- Browse free from up to 5 devices at once
Must read