xlconnect

Downloading Excel File from XLConnect with R Shiny

穿精又带淫゛_ 提交于 2019-12-20 09:03:33
问题 Has anyone tried using the download handler in R Shiny to download a freshly created Excel file with XLConnect? In the ui.R there is the unremarkable line: downloadButton('downloadData', 'Download') In the server.R there is the handler: output$downloadData <- downloadHandler( filename = function() { "output.xlsx" }, content = function(file){ wb <- loadWorkbook(file, create = TRUE) createSheet(wb, name = "Sheet1") writeWorksheet(wb, c(1:3), sheet = "Sheet1") # writes numbers 1:3 in file

Installing R library XLConnect on OS 10.8.2

核能气质少年 提交于 2019-12-19 02:39:06
问题 XLConnect is, as the manual describes it, "a package that allows for reading, writing and manipulation of Microsoft Excel files from within R". Installation on Windows and Linux is straightforward. Simply tell R to install.packages("XLConnect") , and you're done. On OS X you need to use install.packages("XLConnect", type="source") , the installation instructions say. Trying this under OS 10.8.2, R output a number of error messages. I post them here, so Google can send people with similar

XLConnect function is not passing argument to system.file

蓝咒 提交于 2019-12-13 02:18:20
问题 I have an issue with XLConnect library. Its system.file function, I've only seen be used with file1 <- system.file(file, package ="XLConnect") Where file is always equal to a string. However I have a list of strings with the file name of each file in it. I have this inside of a for loop that iterates through the list. For whatever reason, file1 is empty even though the file object has the equivalent "soandso.xlsx". So my question is do I need file to be a string? Edit #1: So I switched from

XLConnect - readWorksheet with looping object

本秂侑毒 提交于 2019-12-13 01:51:40
问题 I am using R Studio version 3.1.2 with XLConnect package to load, read and write multiple xlsx files. I can do this with duplicating and creating multiple objects but I am trying to do it using 1 object(all files in the same folder). please see examples I can do this listing each file but want to do it using a loop tstA <- loadWorkbook("\\\\FS01\\DEPARTMENTFOLDERS$\\tst\\2015\\Apr\\DeptA.xlsx") tstB <- loadWorkbook("\\\\FS01\\DEPARTMENTFOLDERS$\\tst\\2015\\Apr\\DeptB.xlsx") This is the way im

setCellStyle - apply cell style (percent) to matrix using XLConnect

拥有回忆 提交于 2019-12-12 05:17:51
问题 My question is based on an issue mentioned in a previous question Formatting of numbers using Mirai's XLConnect. I have trouble implementing this solution from @joran and I think I might not be the only person with this problem. I want to export a correlation matrix(10x10) to excel. It is saved as a matrix called export. library(XLConnect) wb <- loadWorkbook(paste0("corr_test.xlsx"), create = TRUE) prcntg <- createCellStyle(wb) setDataFormat(prcntg, format = "0.00%") createSheet(wb, name=

Weird behavior lapplying XLConnect functions to list of workbooks

倾然丶 夕夏残阳落幕 提交于 2019-12-12 04:23:27
问题 Part 1: I am trying to rename worksheets in a list of workbooks using lapply and XLConnect (I need to rename them for the next part of the code to run properly, more on this in part 2): library(XLConnect) # testWB.xlsx contains a blank worksheet called Sheet1 testWB <- rep(lapply("testWB.xlsx", loadWorkbook), 3) lapply(1:length(testWB), function(x) { renameSheet(testWB[[x]], "Sheet1", "test1") }) Gives me the error: `Error: IllegalArgumentException (Java): Sheet index (-1) is out of range (0.

Error when installing XLConnect in RStudio

三世轮回 提交于 2019-12-12 02:47:18
问题 Thanks in advance. I am trying to install XLConnect package. I am using RStudio. For your information rJava is installed. Here is my command in R and the error message: install.packages("XLConnect") trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/XLConnect_0.2-7.zip' Content type 'application/zip' length 17997942 bytes (17.2 Mb) opened URL downloaded 16.7 Mb Warning in install.packages : downloaded length 17473536 != reported length 17997942 Warning in install.packages : error 1

How to efficiently import multiple excel tables located in one sheet into an R list?

ε祈祈猫儿з 提交于 2019-12-11 18:46:07
问题 Task I am trying to import tables situated in a single excel sheet into an R object as efficiently as possible ( list will be fine, as I can take the rest of the calculations from there). Nuance The tables are actually excel ranges not excel tables , but they are structured and look like tables: here is an example of an excel range that should be imported as a table in R: Ranges(In a table form) are not of the same length and can be situated anywhere in the same sheet. Reproducible Example

How can we create a color scales for excel using R?

隐身守侯 提交于 2019-12-10 23:59:03
问题 I want to create a color scale based on the input values from an excel spreadsheet.The required output is a color scaled cells in the excel sheet based on the values which is programmed in R.I tried through XLConnect but haven't yet found a suitable solution. thanks & Regards 回答1: The xlsx package allows using RGB-colors for Fill(). E.g. fg <- rgb(100, 50, 50, max = 100) bg <- "black" style <- CellStyle(wb) + Fill(foregroundColor = fg, backgroundColor = bg) setCellStyle(c, style) Setting the

Package for connecting R and Excel without the Java Virtual Machine

孤街浪徒 提交于 2019-12-07 02:28:45
问题 A couple of months ago I found on the Internet information about an R package to connect R with Excel and the other way around (doing basically what xlsx and XLConnect do). However, the main difference with respect to the two above mentioned solutions was that the package wasn't designed to use the JVM (which keeps giving me some trouble). I've been spending quite some time trying to find the reference for that package, without success. Can you help me? Many thanks. 回答1: You may want to check