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
2
votes
1 answer

Import cells without strikeout from xlsx

I'm trying to import an excel file avoiding cell that have a strikeout as style, but I'm not sure of how to do it. I know that in the library XLConnect there is a function getCellStyle but I cannot find much documentation on how to use it with a…
Barbara
  • 1,118
  • 2
  • 11
  • 34
2
votes
0 answers

Copy an existing worksheet to another workbook using xlsx package

I have a default workbook with my company logo and formating already in place, in order to quickly generate workbooks to my clients, without having to reformat everything all the time. I manage to do it for a single sheet. I would like to do it for…
Felipe Alvarenga
  • 2,572
  • 1
  • 17
  • 36
2
votes
1 answer

R dies unexpectedly with segmentation fault when loading 'xlsx' and 'caret' in that order

When I load xlsx followed by caret, R dies with segmentation fault. > library("xlsx") Loading required package: rJava Loading required package: xlsxjars > library(caret) Loading required package: lattice Loading required package:…
user2196452
  • 361
  • 2
  • 16
2
votes
0 answers

Write.xlsx: Convert output to numeric

Please see write.xlsx(a, OutFile, row.names = F) that falls on the end of the script below. Instead of outputting numeric data to the Excel file, the data is stored as text in the Excel output. What is the most seamless way to convert the output…
ZJAY
  • 2,517
  • 9
  • 32
  • 51
2
votes
1 answer

XLConnect: Attaching to 64 bit R

I have a need to export some R data to formatted excel files and have successfully used both the XLConnect and xlsx packages in R before. I recently moved to 64 bit R and can't get either to work. I worked through some Oracle/Java architecture…
justin a
  • 21
  • 3
2
votes
1 answer

Conditional Formatting using openxlsx package in R

I am applying conditional formatting to an excel sheet using OPENXLSX package in R. My code is something like this : posStyle <- createStyle(fontColour = "#006100", bgFill = "#C6EFCE") conditionalFormatting(wb=wb1, sheet='sheet1', cols=1:10,…
Prathamesh
  • 97
  • 2
  • 8
2
votes
0 answers

Can someone help me about this error? I am trying to import data frame from html page in Excel file

library(xlsx) write.xlsx(x = link.table, file = "actual1.xlsx",sheetName = "TestSheet", row.names = FALSE) save(link.table,file="actual.Rda") I get this output: library(xlsx) write.xlsx(x = link.table, file = "actual1.xlsx",sheetName ="TestSheet",…
Harshit17
  • 63
  • 6
2
votes
1 answer

data type with read.xlsx in R

I am using xlsx library in R to read a excel sheet. I used the following command. My data are numeric/floats with NA for missing values and first column as name (string/character type). However, all the column are of type character and I could not…
user1430763
  • 37
  • 1
  • 8
2
votes
1 answer

R read.xlsx colClasses issue

I am having a problem using the colClasses function in read.xlsx I have the following data.frame mydata <- read.xlsx("dataset_1.xlsx", sheetName = "dataset_1") head(mydata) Treatment Nitrate_conc 1 1 12 2 1 12 3 …
Rory Shaw
  • 811
  • 2
  • 9
  • 26
2
votes
1 answer

Java heap space error in R 32 bit

I am facing an error in R while trying to use read.xlsx function from package xlsx. Error says " Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.lang.OutOfMemoryError: Java heap space I have tried using openxlsx…
2
votes
2 answers

read.xlsx takes a very long time and tons of memory

I'm trying to load an .xlsx file into R that has one sheet and is about 31 MB in size. I run the following options( java.parameters = "-Xmx6g" ) require(xlsx) yt = read.xlsx("big_spreadsheet.xlsx",1) and I get nothing. My system monitor program…
shadowtalker
  • 12,529
  • 3
  • 53
  • 96
1
vote
1 answer

Exporting several tibbles to separate sheets in excel

I'm looking for a way to automate some data clean-up. So far, I've figured out how to import several excel workbooks and all their sheets into R using the following: my_data = expand_grid( file = list.files("~path", full.names = TRUE), …
1
vote
0 answers

Apple M1 - Cannot Load rJava for xlsx package in R

I am currently working on an assignment that requires me to utilize the xlsx package in R. I have installed both "xlsx" and "rJava" packages, and have installed the most recent edition of Java to my computer. However, when I try to load the "xlsx"…
JStark
  • 11
  • 1
1
vote
1 answer

Combining multiple worksheets from multiple excel workbooks into a single workbook via. R

Lets say I have two excel workbooks (e.g. A.xlsx and B.xlsx) that each contain multiple worksheets (e.g. "a1" and "a2" in A.xlsx; "b1", "b2", and "b3" in B.xlsx). Note that these worksheets all have their own conditional formatting, filtering, zoom,…
user3624032
  • 59
  • 1
  • 5
1
vote
2 answers

Use R to write multiple sheets in excel with dynamic sheetNames

This can easily be done using for loop but I am looking for a solution with lapply or dplyr. I have multiple dataframes which I want to export to excel file in separate sheets (I saw many questions and answers on similar lines but couldn't find one…
Dayne
  • 463
  • 3
  • 12
1 2
3
8 9