Numbers employed by industry


This plot shows the number of people employed, by industry, between 2008Q1 and 2019Q2. The source of the data is the Quarterly Labour Force Survey, conducted by Stats SA. It is designed to measure the dynamics of the South African labour market.

Click here to read about the publication.

Earnings over time


This plot shows the number of people employed, by industry, between 2004Q4 and 2019Q2. The source of the data is the Quarterly Employment Statistics, conducted by Stats SA. The survey is designed to obtain information regarding the number of employees and gross salaries paid

Click here to read about the publication.

Strikes by union


This plot shows the number of working days lost due to union action between 2014 and 2017 The source of the data is the Industrial Action Report, conducted by the Department of Labour. The report is designed to monitor strike activities and work stoppages.

Click and drag to zoom into an area of the plot. Double click to zoom out. Hover over a point to see details of the strike.

Click here to read about the publication.

Click here to read the list of registered unions

---
title: "Labour Market Indicators for Andrew Levy"
output:
  flexdashboard::flex_dashboard:
    storyboard: true
    theme: bootstrap
    social: menu
    source: embed
---


```{r global, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(shiny)
library(plotly)
library(glue)
library(readxl)
library(lubridate)
library(xts)

df <- read_excel("data/raw/employment.xlsx")

df <- df %>% 
  mutate(date = ymd(date)) %>% 
  mutate_if(is.character,as.factor)

df_strikes <- read_excel("data/raw/strikes_annual.xlsx")

theme_set(theme_light())

```


### Numbers employed by industry

```{r}

g <- df %>% 
  filter(tab == "Employment") %>% 
  filter(series == "Numbers employed by indsutry") %>%
  ggplot(aes(date, value, fill = category)) + 
  geom_col() +
  scale_y_continuous(labels = scales::comma_format()) + 
  scale_fill_brewer(palette = "Set3") +
  labs(title = "Numbers employed by indsutry",
       subtitle = "Source: Quarterly Labour Force Survey",
       x = "",
       y = "")

plotly::ggplotly(g)  

```

***

This plot shows the number of people employed, by industry, between 2008Q1 and 2019Q2. The source of the data is the Quarterly Labour Force Survey, conducted by Stats SA. It is designed to measure the dynamics of the South African labour market.

Click [here](http://www.statssa.gov.za/?page_id=1854&PPN=P0211) to read about the publication.



### Earnings over time

```{r}
library(dygraphs)

df_current <- df %>% 
  filter(tab == "Earnings",
         str_detect(series, "current")) %>% 
  select(date, value)
  
df_constant <- df %>% 
  filter(tab == "Earnings",
         str_detect(series, "constant")) %>% 
  select(date, value)  

df_current <- xts(df_current$value, df_current$date)
df_constant <- xts(df_constant$value, df_constant$date)

df_earn <- cbind(df_current, df_constant)

dygraph(df_earn, main = "Average monthly gross earnings", ylab = "Gross earnings in Rands") %>% 
  dySeries("df_current", label = "Current prices") %>%
  dySeries("df_constant", label = "Constant prices") %>%
  dyRangeSelector(dateWindow = c("2004-12-01", "2019-06-01")) %>% 
  dyOptions(colors = RColorBrewer::brewer.pal(3, "Dark2")) %>% 
  dyHighlight(highlightCircleSize = 5, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = FALSE) %>% 
   dyOptions(fillGraph = TRUE, fillAlpha = 0.4)
  
```

***

This plot shows the number of people employed, by industry, between 2004Q4 and 2019Q2. The source of the data is the Quarterly Employment Statistics, conducted by Stats SA. The survey is designed to obtain information regarding the number of employees and gross salaries paid

Click [here](http://www.statssa.gov.za/?page_id=1854&PPN=P0277) to read about the publication.


### Strikes by union

```{r}
library(DT)

# df_strikes_table <- df_strikes %>% 
#   select(-series)

# table1 <- datatable(df_strikes_table, rownames = FALSE,
#           colnames = c('Date', 'Union', 'Source', 'Working days lost per union'),
#           caption = 'Working days lost per union 2014-2017')


i <- df_strikes %>% 
  mutate(date = ymd(glue("{date}-01-01"))) %>% 
  rename(Union = category,
         Year = date,
         Lost_days = value) %>% 
  ggplot(aes(x = Year, y = Lost_days, size = Lost_days, colour = Union)) +
  geom_jitter() +
  scale_y_log10(labels = scales::comma_format()) +
  theme(legend.position = "none") +
  labs(title = "Number of working days lost per year by union due to strike activities",
       x = "Year",
       y = "Working days lost")

ggplotly(i)
  
```


***

This plot shows the number of working days lost due to union action between 2014 and 2017 The source of the data is the Industrial Action Report, conducted by the Department of Labour. The report is designed to monitor strike activities and work stoppages. 

Click and drag to zoom into an area of the plot. Double click to zoom out. Hover over a point to see details of the strike.

Click [here](http://www.labour.gov.za/strikes-in-2018-reaches-a-high-in-the-past-five-year-%E2%80%93-department-of-employment-and-labour) to read about the publication.

Click [here](http://www.labour.gov.za/DocumentCenter/Publications/Labour%20Relations/Registered%20Trade%20Unions%20_Sept%202020.pdf) to read the list of registered unions