首先,请允许我为Google使用Excel术语表示歉意。我想从工作簿中的单个工作表中获取数据,执行一些操作,然后在同一个工作簿中编写一个新工作表。例如;
library(googlesheets4)
pot <- read_sheet("https://docs.google.com/spreadsheets/d/1tw0tK0RQf1F4WXA5eo24wDjOR0jrqoRp91SI4x7YnqU/edit#gid=0")
pot.sum<-pot%>%
group_by(Treat) %>%
summarise(Mean = mean(Value))现在,我想将pot.sum写到同一个工作簿中的新电子表格中。我知道函数gs4_create()和write_sheet(),但我不知道如何指导新工作表的编写位置。谢谢你能提供的任何帮助。
发布于 2022-08-14 15:49:15
以下几点将帮助你做到这一点:
# Load packages
library(googlesheets4)
library(tidyverse)
link <- "https://docs.google.com/spreadsheets/d/1tw0tK0RQf1F4WXA5eo24wDjOR0jrqoRp91SI4x7YnqU"
pot <- read_sheet(link)
pot.sum <- pot %>%
group_by(Treat) %>%
summarise(Mean = mean(Value))
pot.sum %>% write_sheet(ss = link, sheet = "pot.sum")然后,您可以在Google主页( https://docs.google.com/spreadsheets/d/1tw0tK0RQf1F4WXA5eo24wDjOR0jrqoRp91SI4x7YnqU )中检查该页。
https://stackoverflow.com/questions/71165677
复制相似问题