#' Takes a table and updates a google sheet with the information in it
#' Uses tempdir to create a temporary file, since there seems to be know way of passing dataframes directly to gdrive
#' @export
gsheet_send <- function(table,g_file, na_handle) {
tmp <- paste(tempdir(),g_file,sep="\\")
write.csv(table
,file = tmp
,na = na_handle)
gfile <- googledrive::drive_get(g_file)
googledrive::drive_update(gfile
,tmp
,name = g_file)
}
#' Linux version of pervious command
#' @export
gsheet_send_linux <- function(table,g_file, na_handle) {
tmp <- paste(tempdir(),g_file,sep="/")
write.csv(table
,file = tmp
,na = na_handle)
gfile <- googledrive::drive_get(g_file)
googledrive::drive_update(gfile
,tmp
,name = g_file)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.