Nizamuddin Siddiqui

Nizamuddin Siddiqui

1,958 Articles Published

Articles by Nizamuddin Siddiqui

Page 59 of 196

How to remove column names from an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 12K+ Views

There are situations when we might want to remove column names such as we want to manually replace the existing column names by new names or we simply don’t want to use them if we are very much familiar with the column characteristics. To remove the columns names we can simply set them to NULL as shown in the below examples.Example1Consider the below data frame −set.seed(357) x1

Read More

How to create the random sample by defining the probabilities for each unit in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 256 Views

The random sample can be created by using sample function, this random sample gives equal chance for each unit to be selected in the sample, hence it is called simple random sample. If we want to have a sample where each unit has different chance of being selected in the sample then we need to use the argument prob as shown in the below examples.Example1x1

Read More

How to find the maximum value in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 2K+ Views

The maximum value is a part of summary statistics and we always need to understand the end limits of our data; therefore, it is highly required. If we have a data frame that contains numerical columns then the maximum value can be found by using max function and the data frame object name.Example1y1

Read More

How to change the font size of main title of boxplot in base R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 6K+ Views

The font size of the main title of boxplot can be changed by defining the font size value using par(cex.main=”size”), here size value can be changed based on our requirement. This needs to be done before creating the boxplot, otherwise, there will be no effect on the size of the main title.Examplex

Read More

How to access the table values in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 6K+ Views

Sometimes we want to extract table values, especially in cases when we have a big table. This helps us to understand the frequency for a particular item in the table. To access the table values, we can use single square brackets. For example, if we have a table called TABLE then the first element of the table can accessed by using TABLE[1].Example1x1

Read More

How to find the unique combinations of a string vector elements with a fixed size in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 1K+ Views

A unique combination of vector elements can be found by using combn function with unique function and size argument will help us to identify the size of each of combination. For example, if we have a vector containing string values defined as x then the unique combinations of vector elements of size 2 can be created by using combn(unique(x),2).Example1x1

Read More

How to sort a large number of csv files in ascending order in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 353 Views

To sort a large number of csv files in ascending order, we can use mixedsort function from gtools package. For example, if we have a list of csv files that are randomly arranged in a vector called FILES then the files can be sorted in ascending order using the command mixedsort(sort(FILES))ExampleFiles1

Read More

How to create a sequence increasing by 1 in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 393 Views

If a sequence is increasing by 1 that means for every value the total number of values increases by that much. For example, the values 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 are creating a sequence of values starting from 1 to 5. To create such type of sequences in R, we can simply use sequence function and pass the range as sequence(1:5).Examplex1

Read More

How to convert dot to comma for numerical columns in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 3K+ Views

Most European countries use a comma in place of a decimal. Therefore, if we have a data set that contains dot as a decimal market and we need to use that four such European countries or if dot is recorded in place of comma then we can replace the dot with comma using format function as shown in the below examples.Example1x2

Read More

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

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 1K+ 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 using the command scale_y_continuous(labels=dollar_format(suffix="€",prefix="")) to the plot command.Consider the below data frame −Examplex

Read More
Showing 581–590 of 1,958 articles
« Prev 1 57 58 59 60 61 196 Next »
Advertisements