How to add create a box plot with categorical columns?

0 votes

How to add create a box plot with categorical columns? Hi, i want to plot a box plot to show sales over category. But i am getting below error.

Is there a way to show box plot for categorical variables(fields)? 

Jul 3, 2019 in Data Analytics by nikita
128 views

1 answer to this question.

0 votes
One way is to convert to factor and use it as integer vs the other categorical column.

Use code like below -

boxplot(as.integer(as.factor(read_data$Class))~read_data$Age,ylab = "Class",xlab = "Age")
answered Jul 4, 2019 by anonymous
• 32,440 points

Related Questions In Data Analytics

0 votes
1 answer

How to create a box-plot using “plotly” in R?

You can use this command to create ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,710 points
1,833 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,710 points
763 views
0 votes
0 answers
0 votes
1 answer

With the help of tidyverse: how to rename a column to a variable name

With the help of Dplyr: rename function ...READ MORE

answered Apr 3, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Apr 3, 2018 by DeepCoder786 64 views
0 votes
3 answers

Code snippet to find number of null values in each column in a dataframe in R

colSums(is.na(data_frame_name)) will return you number of nulls ...READ MORE

answered Jul 5, 2019 in Data Analytics by sindhu
1,067 views
0 votes
1 answer

% of nulls for each column in the dataset - R

Use code as below -  lapply(air,function(x) { length(which(is. ...READ MORE

answered Jul 4, 2019 in Data Analytics by anonymous
• 32,440 points
61 views
0 votes
0 answers

How to add color legend for box plots in R?

How to add color legend for box ...READ MORE

Jul 3, 2019 in Data Analytics by keerthi
91 views
0 votes
0 answers
0 votes
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 32,440 points
235 views
0 votes
2 answers

How to count the number of elements with the values in a vector?

Use dplyr function group_by(). > n = as.data.frame(num) > ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 32,440 points
182 views