Introduction

Climate change is an occurrence that happens when the weather patterns on Earth have been altered. These new weather patterns can last for long periods of time, which in turn, can cause major changes to the environment. One of the leading causes of climate change is global warming. Global warming is caused by the greenhouse effect, which had been amplified by humans. Typical greenhouse gases include methane and carbon dioxide. Some of the ways in which carbon dioxide is produced include the use of fossil fuels, which coal and natural gas, deforestation, and land alterations (NASA). My research question is “How are people responding to the concept of climate change on Twitter?”. This topic is interesting since climate change has become a political topic, and is ultimately controversial. On a world level, this issue is viewed as either a legitimate issue, or a hoax that is made up and is being used by people to impact the economy. As a science major, this is a topic that I pay close attention to since I believe that humans are directly responsible for the current status of the climate, and I like to see how people who deny climate change respond and perceive this issue. In addition to this, I was curious to see how this controversy was documented on social media. In order to answer these questions, random tweets that were associated with climate change were gathered from Twitter and comprised into a word cloud.

Data

The process of gathering data is very similar to the one that was done on a previous assignment involving the creation of word clouds. The program of Twitter Developer was used to gather Twitter data. After loading the packages of twitteR, ROAuth, wordcloud, tm, and plyr from CRAN, and getting the consumer key, consumer secret, access token, and token secret from Twitter, the following tweets were collected through the following code:

tweets = searchTwitter("Climate Change", n=200)
head(tweets)

This resulted in an output of: [[1]] [1] “TrevEischen: .@GavinNewsom: "We’re waging war against the most destructive fires in our state’s history, and Trump is conducting… https://t.co/bCdPupXTU2

[[2]] [1] “UKDemockery: RT @AaronBastani: Tens of thousands die every year from the cold. Tens of millions grimace at their high energy bills. Climate change is ex…”

[[3]] [1] “ClimateBen: https://t.co/QizrezLV8E

[[4]] [1] “christine_says_: RT @pvtjarred: And please join Citizens’ Climate Lobby! We are a group of people trying to help create and push bills into legislation to f…”

[[5]] [1] “dadinaro: RT @nytimes: Even as California burns, the Trump administration is blocking its climate change efforts. "We’re waging war against the most…”

[[6]] [1] “BreazBeach: RT @MichaelJFell: This remark is 100% factually incorrect. Staggering ignorance is on full display.Cuomo: ‘We Didn’t Have Hurrican…”

For the initial tweets gathered, they were either initial responses to another profile, or they were retweets. Not all of the tweets are shown, instead, only the first six that were collected are visible. In addition to this, the number of tweets requested was 200. After the gathering of the initial tweets, they were cleaned and refined. In order to do this, a long function was used to remove certain text and characters from the tweets. The removed text and characters included punction, which included commas, periods, exclamation and question marks. A corpus was also used to remove stopwords. Stopwords included words such as it, me who, was their, etc. The following is the major code used to get the desired tweets:

tweets.text = laply(tweets,function(t)t$getText())
clean.text <- function(some_txt) 

clean_text = clean.t
head(clean_text)
tweet_corpus = Corpus(VectorSource(clean_text))
tdm = TermDocumentMatrix(tweet_corpus, control = list(removePunctuation = TRUE,stopwords = c("machine", "learning", stopwords("english")), removeNumbers = TRUE, tolower = TRUE))

This resulted in an output of:

[1] “we’re waging war against the most destructive fires in our state’s history and trump is conducting…”
[2] “rt tens of thousands die every year from the cold tens of millions grimace at their high energy bills climate change is ex…”
[3] “rt and please join citizens’ climate lobby we are a group of people trying to help create and push bills into legislation to f…” [4] “rt even as california burns the trump administration is blocking its climate change efforts were waging war against the most…”
[5] “rt this remark is factually incorrect staggering ignorance is on full displaycuomo ‘we didn’t have hurrican…”
[6] “rt many black and brown teens have been fighting to protect their lands from industrial military and imperialistcolonia…”

These cleaned and refined tweets were then used to get the word cloud, which was obtained with the following code:

m = as.matrix(tdm) 
word_freqs = sort(rowSums(m), decreasing=TRUE) 
dm = data.frame(word=names(word_freqs), freq=word_freqs) 
wordcloud(dm$word, dm$freq, random.order=FALSE, colors=brewer.pal(8, "Dark2"))

In order to do this, the cleaned and refined tweets were turned into a matrix and were arranged in a decreasing order, which referenced the frequency of a word. This allowed for the creation of a dataset. This allowed for a finished word cloud:

FiG 1. This word cloud shows the prominent words that appear in tweets related to climate change.

Above is the word cloud containing words associated with tweets relating to climate change. This word cloud contains words from tweets relating to climate change. The most prominent words found in tweers related to climate change are centered in the middle, which signify multiple occurrences in tweets. Less prominent words appear on the outer edge of the cloud.

In order to better understand the reasoning behind why some words are more prominent than others, a frequency graph was made in which the first 15 major words from tweets relating to climate change were analyzed. This was made with the following code:

barplot(d[1:15,]$freq, las = 2, names.arg = d[1:15,]$word,
        col ="lightblue", main ="Most frequent words for Climate Change tweets",
        ylab = "Word frequencies")

Fig 2. The bar graph shows the frequency of the first 15 major words used in tweets related to climate change.

This allowed for the frequency of the words to be seen, and allowed for numerical values to be assigned to words that appeared within the cloud. This in turn, explained why some words on the word cloud were considered major words, while others weren’t.

Results

Upon looking at the word cloud, it can be noticed that the main words, and the topic of the word cloud was climate change. The size and the location allowed for the main topic of the cloud to be seen, and also allowed for other frequent words to be seen. These other words include believe, conversation, don’t, and excused. Some of the minor words also include million, california, will, and "climate. Most of these words are inferences to issues going on in the world. For example, the word of california relates to the wildfires that have recently been occurring there. This issue has been controversial since people have been fighting over the issue as to whether or not this was just a naturally occurring event, or if their increased frequency was due to the way that humans treat the environment. Upon a closer look at the whole word cloud, it was noticeable that other words that appear include trump, and political. These two words alluded to some of the other variables that might impact one’s perspective of climate change. The frequency graph for the most occurring words also had a skewed appearance, with it going towards the right. While there was no distinct relationship between the words used, it was able to give information as to what words were more prominent than others.

Conclusion

It can be concluded that climate change is a controversial issue. Depending on who is looking at the issue, it can be seen in either a negative or positive light. Overall, this issue is a very heated issue that gets people very angry. This was demonstrated by the fact that some of the tweets were very hateful, and were just plain insulting. On a deeper note, these tweets show, that as a society, we are unable to convey a dissenting opinion or thought to someone without offending them. In response to the initial question as to how people respond to the issue of climate change, the tweets seem to indicate that there is no right or wrong answer. Ultimately, the decision is left up to the individual’s personal perspective, and is influenced by many other factors. This was alluded to in the cloud by the presence of other words such as trump and political. Further studies that could possibly be done include looking at tweets related to political party, and seeing if one’s affiliation with a party is directly related to, or impactful on one’s view on climate change or their scientific beliefs. In conclusion, there is no concurring opinion amongst Twitter users as to what causes climate change.

Sources

Shaftel, Holly, et al. “The Causes of Climate Change.” NASA, NASA’s Jet Propulsion Laboratory | California Institute of Technology, 30 Oct. 2019, climate.nasa.gov/causes/.