How to use requirements (googlesheets)?

I recently downloaded googlesheets via

 devtools::install_github("jennybc/googlesheets") 

and have some difficulties. When I run the script, as stated in https://github.com/jennybc/googlesheets I always get:

 Error: could not find function "%>%" 

How can I solve this problem?

Playable example:

Loading:

 devtools::install_github("jennybc/googlesheets") require(googlesheets) 

Data:

 gap_key <- "1HT5B8SgkKqHdqHJmn5xiuaC04Ngb7dG9Tv94004vezA" copy_ss(key = gap_key, to = "Gapminder") gap <- register_ss("Gapminder") 

Error:

 oceania_csv <- gap %>% get_via_csv(ws = "Oceania") 
+6
source share
1 answer

First download the dplyr package, which provides the %>% operator. This is noted here in the README that you are referencing ( suppressMessages is optional):

googlesheets is intended to be used with the%>% pipe operator and, to a lesser extent, the dplyr data mentality. In the examples, both options are used here, but we will soon develop a vignette that shows use with plain vanilla R. googlesheets uses dplyr internally, but does not require this from the user.

 library("googlesheets") suppressMessages(library("dplyr")) 

You can install dplyr with

 install.packages("dplyr") 

See here for the pipe operator ( %>% ) for details.

+6
source

Source: https://habr.com/ru/post/986070/


All Articles