Nizamuddin Siddiqui has Published 2307 Articles

How to get the list of available data frames in R environment?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Feb-2021 11:42:02

2K+ Views

When we perform any type of data analysis, there are many types of objects that are created in the R environment such as vector, data frame, matrix, lists, arrays, etc. If we want to get the list of available data frames in R environment then we can use the below ... Read More

How to convert numeric columns to factor using dplyr package in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Feb-2021 11:36:42

3K+ Views

If we have a numeric column in an R data frame and the unique number of values in the column is low that means the numerical column can be treated as a factor. Therefore, we can convert numeric columns to factor. To do this using dplyr package, we can use ... Read More

How to create reverse of a number in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Feb-2021 11:32:29

2K+ Views

To create reverse of a number, we can use stri_reverse function of stringi package. For example, if we have a vector called x that contain some numbers then the reverse of these numbers will be generated by using the command stri_reverse(x). But the output will be in character form, if ... Read More

How to create combination of multiple vectors in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 11:21:59

3K+ Views

To create combination of multiple vectors, we can use expand.grid function. For example, if we have six vectors say x, y, z, a, b, and c then the combination of vectors can be created by using the command expand.grid(x, y, z, a, b, c).Example Live Demox1Read More

How to check whether a particular word exists in an R data frame column?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 11:14:09

656 Views

If we have a character column in an R data frame then we might want to check whether a particular value exist in the column or not. For example, if we have a gender column then we might want to check whether transgender exists in that column or not. This ... Read More

How to extract statistical summary from boxplot in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 11:12:07

7K+ Views

To extract statistical summary from boxplot we can use stats function with delta operator. For example, if we have a data frame called df that contains 5 columns then the boxplot for each column can be created by using the command boxplot(df) and if we want to extract the statistical ... Read More

How to extract strings that contains a particular substring in an R vector?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 11:06:39

917 Views

Suppose we have a vector that contains multiple string elements and we want to find out which string element has a particular substring. This can be done with the help of grep function. For example, if we have a vector called x that contains five string elements each of varying ... Read More

How to put space between words that start with uppercase letter in string vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 11:02:06

1K+ Views

To put space between words that start with uppercase letter in string vector in R, we can use gsub function. Since we can have uppercase letters as well as lowercase letters in the string vector hence, we need to properly specify both type of characters for creating the space between ... Read More

How to truncate a string vector after a character in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 11:00:30

922 Views

The most difficult problem in data analysis is cleaning a dirty data. Most of the times the data is available in dirty form and one such dirtiness is a string vector having unnecessary values after a particular character. Therefore, to truncate a string vector after a character we can use ... Read More

How to display Y-axis with Euro sign using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 10-Feb-2021 10:59:12

801 Views

When we have a Euro currency column in an R data frame as a response variable then we might to display the Euro sign in the plot created by using ggplot2 package. For this purpose, we can use scales package and the scale for Y axis will be changed by ... Read More

Advertisements