I recently downloaded googlesheets
via
devtools::install_github("jennybc/googlesheets")
and experience some difficulties. When running the script as mentioned in https://github.com/jennybc/googlesheets I get always:
Error: could not find function "%>%"
How can I solve that problem?
Reproducible example:
Download:
devtools::install_github("jennybc/googlesheets")
require(googlesheets)
Data:
gap_key <- "1HT5B8SgkKqHdqHJmn5xiuaC04Ngb7dG9Tv94004vezA"
copy_ss(key = gap_key, to = "Gapminder")
gap <- register_ss("Gapminder")
Error occurs:
oceania_csv <- gap %>% get_via_csv(ws = "Oceania")
There are 3 ways to create a new spreadsheet in Google Sheets: Click the red "NEW" button on your your Google Drive dashboard and select "Google Sheets" Open the menu from within a spreadsheet and select "File > New Spreadsheet" Click "Blank" or select a template on the Google Sheets homepage.
Load the dplyr package first, which provides the %>%
operator. This is noted here in the README you link to (suppressMessages
is optional):
googlesheets is designed for use with the %>% pipe operator and, to a lesser extent, the data-wrangling mentality of dplyr. The examples here use both, but we'll soon develop a vignette that shows usage with plain vanilla R. googlesheets uses dplyr internally but does not require the user to do so.
library("googlesheets")
suppressMessages(library("dplyr"))
You can install dplyr with
install.packages("dplyr")
See here for more about the pipe operator (%>%
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With