我想访问我在R中的plotly帐户。
我运行了以下代码:
library(plotly)
signup(
"someusername",
"someemail@gmail.com"
)
然后我找回了这个错误
Creating/Users/myfolder/.Rprofile
Error in cat_profile("username", con$un) :
R doesn't have permission to write to this file: ~
You should consider putting this in an .Rprofile
(or sourcing it when you use plotly):
如何解决此错误?我的目标是使用下面的代码直接从R上传到Plotly Chart Studio
gg <-
iris %>%
ggplot(aes(Species, Sepal.Length)) +
geom_col(fill = "green")
ggplotly(gg)
api_create(ggplotly(gg))
发布于 2020-10-22 12:26:15
您可以在plotly链接上找到所需的所有信息
您希望使用Sys.Setenv设置chart studio凭据
Sys.setenv("plotly_username"="your_plotly_username")
Sys.setenv("plotly_api_key"="your_api_key")
您可以在chart studio上的帐户设置中获取API密钥
遵循以下步骤( plotly教程中使用的示例):
library(plotly)
p <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
api_create(p, filename = "r-docs-midwest-boxplots")
然后,api_create()应该将您的图发布到chart studio
https://stackoverflow.com/questions/64319640
复制