library(plotly) library(tidyverse) library(lubridate)
2024-03-02
library(plotly) library(tidyverse) library(lubridate)
data("faithfuld")
plot_ly(z = as.matrix(faithful), type = "surface")
# Data downloaded from below url in csv format that data was read into R
# https://www.nseindia.com/reports-indices-historical-index-data
nifty_df <- read.csv("NIFTY 50-02-12-2023-to-02-03-2024.csv")
nifty_df <- nifty_df[-63,]
nfy_df <- nifty_df[,2:4] %>%
gather(index, price) %>%
mutate(date = rep(nifty_df$Date, 3))
plot_ly(nfy_df, x = ~dmy(date), y = ~price, color = ~index,
type = "scatter", mode = "line")