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
1
vote
1 answer

Data import and text to column (when in excel A1 = 1+1+1 and 3 is visible)

Let's say we have the excel file and in A1 we have formula = 1+1+1. So excel shows 3 however you can do 'Text to Columns' and value 1 will be in A1, B1 & C1. Is there anything we can do in R after data import (I use read.xlsx) to get the same…
Kalenji
  • 401
  • 2
  • 19
  • 42
1
vote
1 answer

How to export unequal length variables from R to an excel sheet?

I have two data frames in R as follows. Team1 = c("a","b") Grade1 = c(90,85) DB1 = data.frame(Team1, Grade1) Team2 = c("a","x","b") Grade2 = c(79,92,85) DB2 = data.frame(Team2, Grade2) I want these four variables to be exported to a single excel…
Hansy Kumaralal
  • 169
  • 3
  • 13
1
vote
2 answers

Can R read unregular xlsx?

I have so many(about 1,000) xlsx like the picture above. And I want to read every xlsx and get the data of every candatate's name, number and age. But I don't know how to read this unregular xlsx?
nan
  • 401
  • 4
  • 13
1
vote
1 answer

formatting gene names as text in xlsx r package

I am trying to format columns within an excel file in the correct manner. First of all, I am afraid that Excel pics some strange gene names as dates which happens often in science. So normally, when importing data into excel from a txt file, I…
drmariod
  • 11,106
  • 16
  • 64
  • 110
1
vote
1 answer

I am trying to install xlsx package in Rstudio but I am getting errors

Trying to install xlsx package in Rstudio on Ubuntu 14.04 LTS OS type - 64bit but getting errors while installation. Please guide me as how to solve these errors as I am trying to create a script where I can read an Excel file commute some…
Mansi
  • 13
  • 4
1
vote
1 answer

GC overhead error using xlsx

I am trying to read xlsx files in R using the xlsx library. Below is my piece of code. options(java.parameters = "-Xmx8g") data <- read.xlsx("data.xlsx", header = FALSE, sheetName="Sheet1") It throws the following error Error in…
mc29
  • 85
  • 2
  • 10
1
vote
0 answers

How to enable sorting and filtering while the Excel is locked when creating Excel document using R?

I am trying to create an Excel spreadsheet using the XLSX package in R. I need to protect some part of the a sheet, but still be able to do sorting or filtering for the main part. To do this in excel, you have to set the cells of main part to be…
ssword
  • 905
  • 10
  • 13
1
vote
1 answer

Timestamp changes when writing a R dataframe to an excel file depending upon UTC offset

I am trying to write a data frame into an excel file. The sample dataframe is as given below. As the timestamp is of class factor, I convert it into POSIXct format using the lubridate package. …
Tony Rajan
  • 130
  • 1
  • 11
1
vote
1 answer

Formatting an entire excel workbook efficiently using the R xlsx package

Novice here on Stack Overflow so please bear with me - any help or advice gratefully appreciated! I am trying to apply a single cell style to entire Excel workbooks that I have created using the write.xlsx function in R. I have looked online and…
Alvo
  • 67
  • 7
1
vote
1 answer

Change Excel Worksheet Tab Color

I have added a worksheet to an excel spreadsheet using the following code using the xlsx package in R library(xlsx) wb <- CreateWorkbook() newsheet <- createSheet(wb, sheetName = 'Sheet1') Is there a way to automatically change the color of the…
Harrison Jones
  • 2,256
  • 5
  • 27
  • 34
1
vote
2 answers

Unable to read in .xls from R

File: it is a file with about 100 rows and 7 columns. XLS extension (MS Excel 97-2003). Issue: unable to read in the file with R through read.xlsx or read.xlsx2. Code used to try to read the file: library(xlsxjars) library(rJava) library(xlsx)…
Victor
  • 1,163
  • 4
  • 25
  • 45
1
vote
0 answers

R read.xlsx memory leak?

I use R (version 3.0.2) on a Ubuntu 64bit (14.04) and the package read.xlsx to read several xlsx sheets. I do it like this: options(java.parameters = "-Xmx4g" ) require(xlsx) d1 = read.xlsx2(file, sheetName=sheet.1) d2 = read.xlsx2(file,…
Jonas
  • 1,639
  • 1
  • 18
  • 29
1
vote
1 answer

Force Excel Workbook evaluation before read.xlsx in R?

I am reading Excel Workbooks (.xlsx format) with read.xlsx() from the xlsx package. My Workbooks have dates stored as functions (e.g., =DATE(1900, 1, 1)) rather than strings or fractional days from 1899-12-31 (e.g., 1/1/1900 or 1). This is not a…
Richard Herron
  • 9,760
  • 12
  • 69
  • 116
1
vote
3 answers

Import with xlsx package in R gives NA, and empty entries, can´t delete NA values

I am importing data from an xlsx (https://www.dropbox.com/s/r5sn5pio5rnprdq/gesammelte%20Daten_1707.xlsx) file with read.xlsx setwd("C:/***//Kultivierungen//1707_ADH//") pH <- read.xlsx("gesammelte Daten_1707.xlsx", sheetName="pH") OD <-…
plastikdusche
  • 235
  • 2
  • 10
0
votes
1 answer

Read different excel dataframes depending on selectInput Shiny

I have a shiny app that I would wish to pass data frames from different Excel files depending on the choice from a selectInput. I tried to use observeEvent and if...else statements as shown in the example without success. Could anyone guide me on a…
R noob
  • 495
  • 3
  • 20
1 2 3
8 9