-
Notifications
You must be signed in to change notification settings - Fork 1
/
RSlandPlotcode.R
56 lines (42 loc) · 1.98 KB
/
RSlandPlotcode.R
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
setwd("C:/Users/claire.GMFMC/Desktop/WFH files/R (2)/R/EFHwGit/EFHApp")
RSland<-read.csv("Red Snapper Landings 1986-2015.csv",na.strings = "NA")
#RDland<-RDland[c(-65,-66),]
library(highcharter)
library(htmlwidgets)
hc <- highchart() %>%
#hc_add_serie(name=speciesName, type="line", data=List.Results)
hc_xAxis(categories =RSland$Year) %>%
hc_add_series(name = "Recreational", data = RSland$Rec_Harvest, type="line") %>%
hc_add_series(name = "Commercial", data = RSland$Comm_Harvest, type="line") %>%
hc_yAxis(title = list(text = "Landings (MP ww)"),
labels = list(style = list(color = "#000000", fontWeight="bold"))) %>%
hc_xAxis(title = list(text = "Year"),
labels = list(style = list(color = "#000000", fontWeight="bold"))) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_exporting(enabled = TRUE,
filename = "AgeLength")
saveWidget(hc,"RSland.html")
setwd("X:/Claire/text/EFHspeciesLandings")
a <- read.csv("CommercialLandingsNoShrimp.csv",na.strings="0")
a2 <- a[,-32]
for (i in 2:3){
landYear <- a2$YEARLAND
comm_Harvest <- a2[,i]
speciesName <- names(a2)[i]
speciesName2 <- names(a2)[i]
# speciesName <- a2[1,i]
# speciesName2 <- a2[1,i]
speciesName2 <- highchart() %>%
#hc_add_serie(name=speciesName, type="line", data=List.Results)
hc_xAxis(categories =landYear) %>%
#hc_add_series(name = "Recreational", data = RSland$Rec_Harvest, type="line") %>%
hc_add_series(name = "Commercial", data = comm_Harvest, type="line") %>%
hc_yAxis(title = list(text = "Landings (MP ww)"),
labels = list(style = list(color = "#000000", fontWeight="bold"))) %>%
hc_xAxis(title = list(text = "Year"),
labels = list(style = list(color = "#000000", fontWeight="bold"))) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_exporting(enabled = TRUE,
filename = "AgeLength")
saveWidget(speciesName2,paste(speciesName,".html",sep=""),selfcontained=TRUE)
}