Giter Club home page Giter Club logo

rgoogleslides's Introduction

Google Slides for R

Travis build status

AppVeyor build status

This package is wrapper around the Google Slides API and it serves to power data flows from R environment to Google Slides.

The package is available on CRAN. You can install the package using the following:

install.packages("rgoogleslides")

Or, if you would want to use the latest features in the package, you can run the following:

install.packages("devtools")
library(devtools)
devtools::install_github("hairizuanbinnoorazman/rgoogleslides", build_vignettes = TRUE)

If you encounter a bug while using the package, take a screenshot of the error and file an issue on this repository.

Examples and Blog Posts

For latest news and examples of how to use the rgoogleslides package, go to the following blog: https://www.hairizuan.com/tags/rgoogleslides/

Privacy Policy

The rgoogleslides package includes a default google credentials in order to make it easier to try the following package. (It is recommended for you to use your client id/client secret from your own Google Project though)

This project does not collect any information from any services that you authorize using this package. To confirm this, you are free to inspect the code base within this R package

rgoogleslides's People

Contributors

hairizuanbinnoorazman avatar muschellij2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rgoogleslides's Issues

Can't create a blank slide - is information stored somewhere?

Summary

I was doing quite a bit of fiddling with creating image requests and now can't create a new blank slide.

I unfortunately don't know how to give an exactly reproducible example for this problem because it is probably related to my account.

Whenever I run code to create a new slide (see code I run below), a new slide IS created, but my new slides always have the images I was using for testing before even though I no longer link to them or provide it to the code.

This is what I'm running:

slides_id <- "slide_id here"
requests <- add_create_slide_page_request(predefined_layout = "BLANK") 
commit_to_slides(slides_id, requests)

And this is what shows up in my slides even though I'm just looking for (and expecting) a blank slide.

Screen Shot 2021-04-23 at 9 35 07 AM

The images in the background of this slide are not deletable or movable if that helps narrow in on the problem.

Things I've tried to refresh everything and get rid of those background slide images:

  • I've refreshed RStudio sessions many a time
  • I've completely restarted my docker container I was working from
  • I created a new google slide set to work from
  • I uninstalled rgoogleslides and reinstalled and tried outside of a docker container.

But no matter what, new slides have background images like that.

Is there somewhere in the API itself or in the package that a cache is stored? How do I truly clear everything out so I can get a blank slide again?

Any advice you can give would be great. I am stumped.

Unable to discern the structure of a slide page

slide_page$pageElements$table$tableRows[[8]]$tableCells[[1]]$text$textElements[[1]]$textRun$content

This was what one would need to understand what value within a table
We would need to simplify this as much as possible

Alter the internal codebase to using R6 object class

Due to the nature of the Google Slides API - it may contain large amounts of nesting, it might actually be good to explore using classes to express the data structure. The current methodology might actually impose a tax on maintainence as there is need to read and understand the lists that are being passed around in the package internals.

Internally, the package will pass around classes of such objects. However, the package will still expose functions as that is the easiest for a user to make sense of how to use the package.

More information on this will be added on a later date

Programmatically add images to slides via GCS signed URLs

In the past, it was possible to upload images to the user's Google Drive and then somehow, via the Slides API, get it into Google Slides. This "feature" (maybe it was a bug then?) was broken for more than a year. There are temporary workarounds (e.g. putting the image in public domain) but there is no effort to add such a workaround into this package

Considering to add this mechanism to this package - however, that would mean developers using this package need to also wrap their head around GCS which not be too familiar for some who don't even touch any product in GCP

Will first need to experiment this on a separate branch - it will most likely not be a huge breaking change (more like a experimental function added on the side)

CRAN

Hey - great package, like using it. Is there anything in the works to put this on CRAN? It seems as though it passes R CMD check all fine, so it wouldn't seem like a huge effort.

Without this, I can't depend on this package for my CRAN packages.
Thoughts?

Metadata issue for package

Dear maintainer,

You have file 'rgoogleslides/man/rgoogleslides.Rd' with
\docType{package}, likely intended as a package overview help file, but
without the appropriate PKGNAME-package \alias as per "Documenting
packages" in R-exts.

This seems to be the consequence of the breaking change

Using @doctype package no longer automatically adds a -package alias.
Instead document _PACKAGE to get all the defaults for package
documentation.

in roxygen2 7.0.0 (2019-11-12) having gone unnoticed, see
r-lib/roxygen2#1491.

As explained in the issue, to get the desired PKGNAME-package \alias
back, you should either change to the new approach and document the new
special sentinel

"_PACKAGE"

or manually add

@Aliases rgoogleslides-package

if remaining with the old approach.

Please fix in your master sources as appropriate, and submit a fixed
version of your package within the next few months.

Error: library puts the Image always in the slide 'p'

Hi, if you try to add an image following
https://hairizuan.wordpress.com/2017/05/11/use-case-sending-a-ggplot-graph-into-googleslides/
the library always paste it in the page ‘p’. (even changing the slideID for another one)
The cause of this ERROR is in the function ‘aligned_page_element_property’ .The line adj_page_element_property <- page_element_property("p", height_magnitude = image_height,

should be

adj_page_element_property <- page_element_property(slide_page_id, height_magnitude = image_height,
Excellent package!!

Authentication issue when using images from Google drive

The example from this blog post no longer runs. I get the following error:

Error in rgoogleslides::commit_to_slides(presentation_id, request) : Invalid requests[0].createImage: Access to the provided image was forbidden.

The file is successfully uploaded to Drive, but can't be moved from Drive to Slides.

Looks related to the API changes outlined here:
https://stackoverflow.com/questions/60076883/google-script-replaceallshapeswithimage-with-image-from-drive-doesnt-work-any-m/60085036#60085036

https://stackoverflow.com/questions/46029225/image-from-google-drive-to-google-slides-via-driveapp-getfilebyid

Clash with Tidyverse googledrive package

Hello,

There is a package of the same name googledrive by the Tidyverse people, which clashes with your googledrive package. I would consider renaming yours, or using theirs instead - which can be done by, for example, changing the lines in your demo from id <- googledrive::upload_file("first_plot.png") to id <- googledrive::drive_upload("first_plot.png"), and googledrive::authorize() to googledrive::drive_auth().

Integration of ggplot2 with R googleslides package

I came across your R package for Google slides, amazing stuff!

Is this something you will continue to develop at any point? I am really looking for the ability to take ggplot2 visualisations and insert them into Google slides presentations. Is there any way in which I can help? -- not an advanced R user, but have been using it a lot since the new year.

Creation of function to handle table updates via dataframes

There is a function that takes in a dataframe and creates a new table and puts the data in it.
We would need a similar function that would be able to update the tables.

Input would be a dataframe and the slide page id as well as object id of the table.
This would check whether the table would be able to fit and if its possible, it would need to adjust accordingly to try to fit the table in it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.