Black Lives Matter. Please consider donating to Black Girls Code today.

Shinydashbord $ atomic vector problem

Hi,

I am new to R and shiny. I would like to create a timeseris in my shiny dashboord but after I applied the below R code the app says Error: in $ operator is invalid for atomic vectors.

output$conversion_daily <- renderPlotly({
subset<- subset(daily,daily$time>=input$dates[1] & daily$time<=input$dates[2])

p<-plot_ly(data = subset, x = ~subset$time, y = ~subset$ConversionRate, mode = “lines”) %>%
layout(title = “Brand 1”,xaxis = “Time (Day)”, yaxis = “Conversion Rate”)

})
)

The below code works, but this time I cannot put a title or axis title on it.

output$conversion_daily <- renderPlotly({
subset<- subset(daily,daily$time>=input$dates[1] & daily$time<=input$dates[2])

p<-plot_ly(data = subset, x = ~subset$time, y = ~subset$ConversionRate, mode = “lines”)

})
)

What can I do about that?