R Programming

Creating a random sequence using sample() in R

It is not uncommon to generate random sequences in R programming. sample() function provides the feasibility of generating such random…

1 year ago

Estimating simple linear regression model using lm() in R

Linear regression is widely used to model the relationship between response or dependent variable and explanatory or independent variables. The…

1 year ago

Calculating partial correlations with R

When we do data analysis, random variables in the dataset are usually mutually correlated. Sometimes, we may want to measure…

2 years ago

Calculate point-biserial and biserial correlations using R

When a correlation, usually Person type correlation, is calculated, two variables have to be continuous. But this requirement does not…

2 years ago

Use spread() of dplyr in R to convert long-form dataset into wide-form

dplyr is a package that belongs to tidyverse framework. dplyr allows usage of pipeline structure (%>%), which can chain multiple…

2 years ago

Creating data frames using read.table() and read.csv() in R

R language provides several useful functions for importing delimited files and creating data frames. These delimited files are often stored…

2 years ago

How to create factor variables in R programming

Categorical variables, including nominal and ordinal variables in R programming language are called factor variables. For example, gender(male/female) is nominal,…

2 years ago

Getting started working with R programming language

When R software and RStudio program have been installed on your computer, R working session can be simply started by…

2 years ago

Creating and indexing a list in R

list is a type of data structure in R programming language. Unlike other data structures, especially matrix and vector, in…

2 years ago

Violin plots with ggplot2 in R

Violin plot is quite similar as boxplot, in the sense that it shows the range of the data. And at…

2 years ago