Nizamuddin Siddiqui has Published 2307 Articles

How to find the name of the author of a package in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 15:01:28

316 Views

There can be multiple authors of a package in R and we might want to use their name if we are using their package in our publication for research, books, courses or any other type of content. Therefore, it is required to find out all the authors who contributed to ... Read More

How to find the variance of row elements of a matrix in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:56:49

983 Views

Finding the variance of columns is a common task in data analysis but often data is provided in wide format instead of long format, therefore, the cases are represented vertically and the variables are aligned horizontally and this data could be available in matrix or any other form. Therefore, the ... Read More

How to create a predictive linear regression line for a range of independent variable in base R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:51:13

246 Views

If we want to create a regression line inside scatterplot then lines function can be used with the linear model function lm but if we want to do it for a particular range of independent variable then this range needs to be defined and passed within the lines function. Check ... Read More

How to separate strings in R that are joined with special characters?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:49:10

114 Views

When we deal with text data it is difficult to make it clean and one of the most of basic problem with this type of data is that the values are separated with some unique characters such as special characters. For this purpose, we can use strsplit function that makes ... Read More

How to check whether a string is in lowercase or uppercase in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:46:44

3K+ Views

We can use str_detect function to check whether a single string or a vector of strings is in lowercase or uppercase. Along with str_detect function, we need to use either upper or lower to check whether the string is in lowercase or uppercase and the output will be returned in ... Read More

How to find the rank of a vector elements in R from largest to smallest?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:43:06

1K+ Views

To find the rank of a vector of elements we can use rank function directly but this will result in ranks from smallest to largest. For example, if we have a vector x that contains values 1, 2, 3 in this sequence then the rank function will return 1 2 ... Read More

How to change column names to capital letters from lower case or vice versa in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:42:39

944 Views

Mostly, we get data that contain column names in lowercase or just first letter is in upper case. If we want to convert those column names to all capital letter words or uppercase then toupper function can be used to the names of the columns. This can be done by ... Read More

How to extract odds ratio of intercept and slope coefficient from simple logistic model in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:18:22

240 Views

To create the simple logistic model, we need to use glm function with family = binomial because the dependent variable in simple logistic model or binomial logistic model has two categories, if there are more than two categories then the model is called as multinomial logistic model. If we want ... Read More

How to repeat a column of a data frame and join it with another data frame in R by rows?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 14:01:10

180 Views

Suppose we have a data frame df1 that contains 5 columns and another data frame df2 that contains only column but the data type of the columns in both the data frames is same. Now we might want to add the column of the second data frame starting at the ... Read More

How to create random values in R up to a range of values starting from 1?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 16-Oct-2020 13:56:02

137 Views

Random sampling is a technique used by almost every researcher, analyst, financial analyst, data scientist, or even a leader and if we way that almost everyone uses it at least once in a lifetime then it won’t be surprise. Because we use it in one or the way in our ... Read More

Advertisements