You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在R的googledrive包drive_share()中禁用共享通知?

使用googledrive共享Google表格时关闭邮件通知

可以实现,核心是在调用drive_share()函数时,添加sendNotificationEmail = FALSE参数,就能阻止对方收到共享通知邮件。

具体步骤和代码示例:

  1. 先将数据框写入Google表格:
library(googledrive)
# 示例数据框
my_data <- data.frame(
  序号 = 1:5,
  内容 = paste0("测试内容", 1:5)
)
# 上传为Google表格
drive_upload(my_data, name = "共享测试表格", type = "spreadsheet")
  1. 获取目标表格的文件对象:
target_sheet <- drive_get("共享测试表格")
  1. 共享给指定用户并关闭邮件通知:
drive_share(
  file = target_sheet,
  role = "reader", # 权限可选reader/writer/owner等
  type = "user",
  emailAddress = "指定用户邮箱@xxx.com",
  sendNotificationEmail = FALSE # 关键参数,关闭通知
)

这个参数是googledrive对Google Drive API的封装,API本身支持关闭共享通知,所以这个设置是有效的。

内容的提问来源于stack exchange,提问作者rcs18

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 01:14:52