The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Who works at ALEPE?

This vignette explores the composition of the Assembly’s workforce with three endpoints: alepe_staff(), alepe_positions(), and alepe_departments().

library(alepe)
library(dplyr)
library(ggplot2)

Permanent vs. commissioned staff

staff <- alepe_staff()

staff |>
  count(vinculo, sort = TRUE)

Admission dates are parsed to Date, so the hiring history of the current roster is easy to chart:

staff |>
  mutate(ano_admissao = as.integer(format(data_admissao, "%Y"))) |>
  count(ano_admissao, vinculo) |>
  ggplot(aes(x = ano_admissao, y = n, fill = vinculo)) +
  geom_col() +
  labs(
    x = "Year of admission", y = "Staff members",
    fill = NULL,
    title = "Current ALEPE staff by year of admission"
  ) +
  theme_minimal()

The ALEPE API did not return the staff roster while this page was being built, so the chart is omitted. Run the code above yourself for current data.

Largest departments

departments <- alepe_departments()
departments |>
  summarise(total = sum(total), .by = nome_lotacao) |>
  slice_max(total, n = 15) |>
  ggplot(aes(x = reorder(nome_lotacao, total), y = total)) +
  geom_col(fill = "#41ab5d") +
  coord_flip() +
  labs(
    x = NULL, y = "Staff members",
    title = "Fifteen largest ALEPE departments"
  ) +
  theme_minimal()

The ALEPE API did not return departments while this page was being built, so the chart is omitted. Run the code above yourself for current data.

Position structure

Career positions in the roster encode class and level in a single string ("ANALISTA LEGISLATIVO > CLASSE 1 > NÍVEL 10"); a quick split reveals the career ladder:

positions <- alepe_positions(status = "permanent")

positions |>
  tidyr::separate_wider_delim(
    cargo_nivel,
    delim = " > ",
    names = c("career", "class", "level"),
    too_few = "align_start"
  ) |>
  count(career, wt = total, sort = TRUE)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.