GDELT Events: Poland

Author

Gagan Atreya

Published

February 23, 2024

Section 1. GDELT Events Recorded in Poland: 2020 - 2023

1.1 Breakdown of Events by Event Type

We will start of with the very broad “Event Root Code” column. See Chapter 6 (pg 131) of CAMEO codebook for details.

Event Root Codes in focus:

  • 09: Investigate
  • 15: Exhibit Force Posture
  • 17: Coerce
Display code
rm(list = ls())

#if (!require("pacman")) install.packages("pacman")
pacman::p_load(tidyverse, data.table, vtable, 
               lubridate, ggcharts, plyr,
               gridExtra, RgoogleMaps, ggmap, mapproj)

## GDELT dataframe:
df <- fread("~/Desktop/soc_ace_2024/data/gdelt/gdelt_events_poland_cleaned.csv")

## Focus: Event Root Code:
df$EventRootCode <- as.character(df$EventRootCode)
df$EventRootCode <- str_pad(df$EventRootCode, 
                            width=2, 
                            side="left", 
                            pad="0")
# table(df$EventRootCode)

df$Event_type <- ifelse(df$EventRootCode == "09", "Investigate",
                 ifelse(df$EventRootCode == "15", "Exhibit force posture",
                 ifelse(df$EventRootCode == "17", "Coerce", NA)))

df_backup <- df

table(df$Event_type)

               Coerce Exhibit force posture           Investigate 
                11582                  2590                  3726 
Display code
fx01 <- function(data,
                 xv) {
  ggplot(data, 
         aes(x = !!sym(xv))) +
    geom_bar(fill = "black", 
             color = "black", 
             size = 1.5,
             width = 0.75) +
    labs(title = paste("Distribution of", xv),
         x = xv,
         y = "Count")+
  #  coord_flip()+
    theme_bw()
}


fx02 <- function(data,
                 xv,
                 fctv) {
  ggplot(data, 
         aes(x = !!sym(xv))) +
    geom_bar(fill = "black", 
             color = "black", 
             size = 1.5,
             width = 0.75) +
    labs(title = paste("Distribution of", xv, "by year"),
         x = xv,
         y = "Count")+
    facet_wrap(~year)+
   # coord_flip()+
    theme_bw()
}

fx01(df, "Event_type")

Display code
fx02(df, "Event_type", "year")

1.2 Maps of Events by Event Type

The maps below display the count of event types in Poland.

Interpretation:
Bigger circles around specific coordinates means higher count of events.
(Larger circles = more events in that area).

1.3 Blank map (latitude/longitude only)

Display code
# Register ggmap API for mapping:

#summary(df$ActionGeo_Lat)
#summary(df$ActionGeo_Long)

ggmap::register_stadiamaps(key = "ecb62ab3-c884-4be1-9e19-4a49f5f8bed0")

mapoutline <- get_map(location = c(left = 14.00, ## bottom left (lon)
                                   bottom = 47.5, ## bottom left (lat)
                                   right = 26.00, # bottom right (lon)
                                   top = 56.00), 
                      maptype = "outdoors", 
                      source = "stadia",
                      color="bw")

print(ggmap(mapoutline))

1.4 All three event types

Display code
df$Event_count <- 1

df01 <- ddply(df, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map01 <- print(ggmap(mapoutline) + 
                 geom_point(data = df01,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("All three event types in Poland, 2020 - 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.5 All three event types by year

2020

Display code
df2020 <- df[df$year == "2020", ]
df2021 <- df[df$year == "2021", ]
df2022 <- df[df$year == "2022", ]
df2023 <- df[df$year == "2023", ]

## 2020:
df2020$Event_count <- 1
df202001 <- ddply(df2020, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map02 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202001,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("All three event types in Poland, 2020"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2021

Display code
## 2021:
df2021$Event_count <- 1
df202101 <- ddply(df2021, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map03 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202101,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("All three event types in Poland, 2021"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2022

Display code
## 2022:
df2022$Event_count <- 1
df202201 <- ddply(df2022, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map04 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202201,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("All three event types in Poland, 2022"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2023

Display code
## 2023:
df2023$Event_count <- 1
df202301 <- ddply(df2023, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map05 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202301,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("All three event types in Poland, 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.6 Event type: Investigate

Display code
df <- df_backup[df$Event_type == "Investigate", ]

df$Event_count <- 1

df01 <- ddply(df, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map01 <- print(ggmap(mapoutline) + 
                 geom_point(data = df01,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Investigate in Poland, 2020 - 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.7 Event type: Investigate by year

2020

Display code
df2020 <- df[df$year == "2020", ]
df2021 <- df[df$year == "2021", ]
df2022 <- df[df$year == "2022", ]
df2023 <- df[df$year == "2023", ]

## 2020:
df2020$Event_count <- 1
df202001 <- ddply(df2020, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map02 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202001,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Investigate in Poland, 2020"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2021

Display code
## 2021:
df2021$Event_count <- 1
df202101 <- ddply(df2021, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map03 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202101,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Investigate in Poland, 2021"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2022

Display code
## 2022:
df2022$Event_count <- 1
df202201 <- ddply(df2022, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map04 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202201,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Investigate in Poland, 2022"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2023

Display code
## 2023:
df2023$Event_count <- 1
df202301 <- ddply(df2023, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map05 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202301,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Investigate in Poland, 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.8 Event type: Coerce

Display code
df <- df_backup[df_backup$Event_type == "Coerce", ]

df$Event_count <- 1

df01 <- ddply(df, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map01 <- print(ggmap(mapoutline) + 
                 geom_point(data = df01,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Coerce in Poland, 2020 - 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.9 Event type: Coerce by year

2020

Display code
df2020 <- df[df$year == "2020", ]
df2021 <- df[df$year == "2021", ]
df2022 <- df[df$year == "2022", ]
df2023 <- df[df$year == "2023", ]

## 2020:
df2020$Event_count <- 1
df202001 <- ddply(df2020, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map02 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202001,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Coerce in Poland, 2020"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2021

Display code
## 2021:
df2021$Event_count <- 1
df202101 <- ddply(df2021, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map03 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202101,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Coerce in Poland, 2021"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2022

Display code
## 2022:
df2022$Event_count <- 1
df202201 <- ddply(df2022, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map04 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202201,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Coerce in Poland, 2022"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2023

Display code
## 2023:
df2023$Event_count <- 1
df202301 <- ddply(df2023, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map05 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202301,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Coerce in Poland, 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.10 Event type: Exhibit force posture

Display code
df <- df_backup[df_backup$Event_type == "Exhibit force posture", ]

df$Event_count <- 1

df01 <- ddply(df, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map01 <- print(ggmap(mapoutline) + 
                 geom_point(data = df01,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Exhibit force posture in Poland, 2020 - 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

1.11 Event type: Exhibit force posture by year

2020

Display code
df2020 <- df[df$year == "2020", ]
df2021 <- df[df$year == "2021", ]
df2022 <- df[df$year == "2022", ]
df2023 <- df[df$year == "2023", ]

## 2020:
df2020$Event_count <- 1
df202001 <- ddply(df2020, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map02 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202001,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Exhibit force posture in Poland, 2020"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2021

Display code
## 2021:
df2021$Event_count <- 1
df202101 <- ddply(df2021, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map03 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202101,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Exhibit force posture in Poland, 2021"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2022

Display code
## 2022:
df2022$Event_count <- 1
df202201 <- ddply(df2022, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map04 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202201,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Exhibit force posture in Poland, 2022"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

2023

Display code
## 2023:
df2023$Event_count <- 1
df202301 <- ddply(df2023, 
            .(ActionGeo_Lat, ActionGeo_Long), 
             summarize, 
             Event_count = sum(Event_count))

## Fill up the map with our data:
map05 <- print(ggmap(mapoutline) + 
                 geom_point(data = df202301,
                            aes(x = ActionGeo_Long, 
                                y = ActionGeo_Lat,
                                size = Event_count), 
                            alpha = 0.5, 
                            colour="black")+
                 ggtitle("Event type: Exhibit force posture in Poland, 2023"))+
  theme_bw()+
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())