January 3, 2018

RCL Stock prices

R Code

# Get Data
setwd("~/Course9 - DevelopingDataProducts/DDP")
rcl <- read.csv("HistoricalQuotes.csv",header = T)
# Format the Various Fonts and Axes Titles
f1 <- list(family = "Arial, sans-serif",
           size = 18,
           color = "lightgrey")
f2 <- list(family = "Old Standard TT, serif",
           size = 7,
           color = "black")
b <- list(title = "Date",showticklabels = TRUE,
          tickangle = 45,titlefont = f1,tickfont = f2)
a <- list(title = "Price",showticklabels = TRUE,
          titlefont = f1,tickfont = f2)
p <- plot_ly(rcl,x=~date) %>% add_lines(y=~open,name="Open") %>% 
        add_lines(y=~close,name="Close") %>% 
        add_lines(y=~high,name="High") %>%                               
        add_lines(y=~low,name="Low") %>% 
        layout(xaxis = b, yaxis = a)

Plot