访问公开的Google表格 [英] Accessing A Public Google Sheet

查看:56
本文介绍了访问公开的Google表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经围绕该主题进行了大量研究,但我在SO或Google上找不到的答案都没有奏效.

I've done a fair amount of research around this topic and none of the answers I've found on SO or through the Google have worked.

我正在尝试使用R访问我认为尚未发布到网络上的公共google文档.我希望能够以类似API的方式访问文档中包含的数据,以便可以从中创建仪表板.我已经通过电子邮件发送了数据的所有者,希望可以将文档发布,但是在过渡期间,作为将来的练习,有人知道如何访问未发布的公共文档吗?

I'm trying with R to access a public google doc that I don't believe has been published to the web. I would like to be able to access the data contained in the doc in an API-like way so that I could make a dashboard off of it. I've emailed the owner of the data to hopefully get the document published but in the interim, and as an exercise for the future, does anyone know how to access a public document that isn't published?

为此,我创建了一个虚拟的Google文档,该文档是公开的,但未在以下链接中发布.它应该有2列和3行.

To that end I've created a dummy google doc that's public but not published at the following link. It should have 2 columns and 3 rows.

https://docs.google.com/spreadsheets/d/1z2hDygMzRG_yN5JBFVwGr4aci87AHSg1M7qvVu-uv_s/edit?usp = sharing

我们非常感谢您的帮助.谢谢.

Any help is much appreciated. Thanks.

推荐答案

尝试一下

url <- "https://docs.google.com/spreadsheets/d/1z2hDygMzRG_yN5JBFVwGr4aci87AHSg1M7qvVu-uv_s/export?format=csv&id=1z2hDygMzRG_yN5JBFVwGr4aci87AHSg1M7qvVu-uv_s&gid=0"
(df <- read.csv(url))
#   col1 col2
# 1    a    1
# 2    b    2
# 3    c    3

这篇关于访问公开的Google表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆