Nizamuddin Siddiqui has Published 2303 Articles

How to find the date after a number of days in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:39:44

182 Views

In our daily life, often we want to know what will be date after some number of days. This is also required in professional life, especially in those professions where we work on projects and have tight deadlines. To find the date after a number a certain number of days ... Read More

How to create a plot in R with a different plot window size using plot function?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:35:55

12K+ Views

We can create plots in R with having different plot window sizes. This will be helpful when we want to express X-axis or Y-axis differently. Also, the change in the size of the plot window will help us to paste the plot in places that are short or large. For ... Read More

How to subset rows that do not contain NA and blank in one of the columns in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:33:23

5K+ Views

It is possible that we get data sets where a column contains NA as well as blank, therefore, it becomes necessary to deal with these values. One of the ways to deal with these values is selecting the rows where we do not have them. This can be done by ... Read More

How to convert a list to matrix in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:28:01

12K+ Views

If we have a list that contain vectors having even number of elements in total then we can create a matrix of those elements. example, if a list contain 8 vectors and the total number of elements in those 8 vectors is 100 or any other multiple of 2 then ... Read More

How to import csv file data from Github in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:16:39

2K+ Views

If you have a csv file on Github then it can be directly imported in R by using its URL but make sure that you click on Raw option on Github page where the data is stored. Many people do not click on Raw option therefore they read HTML instead ... Read More

How to change the automatic sorting of X-axis of a bar plot using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:11:47

1K+ Views

If there is a category for which the frequency is significantly different from others then the X-axis labels of the bar plot using ggplot2 are automatically sorted to present the values alternatively. We might want to keep the original sequence of categories that is available in the categorical variable. Therefore, ... Read More

How to create a vector with dates between two dates in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:08:01

2K+ Views

Create a vector with dates is not an easy task but with help of seq and as.Date it becomes easy in R. With the help of these functions we can create a vector in R that contain dates between two dates. But this cannot be done in reverse order, for ... Read More

How to convert row index number or row index name of an R data frame to a vector?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:05:34

518 Views

We might want to extract row index irrespective of its type (whether numeric or string) to do some calculations if it is incorrectly set as a row index. It happens during the data collection process or incorrect processing of data. Also, since row indexes are helpful to access row we ... Read More

How to create a scatterplot in R using ggplot2 with transparency of points?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 13:00:03

340 Views

A scatterplot is used to observe the relationship between two continuous variables. If the sample size is large then the points on the plot lie on each other and does not look appealing. Also, the interpretation of such type of scatterplots is not an easy task, therefore, we can increase ... Read More

How to find the mean of each variable using dplyr by factor variable with ignoring the NA values in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Aug-2020 12:56:27

439 Views

If there are NA’s in our data set for multiple values of numerical variables with the grouping variable then using na.rm = FALSE needs to be performed multiple times to find the mean or any other statistic for each of the variables with the mean function. But we can do ... Read More

Advertisements