首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在R中使用plotly直接上传到Chart Studio?

如何在R中使用plotly直接上传到Chart Studio?
EN

Stack Overflow用户
提问于 2020-10-12 22:16:41
回答 1查看 154关注 0票数 0

我想访问我在R中的plotly帐户。

我运行了以下代码:

代码语言:javascript
运行
复制
library(plotly)
signup(
    "someusername",
    "someemail@gmail.com"
)

然后我找回了这个错误

代码语言:javascript
运行
复制
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

代码语言:javascript
运行
复制
gg <-
  iris %>%
  ggplot(aes(Species, Sepal.Length)) +
  geom_col(fill = "green")

ggplotly(gg)

api_create(ggplotly(gg))
EN

回答 1

Stack Overflow用户

发布于 2020-10-22 20:26:15

您可以在plotly链接上找到所需的所有信息

https://plotly.com/r/getting-started-with-chart-studio/#getting-started-with-chart-studio-and-the-plotly-r-package

您希望使用Sys.Setenv设置chart studio凭据

代码语言:javascript
运行
复制
Sys.setenv("plotly_username"="your_plotly_username")
Sys.setenv("plotly_api_key"="your_api_key")

您可以在chart studio上的帐户设置中获取API密钥

遵循以下步骤( plotly教程中使用的示例):

代码语言:javascript
运行
复制
library(plotly)
p <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
api_create(p, filename = "r-docs-midwest-boxplots")

然后,api_create()应该将您的图发布到chart studio

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64319640

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档