{"id":17,"date":"2020-06-11T18:42:05","date_gmt":"2020-06-11T18:42:05","guid":{"rendered":"http:\/\/www.alipsa.se\/wordpress\/?p=17"},"modified":"2020-08-29T09:22:18","modified_gmt":"2020-08-29T09:22:18","slug":"spreadsheets-a-renjin-package-released","status":"publish","type":"post","link":"https:\/\/www.alipsa.se\/wordpress\/2020\/06\/11\/spreadsheets-a-renjin-package-released\/","title":{"rendered":"Spreadsheets &#8211; a Renjin package &#8211; Released"},"content":{"rendered":"\n<p>I released spreadsheets under the MIT license two weeks ago. Spreadsheets is a package (extension) for Renjin (an implementation of R for the Java Virtual Machine). This package will give you the ability to work with (read, write) spreadsheets. It supports reading of excel and Open Office\/Libre Office spreadsheets files. The project is located on <a href=\"https:\/\/github.com\/Alipsa\/spreadsheets\">github<\/a>.<\/p>\n\n\n\n<p>To import a spreadsheet into a data.frame you just do:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">excelDf &lt;- importSpreadsheet(\n    filePath = \"df.xlsx\",\n    sheet = 1,\n    startRow = 2,\n    endRow = 34,\n    startColumn = 1,\n    endColumn = 11,\n    firstRowAsColumnNames = TRUE\n)<\/code><\/pre>\n\n\n\n<p>Similarly to export a data.frame to a spreadsheet (Excel or Open Document) is as simple as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">exportSpreadsheet(filePath, df, sheet)<\/code><\/pre>\n\n\n\n<p>You can also export several data.frame to a spreadsheet in one go:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">exportSpreadsheets(\n  filePath = paste0(getwd(), \"\/dfExport.ods\"), \n  dfList = list(mtcars, iris, PlantGrowth), \n  sheetNames = c(\"cars\", \"flowers\", \"plants\")\n)<\/code><\/pre>\n\n\n\n<p>In addition there are several nice utility function such as find a row or a column matching a given value, convert between column indexes and names etc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I released spreadsheets under the MIT license two weeks ago. Spreadsheets is a package (extension) for Renjin (an implementation of R for the Java Virtual Machine). This package will give you the ability to work with (read, write) spreadsheets. It supports reading of excel and Open Office\/Libre Office spreadsheets files. The project is located on &hellip; <a href=\"https:\/\/www.alipsa.se\/wordpress\/2020\/06\/11\/spreadsheets-a-renjin-package-released\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Spreadsheets &#8211; a Renjin package &#8211; Released&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-software-and-technology"],"_links":{"self":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts\/17"}],"collection":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":6,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":38,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts\/17\/revisions\/38"}],"wp:attachment":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}