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

Handling empty data frame with write.xlsx

How do I handle empty data frames when i'm using write.xlsx within a loop? Below is what the loop looks like, where source("./Scripts/Analysis_details.R") is referencing the r file where the data frames are created. library(xlsx) for (A in…
user3150260
  • 99
  • 1
  • 3
  • 12
3
votes
1 answer

exports hundreds of dataframes as xlsx using loop in R

I created hundreds of data frames in R, and I want to export them to a local position. All the names of the data frames are stored in a vector : name.vec<-c('df1','df2','df3','df4','df5','df5') each of which in name.vec is a data frame . what I…
Jia Gao
  • 1,172
  • 3
  • 13
  • 26
3
votes
1 answer

read.xlsx 'Error in loadWorkbook(file): Cannot find file' R

I am trying to read in a number of Excel files into R using read.xlsx using the xlsx package but when I do so I am getting the following error: Error in loadWorkbook(file) : Cannot find id100.xlsx First I list the files in the directory: > files…
nchimato
  • 443
  • 4
  • 8
  • 18
3
votes
4 answers

read xlsx files in Rstudio

I am taking the R programming class from Cousera, and while I was practising how to read in xlsx files using read.xlsx, I encountered the following error message: dat<- read.xlsx(file="./data/nga.xlsx", sheetIndex=1) Error in .jcall("RJavaTools",…
Gezimao
  • 47
  • 1
  • 5
3
votes
2 answers

read.xlsx() throws an error in R

I have installed xlsx and dependent packages. Also I downloaded 64 bit java required to install dependent rjava package. Now when I try to use read.xlsx I get the below error. After installing 64 bit java, I can successfully load the package but I…
3
votes
3 answers

r - read.xlsx from .xlsx with unknown number of sheets

Suppose I have an excel file, which I would like to read to R with read.xlsx function. File consists of spreadsheets, number of which I do not know (there is like 200 of such files so manually checking number of sheets would be huge pain). Each…
2
votes
1 answer

R read.xlsx gives me java.io.FileNotFoundException

I am trying to use the R package xlsx to load a file available at this URL: …
719016
  • 9,922
  • 20
  • 85
  • 158
2
votes
1 answer

Split xlsx file into small files based on count of rows

I have a dataset with greater than 20000 rows which I can't import into SharePoint due to its total number rows upload limitation to 20000. There are 17 columns and each of them have 6694 rows totaling to 113798. So, I want to split this xlsx file…
Ed_Gravy
  • 1,841
  • 2
  • 11
  • 34
2
votes
1 answer

How can i write systematic data into excel sheet with systematicly?

I have been working with big though systematic data. Therefore I have wrote only shape of my data frame to below. I need to write every 3 column into different excel sheet. I tried some code and functions but i didnt achieve due to my lack of…
Enes
  • 33
  • 3
2
votes
0 answers

Getting Error while trying to read .csv in R Studio

I'm trying to import a dataset with .csv format but I keep getting errors. If I use the built-in import feature of R Studio I get this error: embedded nul in the…
Andrea
  • 105
  • 10
2
votes
1 answer

How to print top row in bold when writing dataframe to excel in R using write.xlsx

I write a dataframe in R to an excel file using the following command: write.xlsx(dataframe, pathName, row.names = FALSE, append = FALSE). Now I want to print the first row (headers in the dataframe) in bold. Does anyone know how to do this with…
bml
  • 115
  • 7
2
votes
0 answers

How did write.xlsx2 not encounter the same error that write.xlsx was giving?

I was trying to write a dataframe (21x21) to an excel file using "write.xlsx" from the xlsx package in R but was receiving the below error: Error in .jcall(cell, "V", "setCellValue", value) : method setCellValue with signature…
zoekopp
  • 21
  • 1
2
votes
2 answers

How to read in multi line excel cells into R

I am trying to read in an excel file into R. The data is formatted as follows: As you can see, there are cells with multi line information. I am taking this excel file and putting it up on R shiny as a question. (As radio buttons) Now if I read it…
2
votes
1 answer

Lock specific cells in an Excel file from R while preserving formatting

I'm trying to lock a block of cells in a series of Excel files, protect each file, and save them in their original location. I have the code working in every way except that locking the columns strips those cells of all formatting. I can't recreate…
2
votes
1 answer

R generate multiple Excel files from a dataset, based on conditions from another

I've got a dataset with feedback comments on multiple criteria from a customer survey conducted on many sites, where each row represents a single response. For simplicity's sake, I have simplified the original dataset and produced a reproducible…
Varun
  • 1,211
  • 1
  • 14
  • 31
1
2
3
8 9