Dealing with missing values is a common activity while doing data cleaning and analysis. In R missing values typically represented as NA. Often you might want to remove rows containing missing values in a dataframe or a matrix. In this tutorial we will learn how to remove rows … [Read more...] about Remove rows with missing values using na.omit() in R
ls() in R: list objects/variables in your environment
Often while working in R, you might want to check your environments for all the objects you have created and available in your environment. ls() function in R lists the objects in your environment as a vector. In this tutorial, we will learn the use of ls() functions with … [Read more...] about ls() in R: list objects/variables in your environment
duplicated() function in R: Find duplicated elements in a vector or dataframe
In this tutorial, we will learn about the base R function duplicated() and how can we use duplicated() function to find if an element in a vector is duplicated or a row in a dataframe is duplicated. duplicated() function can take a vector, matrix or a dataframe as input and give … [Read more...] about duplicated() function in R: Find duplicated elements in a vector or dataframe
sample() function in R for random sampling
Often while working with some dataset, we would like to randomly select samples. sample() function in base R is one of the most useful functions to get "Random Samples and Permutations" in numerous settings. In this post we will learn how to use sample() function in multiple ways … [Read more...] about sample() function in R for random sampling
3 Useful Matrix Functions in R: matrix(), is.matrix() and as.matrix()
Matrix is on of the fundamental data structures in R. In this tutorial, we will see three key matrix functions in R, matrix(), is.matrix(), and as.matrix(). These three matrix functions help us create a new matrix from scratch, verify if an object is a matrix or not and convert a … [Read more...] about 3 Useful Matrix Functions in R: matrix(), is.matrix() and as.matrix()