This package provides a suite of RKWard plugins that create a graphical user interface for the popular googlesheets4 R package. It is designed to bridge the gap between desktop RKWard sessions and cloud-based Google Sheets, allowing for authentication, reading, writing, and management of sheets without needing to memorize API functions.
This package installs a new submenu in RKWard: Data > Google Sheets (googlesheets4), which contains the following plugins:
Authenticate: The entry point for the package. It loads the necessary libraries and triggers the browser-based authentication flow to connect R to your Google Drive/Sheets account.
drive_auth()gs4_auth()Find Sheet by Name: specific search tool to locate sheet metadata by its name in your Drive.
gs4_find()Get Metadata from URL: Retrieves metadata (ID, name, permissions) using a direct URL or ID string.
gs4_get()Read Google Sheet: A comprehensive tool to import data into R. It supports reading specific tabs or ranges and includes a "Smart Fix" feature to convert list-columns (caused by mixed data types in Sheets) into clean text vectors.
read_sheet()range_read()Write Data to Sheet: Writes an R data frame into a specific tab of an existing Google Sheet.
write_sheet()Create New Sheet: Creates a brand new spreadsheet file in your Google Drive.
gs4_create()Advanced Operations: Tools for granular control over data manipulation.
sheet_append(): Add rows to the end of a sheet.range_write(): Write data to a specific cell range.range_flood(): Fill a range with a single value.range_clear(): Clear data from a specific range.The interface is fully localized to match your RKWard language settings:
es)fr)de)pt_BR)googlesheets4 and googledrive. If you do not have them, install them from the R console:
install.packages(c("googlesheets4", "googledrive"))
devtools is required for installation from the source code.
install.packages("devtools")
To install the rk.googlesheets4 plugin package, you need the source code (e.g., by downloading it from GitHub).
local({
## Preparar
require(devtools)
## Computar
install_github(
repo="AlfCano/rk.googlesheets4"
)
## Imprimir el resultado
rk.header ("Resultados de Instalar desde git")
})
Once installed, all plugins can be found under the Data > Google Sheets (googlesheets4) menu in RKWard.
A new dataframe (default name my_sheet_data) will be created in your workspace containing the data from the cloud.
Alfonso Cano Robles (alfonso.cano@correo.buap.mx)
Assisted by Gemini, a large language model from Google.