26 questions
1
vote
0
answers
97
views
Why is wb_add_comment throwing an error when trying to add comments across multiple columns using openxlsx2? [duplicate]
I have a dataframe which I am trying to export to Excel with formatting and comments. To do this I have created a custom function using functions in the `openxlsx2' package to add color fill and/or ...
3
votes
1
answer
98
views
How do I apply a font style I created to a range of cells with openxlsx2?
I want to apply a format I created using the create_font method to one or two ranges of cells, but I can't figure out how to use it. I've tried many ways, but unfortunately, without success.
My goal ...
0
votes
0
answers
85
views
openxlsx: Writing multi-column XLOOKUP formulas produces unexpected @ or {} in Excel
I’m trying to use the R package openxlsx to map data from one sheet (Source) to another (Target) in Excel using XLOOKUP. The idea is to use multiple key columns to perform the lookup.
Here is the ...
0
votes
0
answers
27
views
Adjust workflow between openxlsx2 (R) into Tableau
I have a dataset that I put through the following workflow:
Raw data is .xlsx
Clean data using R
Write to a specific sheet in an existing Excel file using openxlsx2 (My colleagues use other tabs in ...
1
vote
1
answer
83
views
Preventing cell widths from exceeding the size of a page in Excel using openxlsx2
I'm building and styling a workbook using the openxlsx2 package, and I'm struggling with getting my column widths to not exceed the length of the printable area in the final excel workbook. I ...
2
votes
1
answer
55
views
openxlsx2 and group_rows function. Warning messages: "...number of items to replace is not a multiple of replacement length"
I'm producing Excel workbooks with openxlsx2. Typically, I'll write a data table to my workbook and include a totals row:
packages <- c("openxlsx2")
lapply(packages, library, character....
1
vote
1
answer
117
views
Handeling of missing values (NA) in a column of hyperlinks with openxlsx2
I would like to create an Excel sheet which has columns containing hyperlinks and missing values (NA's).
library(openxlsx2)
options(openxlsx2.na.strings = "")
dat <- data.frame(link = c(&...
1
vote
1
answer
76
views
Centering an image on merged cells on openxlsx2 package in R
I have been trying to center an image on merged cells using the openxlsx2 package in R. The image's default is the top-left corner of the merged cell. In the wb$add_image, if I specify the merged ...
0
votes
1
answer
31
views
Replacing a string when writing to setHeaderFooter() in openxlsx
I am writing datasets to Excel using the openxlsx and openxlsx2 packages. The report generated from this code has to be updated on a monthly basis, so the header/footer annotations need to reflect ...
2
votes
1
answer
566
views
Is there an R function to wrap text within a cell in an Excel output?
I'm writing a script to render an Excel output using openxlsx, and I'm having a hard time wrapping text within a cell.
I have a "Report Notes" sheet in my output with the usual disclaimers ...
0
votes
0
answers
147
views
Changing font colour in XLSX file preserving all other style features using openxlsx2
Necessary preamble that will explain my clumsy syntax below: I am a novice with R and having developed in Python for ages I find the R syntax to be unclear form a OOP perspective (i.e. hard to find ...
0
votes
1
answer
143
views
how I can customize font color using conditional format in openxlsx2 in r?
Hi and thanks for reading me
Im currently working in an excel file with a conditional format using R and the package openxlsx2, but when I add the style I get an error in the document output. My code ...
0
votes
0
answers
44
views
check if sheet in wb_workbook openxlsx2 contains data
I would like to write tables to sheets in case there are no data yet and to continue the Rscript in case that there is already data in the sheet.
Similar to the way I add sheets if they don't exist
...
0
votes
2
answers
332
views
Use openxlsx2 to color specific rows in a vector of indexes
I have a data frame that I want to save into XLSX format using openxlsx2.
This data frame contains entries with specific columns with identical values.
I want to highlight those entries (the whole row)...
2
votes
2
answers
99
views
Openxlsx2: Ability to create_speaklines in a group
I'm using openxlsx2 in R/Posit to create sparklines and hoping to create one group all at once. Excel allows the user to edit a group of sparklines at one time which makes it easier than editing a ...
0
votes
1
answer
469
views
Cannot write to a worksheet with openxlsx2
Here's my reprex
library(openxlsx2)
wb <- openxlsx2::wb_workbook()
openxlsx2::wb_add_worksheet(wb, "All Courses")
allLines = c("This is the first test",
"...
0
votes
1
answer
195
views
How to write out a dataframe or vector horizontally to excel using openxlsx2 in R
It feels like I am missing something easy here, but I want to write out data in Excel horizontally as opposed to vertically.
I am using openxlsx2 to automate the creation of some spreadsheets.
...
2
votes
1
answer
521
views
Bug importing with openxlsx2 in R?
I find openxlsx2 a very interesting package, it's very useful how you can import a workbook keeping styles.
I just wondering if it is a bug or I'm doing something wrong for the very simple task of ...
0
votes
0
answers
440
views
Cannot export or save workbook with openxlsx2 in R
I'm trying to export my workbook object with openxlsx2 package, but I got an error message as following.
dat2 = wb_load("data.xlsx" ,data_only = F, calc_chain = T)
num = c(600000,12340)
...
3
votes
1
answer
276
views
Openxlsx2 Pivot Table Layout Options
I am wondering if there is (or will be) a way to change the layout of a pivot table. For example, I would like my pivot table to print without Subtotals and in Tabular form like in the picture:
Excel ...
-1
votes
1
answer
141
views
How can i create and export a calculated field using wb_add_pivot_table from openxlsx2
I tried to create a proportion among total setoff and total collectable using openxlsx2:add_pivot_table .
library(pivottabler)
library(openxlsx2)
wbs <- wb_workbook()$add_worksheet()$add_data(x = ...
0
votes
1
answer
142
views
How can I use group_walk() to write xlsx files formatted to openxlsx2 wb objects?
I am trying to use group_walk() with openxlsx2 workbook objects to produce multiple xlsx files with greater control of the worksheet properties.
I can use the code below to create simple xlsx files...
...
0
votes
1
answer
356
views
How can I write a formula in data table in openxlsx2
I am trying to create a new column within a datatable that will essentially act like a "Text to Columns" in Excel. But when I try, it just writes the formula in a column outside the table ...
0
votes
1
answer
333
views
Order values inside a pivot table in openxlsx2
I´m using openxlsx2 so that I can use the function wb_add_pivot_table() but the problem is that the order in which the rows appear, inside the pivot table, isn't in the order I want it to be displayed....
0
votes
1
answer
666
views
Formatting a pivot table in OpenXLSX2 in R
I'm trying to add borders and a number format and a sort by units to a pivot table built with the wb_add_pivot_table function in openXLSX2, but the pivot table seems to overwrite the styling? I write ...
0
votes
1
answer
361
views
Adding slicers using OpenXLSX2 in R
I'm using OpenXLSX2 in R to process some data and then output a formatted workbook. I have a pivot table that I would like to connect slicers to - I'm wondering if this is possible using OpenXLSX2. ...