diff --git a/articles/aa-examples.html b/articles/aa-examples.html index 6ab1cde..e528f3c 100644 --- a/articles/aa-examples.html +++ b/articles/aa-examples.html @@ -128,7 +128,8 @@

Table of Contents1. Simply export a data frame to an xlsx file

-iris %>% toxlsx(path = mypath)
+iris %>% toxlsx(path = mypath) +#> Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'

Preview of the xlsx file in LibreOffice Calc :

@@ -137,7 +138,8 @@

-list(iris,cars) %>% toxlsx(path = mypath)
+list(iris,cars) %>% toxlsx(path = mypath) +#> Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'

Preview of the xlsx file in LibreOffice Calc :

@@ -153,7 +155,8 @@

3 volume = c(10,8,12,15) ) # Export -df1 %>% toxlsx(path = mypath, mergecol = "group") +df1 %>% toxlsx(path = mypath, mergecol = "group") +#> Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'

Preview of the xlsx file in LibreOffice Calc :

@@ -173,7 +176,8 @@

14,10,5,12) ) # Export -df2 %>% toxlsx(path = mypath, mergecol = c("country","group")) +df2 %>% toxlsx(path = mypath, mergecol = c("country","group")) +#> Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'

Preview of the xlsx file in LibreOffice Calc :

@@ -197,7 +201,8 @@

"tb2" = "Data recorded in the 1920s"), footnote3 = list("tb1" = "Source : R.A. Fisher", "tb2" = "Source : M. Ezekiel"), - path=mypath) + path=mypath) +#> Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'

Preview of the xlsx file in LibreOffice Calc :

@@ -231,7 +236,8 @@

= list("iris" = "Source : R.A. Fisher", "cars" = "Source : M. Ezekiel"), filename = "Results", - path = mypath) + path = mypath) +#> Your Excel file 'Results.xlsx' is available in the folder '/tmp/RtmpEaogXo'

The equivalent with the {openxlsx} syntax would be much longer and more painful to write. See here for the equivalent of the sixth example.

diff --git a/news/index.html b/news/index.html index e7c8963..c1c0f56 100644 --- a/news/index.html +++ b/news/index.html @@ -51,6 +51,11 @@ Source: NEWS.md +
+

tablexlsx 0.2.1

+

This release includes :

+

tablexlsx 0.2.0

This release includes :

diff --git a/pkgdown.yml b/pkgdown.yml index b7ee954..1e22581 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: aa-examples: aa-examples.html -last_built: 2023-04-28T09:21Z +last_built: 2023-04-28T10:09Z diff --git a/reference/toxlsx.html b/reference/toxlsx.html index 51cea84..610c0cd 100644 --- a/reference/toxlsx.html +++ b/reference/toxlsx.html @@ -147,6 +147,7 @@

Examples# For more examples, see examples gallery : # https://ddotta.github.io/tablexlsx/articles/aa-examples.html toxlsx(object = iris, path = tempdir()) +#> Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpSjMR86'

diff --git a/search.json b/search.json index 9f5e6ae..3d80ade 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to tablexlsx development","title":"Contributing to tablexlsx development","text":"goal guide help get contributing tablexlsx quickly possible. guide divided two main pieces: Filing bug report feature request issue. Suggesting change via pull request.","code":""},{"path":"/CONTRIBUTING.html","id":"issues","dir":"","previous_headings":"","what":"Issues","title":"Contributing to tablexlsx development","text":"filing issue, important thing include minimal reproducible example can quickly verify problem, figure fix . three things need include make example reproducible: required packages, data, code. Packages loaded top script, ’s easy see ones example needs. easiest way include data use dput() generate R code recreate . example, recreate mtcars dataset R, ’d perform following steps: Run dput(mtcars) R Copy output reproducible script, type mtcars <- paste. even better can create data.frame() just handful rows columns still illustrates problem. Spend little bit time ensuring code easy others read: make sure ’ve used spaces variable names concise, informative use comments indicate problem lies best remove everything related problem. shorter code , easier understand. can check actually made reproducible example starting fresh R session pasting script . (Unless ’ve specifically asked , please don’t include output sessionInfo().)","code":""},{"path":"/CONTRIBUTING.html","id":"pull-requests","dir":"","previous_headings":"","what":"Pull requests","title":"Contributing to tablexlsx development","text":"contribute change tablexlsx, follow steps: Create branch git make changes. Push branch github issue pull request (PR). Discuss pull request. Iterate either accept PR decide ’s good fit tablexlsx. steps described detail . might feel overwhelming first time get set , gets easier practice. ’re familiar git github, please start reading http://r-pkgs..co.nz/git.html Pull requests evaluated seven point checklist: Motivation. pull request clearly concisely motivate need change. Also include motivation NEWS new release tablexlsx comes ’s easy users see ’s changed. Add item top file use markdown formatting. news item end (@yourGithubUsername, #the_issue_number). related changes. submit pull request, please check make sure haven’t accidentally included unrelated changes. make harder see exactly ’s changed, evaluate unexpected side effects. PR corresponds git branch, expect submit multiple changes make sure create multiple branches. multiple changes depend , start first one don’t submit others first one processed. ’re adding new parameters new function, ’ll also need document roxygen. Make sure re-run devtools::document() code submitting. fixing bug adding new feature, please add testthat unit test. seems like lot work don’t worry pull request isn’t perfect. pull request (“PR”) process, unless ’ve submitted past ’s unlikely pull request accepted . Many thanks advance !","code":""},{"path":[]},{"path":"/articles/aa-examples.html","id":"table-of-contents","dir":"Articles","previous_headings":"Examples gallery","what":"Table of Contents","title":"Examples gallery","text":"Simply export data frame xlsx file Export list several data frames xlsx file (data frame different sheet) Export data frame xlsx file (merging modalities one column) Export data frame xlsx file (merging modalities several columns) Export list several data frames xlsx file (several data frames sheet) Export list data frames named xlsx file specifying data frame goes sheet, styling column, giving title footnotes… Let’s define export folder examples page Important : vignette, examples use %>% pass object argument toxlsx() function, works interchangeably 3 syntaxes :","code":"mypath <- tempdir() toxlsx(object = iris, path = mypath) iris |> toxlsx(path = mypath) iris %>% toxlsx(path = mypath)"},{"path":"/articles/aa-examples.html","id":"simply-export-a-data-frame-to-an-xlsx-file","dir":"Articles","previous_headings":"Examples gallery","what":"1. Simply export a data frame to an xlsx file","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"iris %>% toxlsx(path = mypath)"},{"path":"/articles/aa-examples.html","id":"export-a-list-of-several-data-frames-to-an-xlsx-file-each-data-frame-in-a-different-sheet","dir":"Articles","previous_headings":"Examples gallery","what":"2. Export a list of several data frames to an xlsx file (each data frame in a different sheet)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"list(iris,cars) %>% toxlsx(path = mypath)"},{"path":"/articles/aa-examples.html","id":"export-a-data-frame-to-an-xlsx-file-merging-modalities-for-one-column","dir":"Articles","previous_headings":"Examples gallery","what":"3. Export a data frame to an xlsx file (merging modalities for one column)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"# Create df1 df1 <- data.frame( group = c(\"dupont\",\"dupont\",\"arnold\",\"arnold\"), name = c(\"toto\",\"tata\",\"tutu\",\"tete\"), volume = c(10,8,12,15) ) # Export df1 %>% toxlsx(path = mypath, mergecol = \"group\")"},{"path":"/articles/aa-examples.html","id":"export-a-data-frame-to-an-xlsx-file-merging-modalities-for-several-columns","dir":"Articles","previous_headings":"Examples gallery","what":"4. Export a data frame to an xlsx file (merging modalities for several columns)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"# Create df2 df2 <- data.frame( country = c(rep(\"france\",4),rep(\"england\",4)), group = c(rep(\"dupont\",2),rep(\"martin\",2), rep(\"arnold\",2),rep(\"harry\",2)), name = c(\"toto\",\"tata\",\"tutu\",\"tete\", \"momo\",\"mama\",\"mumu\",\"meme\"), volume = c(10,8,12,15, 14,10,5,12) ) # Export df2 %>% toxlsx(path = mypath, mergecol = c(\"country\",\"group\"))"},{"path":"/articles/aa-examples.html","id":"export-a-list-of-several-data-frames-to-an-xlsx-file-several-data-frames-in-a-same-sheet","dir":"Articles","previous_headings":"Examples gallery","what":"5. Export a list of several data frames to an xlsx file (several data frames in a same sheet)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"tb1 <- data.frame(tables = c(rep(\"iris\",5),rep(\"cars\",2)), var = c(names(iris),names(cars))) tb2 <- data.frame(tables = c(\"iris\",\"cars\",\"cars\"), rownumber = c(150,50,32)) list(tb1,tb2) %>% toxlsx(tosheet = list(\"tb1\" = \"mydata\", \"tb2\" = \"mydata\"), footnote1 = list(\"tb1\" = \"The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant.\", \"tb2\" = \"The data give the speed of cars and the distances taken to stop. Note that the data were recorded in the 1920s.\"), footnote2 = list(\"tb1\" = \"Predicted attribute: class of iris plant.\", \"tb2\" = \"Data recorded in the 1920s\"), footnote3 = list(\"tb1\" = \"Source : R.A. Fisher\", \"tb2\" = \"Source : M. Ezekiel\"), path=mypath)"},{"path":"/articles/aa-examples.html","id":"export-a-list-of-data-frames-to-an-named-xlsx-file-by-specifying-which-data-frame-goes-in-which-sheet-styling-each-column-giving-a-title-and-footnotes","dir":"Articles","previous_headings":"Examples gallery","what":"6. Export a list of data frames to an named xlsx file by specifying which data frame goes in which sheet, styling each column, giving a title and footnotes…","title":"Examples gallery","text":"equivalent {openxlsx} syntax much longer painful write. See equivalent sixth example. Preview xlsx file LibreOffice Calc :","code":"iris <- iris %>% head() cars <- cars %>% head() list(iris,cars) %>% toxlsx(tosheet = list(\"iris\" = \"first\", \"cars\" = \"second\"), title = list(\"iris\" = \"Head of iris\", \"cars\" = \"Head of cars\"), # The `columnstyle` argument is optional in toxlsx(). # It is used only if you want to specify the format of each column columnstyle = list(\"iris\" = list(\"c1\" = \"decimal\", \"c2\" = \"decimal\", \"c3\" = \"number\", \"c4\" = \"number\", \"c5\" = \"character\"), \"cars\" = list(\"c1\" = \"number\", \"c2\" = \"number\")), footnote1 = list(\"iris\" = \"The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant.\", \"cars\" = \"The data give the speed of cars and the distances taken to stop. Note that the data were recorded in the 1920s.\"), footnote2 = list(\"iris\" = \"Predicted attribute: class of iris plant.\", \"cars\" = \"Data recorded in the 1920s\"), footnote3 = list(\"iris\" = \"Source : R.A. Fisher\", \"cars\" = \"Source : M. Ezekiel\"), filename = \"Results\", path = mypath)"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Damien Dotta. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Dotta D (2023). tablexlsx: Export Data Frames Excel Workbook. https://ddotta.github.io/tablexlsx/, https://github.com/ddotta/tablexlsx.","code":"@Manual{, title = {tablexlsx: Export Data Frames to Excel Workbook}, author = {Damien Dotta}, year = {2023}, note = {https://ddotta.github.io/tablexlsx/, https://github.com/ddotta/tablexlsx}, }"},{"path":"/index.html","id":"package-package-tablexlsx-","dir":"","previous_headings":"","what":"Export Data Frames to Excel Workbook","title":"Export Data Frames to Excel Workbook","text":"R package allows export data frames R xslx workbooks.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Export Data Frames to Excel Workbook","text":"install tablexlsx CRAN : alternatively install development version GitHub : load :","code":"install.packages(\"tablexlsx\") remotes::install_github(\"ddotta/tablexlsx\") library(tablexlsx)"},{"path":"/index.html","id":"why-this-package-","dir":"","previous_headings":"","what":"Why this package ?","title":"Export Data Frames to Excel Workbook","text":"package wrapper functions great openxlsx package. purpose package meet needs R users want export data frames xlsx files share data results users necessarily R users. goal get API simple possible use. ’s intended meet needs users want create clean, well-documented xlsx files (title footnotes). package improved time include new features based needs expressed users. , feel free open issue .","code":""},{"path":"/index.html","id":"advantages","dir":"","previous_headings":"","what":"Advantages","title":"Export Data Frames to Excel Workbook","text":"advantages using package : simpler syntax common export operations excel files; can write several data frames sheet one ; can merge modalities one several columns; can automatically open files soon created can inspect workbook; Data frames exported xlsx files can passed argument functions simple tables list tables; main function package toxlsx() works interchangeably %>% |> operators 3 syntaxes equivalent : 👉 , see examples gallery vignette 🔎","code":"toxlsx(object = iris, path = mypath) iris |> toxlsx(path = mypath) iris %>% toxlsx(path = mypath)"},{"path":"/reference/add_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"Function adds data frame (existing) .xlsx workbook sheet","code":""},{"path":"/reference/add_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"","code":"add_table( Table, WbTitle, SheetTitle, TableTitle, StartRow = 1, StartCol = 1, FormatList = list(), HeightTableTitle = 2, TableFootnote1 = list(), TableFootnote2 = list(), TableFootnote3 = list() )"},{"path":"/reference/add_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"Table : data frame exported workbook sheet WbTitle : workbook SheetTitle : string used sheet's name TableTitle : string used data frame's title StartRow : export start line number sheet (default 1) StartCol : export start column number sheet (default 1) FormatList : list indicates format column data frame HeightTableTitle : multiplier (needed) height title line (default 2) TableFootnote1 : string TableFootnote1 TableFootnote2 : string TableFootnote2 TableFootnote3 : string TableFootnote3","code":""},{"path":"/reference/add_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"excel wb object","code":""},{"path":"/reference/style.html","id":null,"dir":"Reference","previous_headings":"","what":"An R list that contains the styles of each element for formatting data frames in excel files — style","title":"An R list that contains the styles of each element for formatting data frames in excel files — style","text":"R list contains styles element formatting data frames excel files","code":""},{"path":"/reference/style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"An R list that contains the styles of each element for formatting data frames in excel files — style","text":"","code":"style"},{"path":"/reference/style.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"An R list that contains the styles of each element for formatting data frames in excel files — style","text":"list several items title Style title footnote1 Style footnote1 footnote2 Style footnote2 footnote3 Style footnote3 col_header Style col_header character Style columns character format number Style columns number format decimal Style columns character format decimals percent Style columns percent format","code":""},{"path":"/reference/tablexlsx-package.html","id":null,"dir":"Reference","previous_headings":"","what":"tablexlsx: Export Data Frames to Excel Workbook — tablexlsx-package","title":"tablexlsx: Export Data Frames to Excel Workbook — tablexlsx-package","text":"Collection functions allow export data frames excel workbook.","code":""},{"path":[]},{"path":"/reference/tablexlsx-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"tablexlsx: Export Data Frames to Excel Workbook — tablexlsx-package","text":"Maintainer: Damien Dotta damien.dotta@live.fr","code":""},{"path":"/reference/toxlsx.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert R data frames to excel files — toxlsx","title":"Convert R data frames to excel files — toxlsx","text":"function allows write R data frames given `object` argument excel files located `path` directory. function takes several arguments two required `object` `path`. See examples gallery : ","code":""},{"path":"/reference/toxlsx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert R data frames to excel files — toxlsx","text":"","code":"toxlsx( object, tosheet = list(), title = list(), columnstyle = list(default = NULL), footnote1 = list(), footnote2 = list(), footnote3 = list(), mergecol = NULL, path, filename = \"Export\", automaticopen = FALSE )"},{"path":"/reference/toxlsx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert R data frames to excel files — toxlsx","text":"object data.frame converted excel tosheet list sheet names element object. omitted, sheets named default \"Sheet 1\", \"Sheet 2\"... title list title element object omitted, title takes name dataframe `object` columnstyle list style columns element object useful want customise style column ` footnote1 list footnote1 element object omitted, footnote1 footnote2 list footnote2 element object omitted, footnote2 footnote3 list footnote3 element object omitted, footnote3 mergecol character vector indicates columns want merge modalities path path save excel file filename name excel file (\"Export\" default) automaticopen logical indicating excel file open automatically (FALSE default)","code":""},{"path":"/reference/toxlsx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert R data frames to excel files — toxlsx","text":"excel file","code":""},{"path":"/reference/toxlsx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert R data frames to excel files — toxlsx","text":"","code":"# Simply export a data frame to an xlsx file # For more examples, see examples gallery : # https://ddotta.github.io/tablexlsx/articles/aa-examples.html toxlsx(object = iris, path = tempdir())"},{"path":"/news/index.html","id":"tablexlsx-020","dir":"Changelog","previous_headings":"","what":"tablexlsx 0.2.0","title":"tablexlsx 0.2.0","text":"release includes : Add test check data frames exported grouped #12 Improves unit tests function toxlsx() @importFrom statements now grouped single package-tablexlsx file easier maintenance","code":""},{"path":"/news/index.html","id":"tablexlsx-010","dir":"Changelog","previous_headings":"","what":"tablexlsx 0.1.0","title":"tablexlsx 0.1.0","text":"CRAN release: 2023-02-14 Setting pkgdown website first vignette Added toxlsx() function convert data frames excel files Added add_table() function add data frames workbook Added NEWS.md file track changes package.","code":""}] +[{"path":"/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to tablexlsx development","title":"Contributing to tablexlsx development","text":"goal guide help get contributing tablexlsx quickly possible. guide divided two main pieces: Filing bug report feature request issue. Suggesting change via pull request.","code":""},{"path":"/CONTRIBUTING.html","id":"issues","dir":"","previous_headings":"","what":"Issues","title":"Contributing to tablexlsx development","text":"filing issue, important thing include minimal reproducible example can quickly verify problem, figure fix . three things need include make example reproducible: required packages, data, code. Packages loaded top script, ’s easy see ones example needs. easiest way include data use dput() generate R code recreate . example, recreate mtcars dataset R, ’d perform following steps: Run dput(mtcars) R Copy output reproducible script, type mtcars <- paste. even better can create data.frame() just handful rows columns still illustrates problem. Spend little bit time ensuring code easy others read: make sure ’ve used spaces variable names concise, informative use comments indicate problem lies best remove everything related problem. shorter code , easier understand. can check actually made reproducible example starting fresh R session pasting script . (Unless ’ve specifically asked , please don’t include output sessionInfo().)","code":""},{"path":"/CONTRIBUTING.html","id":"pull-requests","dir":"","previous_headings":"","what":"Pull requests","title":"Contributing to tablexlsx development","text":"contribute change tablexlsx, follow steps: Create branch git make changes. Push branch github issue pull request (PR). Discuss pull request. Iterate either accept PR decide ’s good fit tablexlsx. steps described detail . might feel overwhelming first time get set , gets easier practice. ’re familiar git github, please start reading http://r-pkgs..co.nz/git.html Pull requests evaluated seven point checklist: Motivation. pull request clearly concisely motivate need change. Also include motivation NEWS new release tablexlsx comes ’s easy users see ’s changed. Add item top file use markdown formatting. news item end (@yourGithubUsername, #the_issue_number). related changes. submit pull request, please check make sure haven’t accidentally included unrelated changes. make harder see exactly ’s changed, evaluate unexpected side effects. PR corresponds git branch, expect submit multiple changes make sure create multiple branches. multiple changes depend , start first one don’t submit others first one processed. ’re adding new parameters new function, ’ll also need document roxygen. Make sure re-run devtools::document() code submitting. fixing bug adding new feature, please add testthat unit test. seems like lot work don’t worry pull request isn’t perfect. pull request (“PR”) process, unless ’ve submitted past ’s unlikely pull request accepted . Many thanks advance !","code":""},{"path":[]},{"path":"/articles/aa-examples.html","id":"table-of-contents","dir":"Articles","previous_headings":"Examples gallery","what":"Table of Contents","title":"Examples gallery","text":"Simply export data frame xlsx file Export list several data frames xlsx file (data frame different sheet) Export data frame xlsx file (merging modalities one column) Export data frame xlsx file (merging modalities several columns) Export list several data frames xlsx file (several data frames sheet) Export list data frames named xlsx file specifying data frame goes sheet, styling column, giving title footnotes… Let’s define export folder examples page Important : vignette, examples use %>% pass object argument toxlsx() function, works interchangeably 3 syntaxes :","code":"mypath <- tempdir() toxlsx(object = iris, path = mypath) iris |> toxlsx(path = mypath) iris %>% toxlsx(path = mypath)"},{"path":"/articles/aa-examples.html","id":"simply-export-a-data-frame-to-an-xlsx-file","dir":"Articles","previous_headings":"Examples gallery","what":"1. Simply export a data frame to an xlsx file","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"iris %>% toxlsx(path = mypath) #> ✔ Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'"},{"path":"/articles/aa-examples.html","id":"export-a-list-of-several-data-frames-to-an-xlsx-file-each-data-frame-in-a-different-sheet","dir":"Articles","previous_headings":"Examples gallery","what":"2. Export a list of several data frames to an xlsx file (each data frame in a different sheet)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"list(iris,cars) %>% toxlsx(path = mypath) #> ✔ Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'"},{"path":"/articles/aa-examples.html","id":"export-a-data-frame-to-an-xlsx-file-merging-modalities-for-one-column","dir":"Articles","previous_headings":"Examples gallery","what":"3. Export a data frame to an xlsx file (merging modalities for one column)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"# Create df1 df1 <- data.frame( group = c(\"dupont\",\"dupont\",\"arnold\",\"arnold\"), name = c(\"toto\",\"tata\",\"tutu\",\"tete\"), volume = c(10,8,12,15) ) # Export df1 %>% toxlsx(path = mypath, mergecol = \"group\") #> ✔ Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'"},{"path":"/articles/aa-examples.html","id":"export-a-data-frame-to-an-xlsx-file-merging-modalities-for-several-columns","dir":"Articles","previous_headings":"Examples gallery","what":"4. Export a data frame to an xlsx file (merging modalities for several columns)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"# Create df2 df2 <- data.frame( country = c(rep(\"france\",4),rep(\"england\",4)), group = c(rep(\"dupont\",2),rep(\"martin\",2), rep(\"arnold\",2),rep(\"harry\",2)), name = c(\"toto\",\"tata\",\"tutu\",\"tete\", \"momo\",\"mama\",\"mumu\",\"meme\"), volume = c(10,8,12,15, 14,10,5,12) ) # Export df2 %>% toxlsx(path = mypath, mergecol = c(\"country\",\"group\")) #> ✔ Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'"},{"path":"/articles/aa-examples.html","id":"export-a-list-of-several-data-frames-to-an-xlsx-file-several-data-frames-in-a-same-sheet","dir":"Articles","previous_headings":"Examples gallery","what":"5. Export a list of several data frames to an xlsx file (several data frames in a same sheet)","title":"Examples gallery","text":"Preview xlsx file LibreOffice Calc :","code":"tb1 <- data.frame(tables = c(rep(\"iris\",5),rep(\"cars\",2)), var = c(names(iris),names(cars))) tb2 <- data.frame(tables = c(\"iris\",\"cars\",\"cars\"), rownumber = c(150,50,32)) list(tb1,tb2) %>% toxlsx(tosheet = list(\"tb1\" = \"mydata\", \"tb2\" = \"mydata\"), footnote1 = list(\"tb1\" = \"The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant.\", \"tb2\" = \"The data give the speed of cars and the distances taken to stop. Note that the data were recorded in the 1920s.\"), footnote2 = list(\"tb1\" = \"Predicted attribute: class of iris plant.\", \"tb2\" = \"Data recorded in the 1920s\"), footnote3 = list(\"tb1\" = \"Source : R.A. Fisher\", \"tb2\" = \"Source : M. Ezekiel\"), path=mypath) #> ✔ Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpEaogXo'"},{"path":"/articles/aa-examples.html","id":"export-a-list-of-data-frames-to-an-named-xlsx-file-by-specifying-which-data-frame-goes-in-which-sheet-styling-each-column-giving-a-title-and-footnotes","dir":"Articles","previous_headings":"Examples gallery","what":"6. Export a list of data frames to an named xlsx file by specifying which data frame goes in which sheet, styling each column, giving a title and footnotes…","title":"Examples gallery","text":"equivalent {openxlsx} syntax much longer painful write. See equivalent sixth example. Preview xlsx file LibreOffice Calc :","code":"iris <- iris %>% head() cars <- cars %>% head() list(iris,cars) %>% toxlsx(tosheet = list(\"iris\" = \"first\", \"cars\" = \"second\"), title = list(\"iris\" = \"Head of iris\", \"cars\" = \"Head of cars\"), # The `columnstyle` argument is optional in toxlsx(). # It is used only if you want to specify the format of each column columnstyle = list(\"iris\" = list(\"c1\" = \"decimal\", \"c2\" = \"decimal\", \"c3\" = \"number\", \"c4\" = \"number\", \"c5\" = \"character\"), \"cars\" = list(\"c1\" = \"number\", \"c2\" = \"number\")), footnote1 = list(\"iris\" = \"The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant.\", \"cars\" = \"The data give the speed of cars and the distances taken to stop. Note that the data were recorded in the 1920s.\"), footnote2 = list(\"iris\" = \"Predicted attribute: class of iris plant.\", \"cars\" = \"Data recorded in the 1920s\"), footnote3 = list(\"iris\" = \"Source : R.A. Fisher\", \"cars\" = \"Source : M. Ezekiel\"), filename = \"Results\", path = mypath) #> ✔ Your Excel file 'Results.xlsx' is available in the folder '/tmp/RtmpEaogXo'"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Damien Dotta. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Dotta D (2023). tablexlsx: Export Data Frames Excel Workbook. https://ddotta.github.io/tablexlsx/, https://github.com/ddotta/tablexlsx.","code":"@Manual{, title = {tablexlsx: Export Data Frames to Excel Workbook}, author = {Damien Dotta}, year = {2023}, note = {https://ddotta.github.io/tablexlsx/, https://github.com/ddotta/tablexlsx}, }"},{"path":"/index.html","id":"package-package-tablexlsx-","dir":"","previous_headings":"","what":"Export Data Frames to Excel Workbook","title":"Export Data Frames to Excel Workbook","text":"R package allows export data frames R xslx workbooks.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Export Data Frames to Excel Workbook","text":"install tablexlsx CRAN : alternatively install development version GitHub : load :","code":"install.packages(\"tablexlsx\") remotes::install_github(\"ddotta/tablexlsx\") library(tablexlsx)"},{"path":"/index.html","id":"why-this-package-","dir":"","previous_headings":"","what":"Why this package ?","title":"Export Data Frames to Excel Workbook","text":"package wrapper functions great openxlsx package. purpose package meet needs R users want export data frames xlsx files share data results users necessarily R users. goal get API simple possible use. ’s intended meet needs users want create clean, well-documented xlsx files (title footnotes). package improved time include new features based needs expressed users. , feel free open issue .","code":""},{"path":"/index.html","id":"advantages","dir":"","previous_headings":"","what":"Advantages","title":"Export Data Frames to Excel Workbook","text":"advantages using package : simpler syntax common export operations excel files; can write several data frames sheet one ; can merge modalities one several columns; can automatically open files soon created can inspect workbook; Data frames exported xlsx files can passed argument functions simple tables list tables; main function package toxlsx() works interchangeably %>% |> operators 3 syntaxes equivalent : 👉 , see examples gallery vignette 🔎","code":"toxlsx(object = iris, path = mypath) iris |> toxlsx(path = mypath) iris %>% toxlsx(path = mypath)"},{"path":"/reference/add_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"Function adds data frame (existing) .xlsx workbook sheet","code":""},{"path":"/reference/add_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"","code":"add_table( Table, WbTitle, SheetTitle, TableTitle, StartRow = 1, StartCol = 1, FormatList = list(), HeightTableTitle = 2, TableFootnote1 = list(), TableFootnote2 = list(), TableFootnote3 = list() )"},{"path":"/reference/add_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"Table : data frame exported workbook sheet WbTitle : workbook SheetTitle : string used sheet's name TableTitle : string used data frame's title StartRow : export start line number sheet (default 1) StartCol : export start column number sheet (default 1) FormatList : list indicates format column data frame HeightTableTitle : multiplier (needed) height title line (default 2) TableFootnote1 : string TableFootnote1 TableFootnote2 : string TableFootnote2 TableFootnote3 : string TableFootnote3","code":""},{"path":"/reference/add_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function that adds a data frame to an (existing) .xlsx workbook sheet — add_table","text":"excel wb object","code":""},{"path":"/reference/style.html","id":null,"dir":"Reference","previous_headings":"","what":"An R list that contains the styles of each element for formatting data frames in excel files — style","title":"An R list that contains the styles of each element for formatting data frames in excel files — style","text":"R list contains styles element formatting data frames excel files","code":""},{"path":"/reference/style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"An R list that contains the styles of each element for formatting data frames in excel files — style","text":"","code":"style"},{"path":"/reference/style.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"An R list that contains the styles of each element for formatting data frames in excel files — style","text":"list several items title Style title footnote1 Style footnote1 footnote2 Style footnote2 footnote3 Style footnote3 col_header Style col_header character Style columns character format number Style columns number format decimal Style columns character format decimals percent Style columns percent format","code":""},{"path":"/reference/tablexlsx-package.html","id":null,"dir":"Reference","previous_headings":"","what":"tablexlsx: Export Data Frames to Excel Workbook — tablexlsx-package","title":"tablexlsx: Export Data Frames to Excel Workbook — tablexlsx-package","text":"Collection functions allow export data frames excel workbook.","code":""},{"path":[]},{"path":"/reference/tablexlsx-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"tablexlsx: Export Data Frames to Excel Workbook — tablexlsx-package","text":"Maintainer: Damien Dotta damien.dotta@live.fr","code":""},{"path":"/reference/toxlsx.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert R data frames to excel files — toxlsx","title":"Convert R data frames to excel files — toxlsx","text":"function allows write R data frames given `object` argument excel files located `path` directory. function takes several arguments two required `object` `path`. See examples gallery : ","code":""},{"path":"/reference/toxlsx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert R data frames to excel files — toxlsx","text":"","code":"toxlsx( object, tosheet = list(), title = list(), columnstyle = list(default = NULL), footnote1 = list(), footnote2 = list(), footnote3 = list(), mergecol = NULL, path, filename = \"Export\", automaticopen = FALSE )"},{"path":"/reference/toxlsx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert R data frames to excel files — toxlsx","text":"object data.frame converted excel tosheet list sheet names element object. omitted, sheets named default \"Sheet 1\", \"Sheet 2\"... title list title element object omitted, title takes name dataframe `object` columnstyle list style columns element object useful want customise style column ` footnote1 list footnote1 element object omitted, footnote1 footnote2 list footnote2 element object omitted, footnote2 footnote3 list footnote3 element object omitted, footnote3 mergecol character vector indicates columns want merge modalities path path save excel file filename name excel file (\"Export\" default) automaticopen logical indicating excel file open automatically (FALSE default)","code":""},{"path":"/reference/toxlsx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert R data frames to excel files — toxlsx","text":"excel file","code":""},{"path":"/reference/toxlsx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert R data frames to excel files — toxlsx","text":"","code":"# Simply export a data frame to an xlsx file # For more examples, see examples gallery : # https://ddotta.github.io/tablexlsx/articles/aa-examples.html toxlsx(object = iris, path = tempdir()) #> ✔ Your Excel file 'Export.xlsx' is available in the folder '/tmp/RtmpSjMR86'"},{"path":"/news/index.html","id":"tablexlsx-021","dir":"Changelog","previous_headings":"","what":"tablexlsx 0.2.1","title":"tablexlsx 0.2.1","text":"release includes : Use {cli} alert messages users case success","code":""},{"path":"/news/index.html","id":"tablexlsx-020","dir":"Changelog","previous_headings":"","what":"tablexlsx 0.2.0","title":"tablexlsx 0.2.0","text":"release includes : Add test check data frames exported grouped #12 Improves unit tests function toxlsx() @importFrom statements now grouped single package-tablexlsx file easier maintenance","code":""},{"path":"/news/index.html","id":"tablexlsx-010","dir":"Changelog","previous_headings":"","what":"tablexlsx 0.1.0","title":"tablexlsx 0.1.0","text":"CRAN release: 2023-02-14 Setting pkgdown website first vignette Added toxlsx() function convert data frames excel files Added add_table() function add data frames workbook Added NEWS.md file track changes package.","code":""}]