xlconnect

JAVA_HOME cannot be determined error with XLConnect

和自甴很熟 提交于 2020-01-15 05:32:08
问题 I'd apreciate your help: i'm trying to run XLconnect but I receive this error message: > library("XLConnect", lib.loc="C:/Users/1144143929/Documents/R/win-library/2.15") Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: JAVA_HOME cannot be determined from the Registry Error: package/namespace load failed for ‘XLConnect’ 回答1: Another point to check is that if your version of R is 32 byte, so must your Java version. Or, 64 byte must match 64 byte

XLConnect Java Virtual Machine out of memory error

泪湿孤枕 提交于 2020-01-14 04:52:06
问题 I know this issue has been visited several times, but I haven't found the solution to my problem: I reserve 1024 MB for the virtual machine with > options(java.parameters = "-Xmx1024m") > library(XLConnect) xlcMemoryReport finds only around 15 MB and xlcFreeMemory doesn't help (actually sometimes further reduces available memory) > xlcMemoryReport() Amount of free memory in the Java Virtual Machine (JVM): 14.79472 MB > xlcFreeMemory() > xlcMemoryReport() Amount of free memory in the Java

Populating Excel Macro-enabled cells from R/outside environment

☆樱花仙子☆ 提交于 2019-12-31 07:41:08
问题 I have a macro-enabled template in excel that I wish to populate programmatically from R. I have an R process that retrieves different set of data for every item I with to process, processes them, and then I want it to duplicate and populate the template for each data set, bypassing the need to fill the template out by hand for every set of data. I have been using the XLConnect R package, however it does not support .xlsm files. I thought about using RExcel, but I want to run the program from

R Save a excel workbook with password protection

我只是一个虾纸丫 提交于 2019-12-30 10:34:50
问题 I'm a bit impressed because I couldn't find an answer so far. I have a small R script that is loading data from one source and writing a few dozens Excel files from it. The problem now is: those files need a password protection. Currently my script is using the XLConnect library to save the excel files. The script is something like this: # Load data from source source = <connection string to source> dataFromSource = <read from source> # Process for (data in dataFromSource) { wb = loadWorkbook

How can I import all the decimal places in a mixed-type column with XLConnect and R?

十年热恋 提交于 2019-12-25 02:34:43
问题 I am trying to import many Excel spreadsheets into R using XLConnect. Two columns interest me, one containing variable names, and the other containing values. These values vary between being characters or numeric. The authors of the spreadsheet have set the numeric values to show varied numbers of decimals depending on the cell, although I need all numeric values with all decimal places. However, because the column contains both characters and numbers, readWorksheet converts everything to

Does setDataFormatForType() work at all for Dates in XLConnect?

孤街醉人 提交于 2019-12-24 07:01:18
问题 I recently tried all sorts of formatting arguments on the function setDataFormatForType(wb, type=XLC$DATA_TYPE.DATETIME, format="d/m/yy") for example format="d/m/yy" as shown above, besides numerous others. This then is followed up by setStyleAction(wb, XLC$"STYLE_ACTION.DATA_FORMAT_ONLY") and then I write a worksheet and save the workook. No form of format tweaking seems to work. As soon as I mess with any format in the setDataFormatForType command the result is that the numeric time value

Export a list of matrices nicely to the same worksheet in Excel

梦想与她 提交于 2019-12-23 05:49:26
问题 I have a list of 4 matrices. The first two of them: $`1857-1903` Bank.o.kassa Obligationer Lån Aktier Placeringar.andra.ftg Fodringar Reala.tillgångar Övriga.tillgångar Bank.o.kassa 1.0000000 0.8014382 0.8079718 0.4421687 NA 0.8395201 0.9144023 0.7995480 Obligationer 0.8014382 1.0000000 0.8422192 0.4590398 NA 0.7871074 0.8815054 0.7003110 Lån 0.8079718 0.8422192 1.0000000 0.5476716 NA 0.8932723 0.9295665 0.7846206 Aktier 0.4421687 0.4590398 0.5476716 1.0000000 NA 0.7203681 0.4221815 0.6281095

How can I retrive the time only with xlconnect?

送分小仙女□ 提交于 2019-12-23 04:39:17
问题 I have data saved in .xlsx file, and in the data the columns date and time separated. However, I type the code; data1<-readWorksheetFromFile("file.xlsx", sheet="Sheet1") to retrive data into R. As a consequence, I am getting the time column in the R environment, with nonsense date attached to it. So the time column in R looks like 1899-12-31 16:07:11 , what I want only the take the time as 16:07:11 in this case. How can that be done ? 回答1: XLConnect uses POSIXct to represent date-time values

editing particular cells of an Excel sheet

心已入冬 提交于 2019-12-22 12:21:02
问题 I have an Excel workbook of which I want to edit/fill some particular cells using R, without changing any of the formatting. So far I've tried XLConnect package and it seems it could do what I'm looking for, I just didn't find a way to do it. My straightforward approach to the problem: wb <- loadWorkbook("file1.xls") data1 <- readWorksheet(wb, "Sheet1", header=TRUE) ## adding a value to a particular cell: data1[11,12] <- 3.2 ## rewriting old data: writeWorksheet(wb, data1, "Sheet1")

Reading data from excel book with many thousand tabs

主宰稳场 提交于 2019-12-22 00:17:27
问题 I am reading in data from individual xlsx files, with the data stored in 10-20 thousand individual tabs in each workbook file. The first sheet contains a master data table, including links to the individual tabs with further data. The column based 'tabbed' data is summarized and transposed before being appended to the master data. The master data table is large (10' thousands rows x hundreds cols) in its own right, the additional data tabs are small in their own rights (a few cols by 10's to