Producing a plotly object using ggplotly returns exactly what I need, however, when using api_create() and pushing the object to plotly online, the x-axis appears as numeric, and not a factor as I declared it to be in R.
mem$Office <- as.factor(mem$Office)
mem_plot <- ggplot(data=mem,aes(x=Office,y=Total, fill=Office)) +
geom_bar(size=mem$Total,width=0.5,position='dodge',stat='identity') +
labs(x = 'Office', y = 'Total')
mem_plot <- ggplotly(mem_plot,tooltip=c("x","y"))
mem_plot
Then I run: api_create(mem_plot, filename = "memership-plot")