https://github.com/ropensci/plotly/blob/master/R/ggplotly.R#L66 p$title is NULL, which causes this if statement to fail. Wrap in a if(!is.null(p$title)) ?