Click the Original, Code And Reconstruction tabs to read about the issues and how they were fixed.

Original


Source: ACMA Research and Analysis Section (2015).


Objective

The objective of the original data visualisation was to examine the Will Smith effect; to see if there is a change in the number of reported UFO sightings after the release of a major movie or TV show over the years.

The visualisation chosen had the following three main issues:

  • Issue 1: The piechart is hard to read; colors associated with the number of UFO sightings over the years is difficult to distinguish.

  • Issue 2: Too much information such as movie/TV title is cramped by the long titles.

  • Issue 3: Impossible to see a trend, if any, over the years interms of movie release and reported UFO sightings.

Code and Reconstruction

The following code was used to fix the issues identified in the original.

# Loading packages 

library(dplyr)
library(ggplot2)
library(magrittr)
library(lubridate)
library(readr)
library(forcats)
library(bindrcpp)
library(ggplot2)
library(janitor)
theme_set(theme_minimal())

# Loading file and checking data

ufo_sight<- read_csv("C:/Users/Jay Nugasur/Desktop/UFO sightings details.csv")

# Renaming column

colnames(ufo_sight) 
## [1] "Year"                     "Sightings"               
## [3] "Major TV and film sci-fi"
names(ufo_sight)[names(ufo_sight) == "Major TV and film sci-fi"] <- "filmtv" 

# Filtering NA data

Release_only <- ufo_sight%>% na.omit(dat)



# Tidying data and description for easy read
Release_only$filmtv <- ifelse(Release_only$filmtv=="British TV airs A For Andromeda", "A For Andromeda (1961)",
                       ifelse(Release_only$filmtv=="Gerry Anderson's Thunderbirds is launched" , "Thunderbirds (1965)",
                       ifelse(Release_only$filmtv=="The original Star Trek TV series begins", "Original Star Trek TV series (1966)", 
                       ifelse(Release_only$filmtv=="2001: A Space Odyssey and Planet of the Apes appear in cinemas" , "2001: A Space Odyssey and Planet of the Apes (1968)" ,      
                       ifelse(Release_only$filmtv=="In Doctor Who, Tom Baker's Doctor faces Davros, leader of the Daleks", "Doctor Who (1975)",      
                       ifelse(Release_only$filmtv=="The Man who fell to earth, starring David Bowie, released", "The Man who fell to earth (1976)",      
                       ifelse(Release_only$filmtv=="Close Encounters of the Third Kind, Spielberg's first alien film", "Close Encounters of the Third Kind (1977)",       
                       ifelse(Release_only$filmtv=="Ridley Scott's Alien released","Ridley Scott's Alien (1979)",     
                       ifelse(Release_only$filmtv=="The Thing and ET both released", "The Thing and ET (1982)",
                       ifelse(Release_only$filmtv=="The Tripods livens up Saturday evening television", "The Tripods livens (1984)",
                       ifelse(Release_only$filmtv=="Cocoon and The explorers both released", "Cocoon and The explorers (1985)",
                       ifelse(Release_only$filmtv=="Critters and Aliens released", "Critters and Aliens (1986)",
                       ifelse(Release_only$filmtv=="Star Trek: The Next Generation brings the series back to life", "Star Trek: The Next Gen (1987)",     
                       ifelse(Release_only$filmtv=="Alien Nation released", "Alien Nation (1988)",       
                       ifelse(Release_only$filmtv=="Communion and The Abyss released", "Communion and The Abyss (1989)",  
                       ifelse(Release_only$filmtv=="Mulder and Scully investigate the unknown in The X-Files - runs for 9 seasons ending in 2002", "The X-Files (1993)",       
                       ifelse(Release_only$filmtv=="Independence Day (and Mars Attacks!) score at the box office", "Independence Day and Mars Attacks (1996)",       
                       ifelse(Release_only$filmtv=="Men in Black released", "Men in Black (1997)", 
                       ifelse(Release_only$filmtv=="Big-budget TV drama Invasion: Earth airs", "TV drama Invasion: Earth (1998)",
                       ifelse(Release_only$filmtv=="Firefly Joss Whedon's space cowboys series; X Files ends", "Firefly (2002)",
                       ifelse(Release_only$filmtv=="Battlestar Galactica is reimagined, to critical acclaim", "Battle Galactica Reimagined (2003)",
                       ifelse(Release_only$filmtv=="Doctor Who is relaunched by Russell T Davies", "Doctor Who relaunched (2005)",
                       ifelse(Release_only$filmtv=="Doctor Who spinoff Torchwood begins", "Doctor Who spinoff (2005)",
                       ifelse(Release_only$filmtv=="Cloverfield released; 13.1m watch the Doctor Who christmas special", "Cloverfield (2008)",NA ))))))))))))))))))))))))

# Order by years

Release_only$filmtv <- Release_only$filmtv %>%factor(levels = Release_only$filmtv[order(-Release_only$Year)]) 
                       

# Dotplot


p1 <- ggplot(Release_only, aes(y = filmtv , x = Sightings))
p1 + geom_point(colour = "Firebrick2") +
  geom_segment(aes(x = 0, y = filmtv, xend = Sightings,yend=filmtv),linetype = 2) +
  labs(title = "UFO SIGHTINGS",
       x = "No. of Sightings",
       y = "Film/TV Name (Year Released)") +
  geom_text(aes(label=round(Sightings,2)), hjust = -.2,size = 3) +
  scale_x_continuous(limits = c(0,750))

# Plot for overall trend

ggplot() +
  coord_cartesian() +
  layer(
    data=ufo_sight, 
    mapping=aes(x=Year, y=Sightings), 
    stat="identity", 
    geom="point",
    position = position_identity()
    
  ) +
  layer(
    data = ufo_sight, 
    mapping = aes(x = Year, y = Sightings), 
    stat = "identity", 
    geom = "line",
    position = position_identity()
    
  )  

Data Reference