Nizamuddin Siddiqui has Published 2307 Articles

How to create plot in R with different shape of points?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 09:09:46

875 Views

In base R, the plot with different shape of points can be created by using pch argument inside the plot function. The list of pch values with shape is as written below −pch = 0 display square pch = 1 display circle pch = 2 display triangle point up pch ... Read More

How to find the frequency of repeated and unique values in a vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 09:06:43

261 Views

If we unique values in a vector in R and they are repeated then we can find the frequency of those unique values, this will help us to understand the distribution of the values in the vector. On the basis of that distribution analysis, we can proceed with the further ... Read More

How to sort a list that contains single sub-elements in decreasing order in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 09:00:48

73 Views

Just like a list can have multiple elements, the elements of the list can have multiple sub-elements and the size of those elements may vary as well hence a list with single sub-elements is also possible. If we have such type of list then we can sort that list in ... Read More

How to create histogram of all columns in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:57:46

12K+ Views

To create histogram of all columns in an R data frame, we can use hist.data.frame function of Hmisc package. For example, if we have a data frame df that contains five columns then the histogram for all the columns can be created by using a single line code as hist.data.frame(df).ExampleConsider ... Read More

How to find the frequency of NA values per row in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:52:31

392 Views

Since column represent variables, we often find missing values in the columns of a data frame but we may want to find missing values(NA) for cases as well so that we can replace them based on case characteristic instead of the distribution of the variable. In R, we can use ... Read More

How to find the maximum value for each column of a matrix in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:45:09

4K+ Views

To find the maximum value for each column of a matrix, we need to use apply function. For example, if we have a matrix M that contains 2 rows and 2 columns with values 1, 2 in the first row and 3, 4 in the second row then the maximum ... Read More

How to find the median of all columns in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:35:42

7K+ Views

The median is the value in a vector that divide the data into two equal parts. To find the median of all columns, we can use apply function. For example, if we have a data frame df that contains numerical columns then the median for all the columns can be ... Read More

How to remove a column from a data frame that contains same value in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:30:45

268 Views

If we have only one value in all of the rows of an R data frame then we might want to remove the whole column because the effect of that column will not make any sense in the data analysis objectives. Thus, instead of removing the column we can extract ... Read More

How to find the confidence interval for the predictive value using regression model in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:20:36

465 Views

The confidence interval for the predictive value using regression model can be found with the help of predict function, we just need to use interval argument for confidence and the appropriate level for that. For example, if we have a model M and the data frame for the values of ... Read More

How to remove outliers from multiple boxplots created with the help of boxplot function for columns of a data frame using single line code in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Oct-2020 08:16:08

469 Views

A data frame can have multiple numerical columns and we can create boxplot for each of the columns just by using boxplot function with data frame name but if we want to exclude outliers then outline argument can be used. For example, if we have a data frame df with ... Read More

Advertisements