How to add create a box plot with categorical columns

+1 vote

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 4, 2019 in Data Analytics by nikita
1,752 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
• 33,030 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,740 points
7,205 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,740 points
2,321 views
0 votes
0 answers
0 votes
1 answer

How to create a pirate plot in R?

Hi@akhtar, A pirate plot a plot contained in ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,440 points
1,344 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
16,990 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
• 33,030 points
892 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 4, 2019 in Data Analytics by keerthi
1,416 views
+1 vote
0 answers
+1 vote
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
• 33,030 points
1,446 views
+1 vote
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
• 33,030 points
4,585 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP