geom_timeline: Geom for plotting earthquake data as a time series.

Description Usage Details Note Examples

Description

This function provides a time series interpretation of earthquakes over time expressed as a bubble plot.

This function provides a time series interpretation of earthquakes over time expressed as a bubble plot.

Usage

1
2
3
4
5
6
7
geom_timeline(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

geom_timeline(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Details

geom_timeline provides a time series interpretation on filtered NOAA Significant Earthquake data.

geom_timeline provides a time series interpretation on filtered NOAA Significant Earthquake data.

Note

Countries and data ranges are modified using dplyr prior to using the geom for time series plotting. For BC date ranges, use a one sided inequality e.g. datevalue < '0000-01-01'

Aesthetic considerations for the number of countries and data ranges should be taken into consideration as to not plot too many data points rendering the graph unreadable. Use of dplyr and piping to filter the data set is suggested. Additional graphical elements can be added using standard ggplot syntax as shown in the example.

Countries and data ranges are modified using dplyr prior to using the geom for time series plotting. For BC date ranges, use a one sided inequality e.g. datevalue < '0000-01-01'

Aesthetic considerations for the number of countries and data ranges should be taken into consideration as to not plot too many data points rendering the graph unreadable. Use of dplyr and piping to filter the data set is suggested. Additional graphical elements can be added using standard ggplot syntax as shown in the example.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
## Not run: 

library(dplyr)
library(ggplot2)

any_name_df %>% filter(COUNTRY =="CHINA" | COUNTRY=="USA") %>% 
filter(datevalue > '1900-01-01', datevalue < '1950-01-01') %>% 
ggplot() + geom_timeline(aes(x = datevalue, y = COUNTRY, color = TOTAL_DEATHS, size = EQ_PRIMARY)) 

# Additional graph metadata can be added using standard ggplot syntax
# For BC date ranges, use a one sided inequality e.g. datevalue < '0000-01-01'

library(dplyr)
library(ggplot2)

any_name_df<-eq_clean_data(results)

p1<-any_name_df %>% filter(COUNTRY =="CHINA" | COUNTRY=="USA") %>% 
filter(datevalue > '1900-01-01', datevalue < '1950-01-01') %>% 
ggplot() + geom_timeline(aes(x = datevalue, y = COUNTRY, color = TOTAL_DEATHS, size = EQ_PRIMARY))
   
p1<-p1 + ggtitle("NOAA Significant Earthquake Data")

p1<-p1 + ylab("Country")+xlab("Date") + scale_size_continuous(name = 'Richter')  

p1<-p1  +scale_color_continuous(name = 'Mortality (deaths)') +theme(axis.text.x=element_text(angle=90,hjust=3))

p1


## End(Not run)

## Not run: 

library(dplyr)
library(ggplot2)

any_name_df %>% filter(COUNTRY =="CHINA" | COUNTRY=="USA") %>% 
filter(datevalue > '1900-01-01', datevalue < '1950-01-01') %>% 
ggplot() + geom_timeline(aes(x = datevalue, y = COUNTRY, color = TOTAL_DEATHS, size = EQ_PRIMARY)) 

# Additional graph metadata can be added using standard ggplot syntax
# For BC date ranges, use a one sided inequality e.g. datevalue < '0000-01-01'

library(dplyr)
library(ggplot2)

any_name_df<-eq_clean_data(results)

p1<-any_name_df %>% filter(COUNTRY =="CHINA" | COUNTRY=="USA") %>% 
filter(datevalue > '1900-01-01', datevalue < '1950-01-01') %>% 
ggplot() + geom_timeline(aes(x = datevalue, y = COUNTRY, color = TOTAL_DEATHS, size = EQ_PRIMARY))
   
p1<-p1 + ggtitle("NOAA Significant Earthquake Data")

p1<-p1 + ylab("Country")+xlab("Date") + scale_size_continuous(name = 'Richter')  

p1<-p1  +scale_color_continuous(name = 'Mortality (deaths)') +theme(axis.text.x=element_text(angle=90,hjust=3))

p1


## End(Not run)

cowboy2718/QuakeExplorer documentation built on May 26, 2019, 4:41 p.m.