Climate change and science has been an issue for discussion and debate for at least the last decade. Climate data collection is currently being collected for areas all over the world. Policy decisions are based on the most recent analysis conducted on data extracted from huge online repositories of this data. Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to explore large data sets and develop questions or ideas from visualizations of those data sets.
The ability to synthesize large data sets using visualizations is a skill that all data scientists should have. In addition to this data scientists are called upon to present data syntheses and develop questions or ideas based on their data exploration. This lab should take you through the major steps in data exploration and presentation.
The objective of this laboratory is to survey the available data, plan, design, and create an information dashboard/presentation that not only explores the data but helps you develop questions based on that data exploration. To accomplish this task you will have to complete a number of steps:
Identify what information interests you about climate change. Find, collect, organize, and summarize the data necessary to create your data exploration plan. Design and create the most appropriate visualizations (no less than 5 visualizations) to explore the data and present that information. Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that shows your path of data exploration. Develop four questions or ideas about climate change from your visualizations.
There are lots of places we can get climate data to answer your questions. The simplest would be to go to NOAA National Centers for Environmental Information (https://www.ncdc.noaa.gov/). There are all kinds of data here (regional, global, marine). Also, on the front page of the NOAA website there are also other websites that have climate data, such as: (https://www.climate.gov/), (https://www.weather.gov/), (https://www.drought.gov/drought/), and (https://www.globalchange.gov/). Obviously, you don’t have to use all of them but it might be helpful to browse them to get ideas for the development of your questions.
Alternatively, and more professionally, there are tons of packages that allow you to access data from R. See here for a great primer on accessing NOAA data with ‘R’. It is also a good introduction to API keys and their use.
data <- read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tavg-201906-12.csv"),skip=3)
state = map_data("state")
data$region = tolower(data$Location)
temp = merge(state, data, by="region", all=T)
temp<-temp[-6]
temp<-drop_na(temp)
mt = ggplot(temp, aes(x = long, y = lat, group = group, fill = Value))+geom_polygon(color = "white")
mt = mt + scale_fill_gradient(name = "degrees F", low = "blue", high = "red" , na.value="white") + labs(x="Longitude",y="Latitude")
mt + coord_map() ```
The map shows the average Anomal temperature across the state between the year of 1901 and 2000. We can see that the north of the state have lower average temperature compare to the south.
data_2 <- read.csv (url("https://www.ncdc.noaa.gov/cag/national/time-series/110-tavg-1-6-1895-2019.csv?base_prd=true&begbaseyear=1901&endbaseyear=2000"),skip=4)
ggplot(data_2,aes(x=Date,y=Value))+
geom_line()+
geom_smooth(method='lm',se=FALSE)+
labs(title="Annual National Average Temperature",x="year",y="Temperature")The graph shows that the temperature has been increased from 1901 to 2000.
data_3 <- read.csv(url("https://www.ncdc.noaa.gov/societal-impacts/redti/USA/jun/1-month/data.csv"),skip=1)
ggplot(data_3,aes(x=Date,y=REDTI))+
geom_col()+
geom_smooth(method='lm',se=FALSE)+
labs(title="Annual Residential Energy Demand Temperature Index",x="Year",y="REDTI")The energy demand temperature has been increased over the 100 years. Increasing in temperature cuased the increased in cooling system demand.
What is the trend in temperature across the state? North of United States tend to have lower average temperature compare to the south in the period of 1091-2000.
What’s the relationship between temperture and cooling system demand? As the average temperautre is increasing, people’s demand on cooling system is increasing as well.
What should we do to prevent glbal warming? Develpe nature energy. Slowly lower the temperature and use less cooling system.