Questions tagged [openxlsx]

Use this tag for questions related to the openxlsx package. The openxlsx package provides functions to make it easy to read, write and edit XLSX Files in the R programming language.

The package simplifies the creation of Excel files in the programming language by providing a high level interface to writing, styling and editing worksheets. Through the use of , read/write times are comparable to the xlsx () and packages with the added benefit of removing the dependency on Java.

For more information on the package see:

Original author: Alex Walker
Current maintainer: Philipp Schauberger

410 questions
0
votes
1 answer

How to Auto Size column in excel to multiple sheets using openxlsx in R

I have an excel document with 15 sheets that I update monthly. Currently, I have been reading in the document and manipulating it as follows sheetNames <- openxlsx::getSheetNames("myDoc.xlsx") oldData <- lapply(sheetNames, function(x)…
Jacob
  • 406
  • 3
  • 19
0
votes
1 answer

How can I write a data frame to excel without cells overlapping

I have a data frame to write to excel but I'm struggling to fit the border around a cell. If a cell of a data frame is overlapping with another cell, I want to merge the columns together and the same for it's column name. Here is a reproducible…
Ali
  • 1,048
  • 8
  • 19
0
votes
1 answer

Missing terminating ' character

I'm trying to use a library called OPENXLSX in my QtCreator project. When I go to build I get 3 errors: missing terminating ' character expected ‘,’ or ‘;’ before '\x303438' expected ‘,’ or ‘;’ before ‘constexpr’ They complain of these 3 lines in…
GTA.sprx
  • 817
  • 1
  • 8
  • 24
0
votes
1 answer

Using saveWorkbook (from openxlsx) get Error

Tested with a simple data frame as input, i think it might be the Excel file itself. workbook <- loadWorkbook(filepath, xlsxFile = NULL, isUnzipped = FALSE) writeData(workbook, "Test1", al, startCol = 2, startRow = 5, colNames =…
HarmenD
  • 56
  • 7
0
votes
2 answers

insertImage function failure (R package "openxlsx")

I'm having trouble with the insertImage function in R package openxlsx. Every time I insert a new image, all the other images in the document collapse and don't show. Any ideas?
0
votes
1 answer

seaching all excel files with os.walk (), then call the function to read this excel, How can I do it?

I created a function to read excel sheet read_Excel_file(path) that return a list contains some data from a specific Column. and in the main code I search all the excel files (where the name start Design) and this excel file should be saved in a…
Merkhan
  • 15
  • 8
0
votes
0 answers

How to apply openxlsx number format to rbind data frame

I have a dataframe that I have applied a space between each group in a given category using the following code. DF2 <- head(do.call(rbind, by(DF, DF$AcctName, rbind,"")), -1) Whenever I try to use DF2 in an openxlsx script with the following number…
Brandon
  • 47
  • 5
0
votes
1 answer

Function with openxlsx works on R console but fails in Shiny

I'm trying to write a function to wrap up some data frames for export to Excel using the openxlsx package. It fails when running from a downloadHandler function in a Shiny app, but runs fine on the console in R. Regular R script that runs…
bcarothers
  • 824
  • 8
  • 19
0
votes
1 answer

HOWTO Save a data.frame to Excel with Openxlsx and then reuse

I added a small example to demonstrate the issue library("readxl") library("openxlsx") df <- data.frame(QN=1, ST = "String", EL=cbind(list(c("Var1", "Var2"))), BL=FALSE) cat(paste0("\nQ=", as.numeric(df$QN[[1]]))) cat(paste0("\nST=",…
NewAtThis
  • 45
  • 5
0
votes
0 answers

Adding a dataframe to a newly created sheet in multi-sheet excel file using openxlsx

I am trying to create and fill an excel sheet. First, I load a huge xlsx file with many sheets (test4.xlsx). Afterwards I create an empty sheet and than fill it out with a relatively large DataFrame (5000 rows and 80 columns). The first three lines…
And_R
  • 1,647
  • 3
  • 18
  • 32
0
votes
0 answers

Trying to create a function where you merge rows in a column in the eventual excel spreadsheet

I'm trying to create a basic function to do some repeating tasks in some excel/CSV analysis, using the OpenXLSX package, just to automate some analysis, and I'm just doing some formatting to make it more…
OfTheAzureSky
  • 83
  • 1
  • 8
0
votes
1 answer

I am trying to read only the tail of multiple .xlsx files merged into a data.frame of lists

I am trying to merge multiple .xlsx sheets together into one data file within r, but extracting only the last row of each sheet. I am a clinical academic, and we current have a prediction algorithm implemented via a macro-enabled excel spreadsheet.…
Charlie R
  • 7
  • 2
0
votes
2 answers

Error in converting excel data to Json string. FileReader.onload not working

I am Using XLSX npm package to read the data from Excel and convert into JSON format I'm using Angular 7. const reader = new FileReader(); const file = ev.target.files[0]; reader.onload = (event) => { const data =…
0
votes
2 answers

Can write.xlsx write multiple tabs into a file?

Within R, I am trying to print a series of dataframes into an Excel file using openxlsx. Specifically in this case, I'm using list.files, read.xlsx and write.xlsx. I'm still unable to write multiple tabs into one Excel file. Please see my code…
Grygger
  • 83
  • 6
0
votes
2 answers

R - openxlsx formatting - Is there a way to format a single cell with a 2-color gradient?

I'm replicating a manually created Excel spreadsheet, in which the users are very specific on HOW the sheet should look (exact cell spacing, exact coloring with specific conditions, margins/borders, etc). I'm able to do everything I need in R using…