6

我正在尝试开始为 R 使用 plotly,但我遇到了关于用户名的错误。当我尝试执行以下代码时...

test=ggplot(diamonds,aes(x=diamonds$carat,y=diamonds$price))+geom_point()
test2=plotly(test)
plotly(test)

...我收到错误消息:

Storing 'username' as the environment variable 'plotly_username'
Error in Sys.setenv(plotly_username = username) : 
  wrong length for argument

我认为 plotly 的 R 包可以在没有用户名的情况下通过 htmlwidgets 使用。据我所知,我使用的是最新版本的 plotly、ggplot 和 htmlwidgets。我究竟做错了什么?

4

1 回答 1

6

你必须使用ggplotly()

所以,

test <- ggplot(diamonds,aes(x = carat,y = price))+ geom_point()

ggplotly(test)

于 2017-03-17T20:20:25.537 回答