Hello,
I have the following problem: I need to create a table and a graph with information about level of education for different positions of the firm for different years and regions.
I have 4 levels of education (fundinc, medioinc, superiorinc and supdout) and 3 levels of positions (support, operational and strategic).
Each level of education and each position is a column (if fundinc == 1, the others are 0, if support == 1, operational and strategic are 0).
Example:
fundinc | medioinc | superiorinc | supdout | apoio | operacional | estrategico
1 | 0 | 0 | 0 | 1 | 0 | 0
0 | 1 | 0 | 0 | 0 | 1 | 0
0 | 0 | 1 | 0 | 0 | 0 | 1
0 | 0 | 1 | 0 | 0 | 0 | 1
0 | 1 | 0 | 0 | 1 | 0 | 0
1 | 0 | 0 | 0 | 1 | 0 | 0
.
.
.
The databases are separated by year and region (date2010north-east, date2010north, ..., data2016south, date2016sul).
** Any suggestions on how to do this? I'm completely lost.
*** I want to see what level of education each post, for example, how many "fundinc", "medioinc", etc., are in the "support" position and others. I do not know which chart can present this better, maybe a common barplot.
I tried to create a function
pegaescolaridadeapoio = function (base) {
#Fundamental incompleto
a <- base[base$fundinc==1 & base$apoio==1, ]
#Medio incompleto
b <- base[base$medioinc==1 & base$apoio==1,]
#Superior incompleto
c <- base[base$superiorinc==1 & base$apoio==1,]
#superior e outros
d <- base[base$supdout==1 & base$apoio==1,]
vetor <- c(nrow(a),nrow(b),nrow(c),nrow(d))
return (vetor)
}
After that, I tried to create vectors and put them in tables, but without success.
Thank you in advance.