rgoogle-cloud-platformvirtual-machinegoogle-auth-library

Google Cloud VM - googleAuthR library no called error


I have an R script that I run in google cloud environment, it helps me pull google analytics data and then I store it in storage. I call the googleAuthR library in one line of my script but I keep getting the same error. Has anyone had this problem before or can help?

I call the library like this:


library(googleAuthR)
library(googleCloudStorageR)

and error text i get:

Error in library(googleAuthR) : there is no package called ‘googleAuthR’

Solution

  • Looks like your R installation cannot find the package. Probably it is not installed where R is looking for it.

    To fix it, just open R from a terminal and execute:

    install.packages("googleAuthR");
    

    and

    install.packages("googleCloudStorageR");
    

    Remember that you will need to pass your Google credentials to work with cloud storage (for instance in a .json file, and set the GOOGLE_APPLICATION_CREDENTIALS environment variable - see https://cloud.google.com/docs/authentication/getting-started ).