Questions tagged [r-xlsx]

The xlsx library in R has capabilities for reading and writing Microsoft Excel files

From CRAN:

Provide R functions to read/write/format Excel 2007 and Excel 97/2000/XP/2003 file formats.

xlsx uses Java (through rJava) on the back end to read and write .xls and .xlsx files.

Package written and maintained by Adrian Dragulescu.

126 questions
0
votes
1 answer

read a single *.xlsx file in R without the use of filename but utilizing the *.xlsx

I download an xlxs file everyday with a long unique name with dates each day. I need R to read the new xlsx file saved in the directory everyday without typing the unique name everyday. My idea is to utilize the *.xlsx but whenever I try it, it…
doubleD
  • 269
  • 1
  • 12
0
votes
1 answer

Adding a dataframe to a sheet without xlsx package

I'm currently using xlsx package to create and modify Excel files but I need to get rid of Java dependency. I've tried swapping the xlsx package for the openxlsx package but I can't find any simple way to replace addDataFrame function. My code looks…
Czyycz
  • 1
0
votes
2 answers

Exporting R 3 dataframes to 3 different sheets in the same excel workbook

I am attempting to export 3 dataframes to 3 different sheets in the same excel workbook, this is the code I used: write.xlsx(x = df1,file = "Report.xlsx",sheetName = "pr1") write.xlsx(x = df2,file = "Report.xlsx",sheetName = "pr2", append =…
0
votes
1 answer

R - Add text to merged cell using xlsx package

I have created a merged cell in an excel file using the xlsx package in R. I'd like to write text in this merged cell and have tried the code below, however this leaves the cell blank, with no text anywhere in that worksheet. wb =…
Harry
  • 129
  • 4
0
votes
0 answers

using read.xlsx on R yield errors

I'm trying to run a line of code in R with read.xlsx taken from xlsx package. it used to work fine but something has changed but I'm not sure what. df_sheet <- xlsx::read.xlsx(lane_info, sheetIndex = 1, startRow=5 ,colIndex =…
hamaor
  • 41
  • 1
  • 6
0
votes
1 answer

How to fill an excel file using R, while in the excel file

I'm trying to access an R script via an Excel file. That is, while I'm still in the Excel file, I'd like to run an R script, that fills that same Excel file. The reason for this is that Excel is not computationally efficient enough. Now I know that…
Whizkid95
  • 271
  • 4
  • 14
0
votes
1 answer

R - Export data with English and Chinese words together to a CSV file

How can I export a data frame that has both English and Chinese words to a csv file? When I normally export it or even when I use a UTF-8 encoding to export the Chinese words are displayed as the following…
Ibo
  • 4,081
  • 6
  • 45
  • 65
0
votes
1 answer

Writing data from for loop to one excel sheet

I'm trying to write data from my for loop to excel file in a way that the data is in one sheet. I've been using the xlsx library but for some reason adding the APPEND = TRUE doesn't do the trick. An example of what I've been trying to do:…
Orion
  • 65
  • 1
  • 9
0
votes
1 answer

Remove space from exported filename in R using xlsx package

Trying to export a file using write.xlsx() from package "xlsx". File export works as expected, however having trouble with the naming convention. I wish for the file to be names as follows: filename .xlsx At present I can do either…
jimiclapton
  • 775
  • 3
  • 14
  • 42
0
votes
1 answer

How to deal with "Java Heap Space" error while running rjava

I am using rJava package in R on MacOS. This error happened: Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.lang.OutOfMemoryError: Java heap space I need rJava to open an Excel file with xlsx package. With this…
Hans Wang
  • 25
  • 3
0
votes
1 answer

How to handle "write.xlsx" error: arguments imply differing number of rows

I'm trying to write an xlsx file from a list of dataframes that I created but I'm getting an error due to missing data (I couldn't download it). I just want to write the xlsx file besides having this lacking data. Any help is appreciated. For…
Artur Dutra
  • 515
  • 3
  • 18
0
votes
1 answer

read.xlsx Error in loadWorkbook(file, password = password) : Cannot find

I am trying to open the .xls file from this link 'https://www.ons.gov.uk/file?uri=/economy/grossvalueaddedgva/datasets/regionalgvaibylocalauthorityintheuk/1997to2015/regionalgvaibylainuk.xls' with the package 'xlsx', but it does not seem to be…
Daniel
  • 471
  • 3
  • 8
  • 18
0
votes
1 answer

How to use xlsx package to insert blank column in Excel

How can I insert a blank column into an existing Excel file while retaining the data in that column? I have time series data across multiple columns (one year per column) with summary data at the end (Min, Max, Percentiles). I want to use R to…
AZaremba
  • 3
  • 2
0
votes
1 answer

Trouble with installing r2excel package in R

I am trying to install r2excel package in R via install_github but I get this error > install_github("kassambara/r2excel") several lines appearing in the console and I get * installing *source* package 'r2excel' ... ** R ** preparing package for…
PHNM
  • 25
  • 6
0
votes
1 answer

Formatting entire sheet with specific style with R and xlsx

With R and xlsx, I know I can format the cell style using the following: STYLE <- CellStyle(wb) + Font(wb, heightInPoints = 14, name = "Arial") setCellStyle(cells[[2,2]], STYLE) However, I would like the entire sheet to be of this format. I don't…
delita
  • 1,571
  • 1
  • 19
  • 25
1 2 3
8 9