Everyone, okay? I'm new to R and I have a question: Is it possible, and if possible, what is the way to export data from a google sheets table (or Drive) to R. Is there any library for this?
Everyone, okay? I'm new to R and I have a question: Is it possible, and if possible, what is the way to export data from a google sheets table (or Drive) to R. Is there any library for this?
You can use the googlesheets
package, here is a link demonstrating an example of using this package.
To find other packages with keywords that we do not know, besides searching google, there are some options direct the environment R:
findFn()
of package sos
: sos::findFn('google')
sos::findFm('sheets')
This function returns a web page with a table of possible functions and their respective packages.
search.cran()
of package NCmisc
: NCmisc::search.cran('google')
# $google
# [1] "googleAnalyticsR" "googleAuthR"
# [3] "googleCloudStorageR" "googleComputeEngineR"
# [5] "googledrive" "googleformr"
# [7] "GoogleKnowledgeGraphR" "googleLanguageR"
# [9] "googlenlp" "googlePolylines"
# [11] "googlePrintr" "googlePublicData"
# [13] "googlesheets" "googleVis"
# [15] "googleway" "plotGoogleMaps"
# [17] "RGoogleAnalyticsPremium" "RGoogleFit"
# [19] "RgoogleMaps" "rgoogleslides"
NCmisc::search.cran('sheets')
# $sheets
# [1] "googlesheets"
If the keyword is common, we can use the grep()
function to find a second keyword in the list:
google <- NCmisc::search.cran('google')[[1]]
google[grep('sheet', google)]
# [1] "googlesheets"
Or simply use more than one keyword in the search.cran()
function:
NCmisc::search.cran(c('google','sheet'))
# [1] "episheet" "googlesheets" "gsheet"
More options for package search are available here .