{"id":245,"date":"2014-12-15T23:22:54","date_gmt":"2014-12-16T04:22:54","guid":{"rendered":"http:\/\/jkthinks.synology.me\/?p=1710"},"modified":"2020-09-04T22:58:36","modified_gmt":"2020-09-04T22:58:36","slug":"how-to-retrieve-data-from-google-sheet","status":"publish","type":"post","link":"https:\/\/www.jkthinks.com\/?p=245","title":{"rendered":"How to Retrieve Data from Google Sheet"},"content":{"rendered":"<p>R data is huge, so it is general to analyze on a desktop (local computer) or a server which provides better computing power. However, the former is inconvenient when you analyze data without your computer while the latter requires a complicated set-up process. There is an option to use cloud DB without paying money: Google Sheet.<\/p>\n<p><a href=\"http:\/\/jkthinks.synology.me\/wp-content\/uploads\/2014\/12\/gSheet_to_R.jpg\"><img loading=\"lazy\" class=\"aligncenter wp-image-1703\" src=\"http:\/\/jkthinks.synology.me\/wp-content\/uploads\/2014\/12\/gSheet_to_R.jpg\" alt=\"gSheet_to_R\" width=\"600\" height=\"376\" \/><\/a><\/p>\n<p>The process is very simple as in the guideline of <a href=\"http:\/\/blog.revolutionanalytics.com\/2014\/06\/reading-data-from-the-new-version-of-google-spreadsheets.html\" target=\"_blank\" rel=\"noopener noreferrer\">this website<\/a>.<\/p>\n<p>Simply, you make two R files to clean and read data from Google tables (download or copy-and-paste them). Then, you can put some lines into your R script as follows:<\/p>\n<p>&gt; library(&#8220;XML&#8221;)<br \/>\n&gt; source(&#8220;cleanGoogleTable.r&#8221;)<br \/>\n&gt; source(&#8220;readGoogleSheet.r&#8221;)<br \/>\n&gt; data &lt;- &#8220;URL of data&#8221;<br \/>\n&gt; elm &lt;- readGoogleSheet(data)<br \/>\n&gt; out &lt;- cleanGoogleTable(elm, table=1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>R data is huge, so it is general to analyze on a desktop (local computer) or a server which provides better computing power. However, the former is inconvenient when you analyze data without your computer while the latter requires a complicated set-up process. There is an option to use cloud DB without paying money: Google [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=\/wp\/v2\/posts\/245"}],"collection":[{"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=245"}],"version-history":[{"count":1,"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":283,"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions\/283"}],"wp:attachment":[{"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jkthinks.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}