Histogram with a text column [pending]

1

I need to make a histogram. I have the following 3 columns:

  • L courses offered

  • M offered vacancies

  • N filled vacancies

Jobs offered and filled in ok, the problem is that I can not put the data in column L on the X axis. I got to use the command, but I get an error message:

hist(ESCOLA$DESCSERIE, breaks=seq(from=1, to=255), main="CURSOS", 
  xlab="DESCSERIE", ylab="MATRIC")

Error in hist.default(ESCOLA$DESCSERIE, breaks = seq(from = 1, to = 255),  : 
 'x' deve ser numérico
    
asked by anonymous 18.12.2018 / 10:09

1 answer

3

The histogram is a graph designed to visualize the distribution of numeric variables by the sample space. You can fulfill the same function with categorical information (as should be the variable L - courses offered).

Creating dummy data to use in response

library(tidyverse)
set.seed(123)

escola <- data_frame(
  curso = sample(c("Direito", "Economia", "Estatística", "Serviço Social"), 
                  size = 100, replace = TRUE)
)

To create a bar chart that helps you understand the distribution of categorical variables in the sample space with the

18.12.2018 / 11:28