xlconnect

How can I retrive the time only with xlconnect?

烂漫一生 提交于 2019-12-06 19:36:34
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 ? Martin Studer XLConnect uses POSIXct to represent date-time values in a data.frame . If you only want to extract the time component you may use strftime(your

editing particular cells of an Excel sheet

老子叫甜甜 提交于 2019-12-06 13:43:33
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") saveWorkbook(wb, "new_file1.xls") However, this way the new workbook loses all of the previous formatting

Read data from several worksheets from workbook and eliminate comments

╄→尐↘猪︶ㄣ 提交于 2019-12-06 13:32:08
问题 I have workbooks with several (70+) worksheets. Each worksheet is a station name. Each worksheet has different number of comment line starting with # which I want to eliminate, then read the header from when the comments end and assign them to the column names. I was trying to use RODBC which works on a 32-bit machine/R/EXCEL but is not working on a 64-bit system. Below is what I have using RODBC. How can I do the same using XLconnect or something else for a 64-bit system? library(RODBC) ###

Package for connecting R and Excel without the Java Virtual Machine

 ̄綄美尐妖づ 提交于 2019-12-05 06:39:22
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. You may want to check out openxlsx : openxlsx: Read, Write and Edit XLSX Files Simplifies the creation of .xlsx files by

Populating Excel Macro-enabled cells from R/outside environment

半腔热情 提交于 2019-12-02 13:26:09
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 an R environment, not from within Excel (also I had many difficulties trying to install RExcel). This

Invalid 'path' argument with XLConnect

南笙酒味 提交于 2019-12-02 05:20:21
问题 I am trying and failing to get the following process to complete in R Version 3.1.2: library(RCurl) library(XLConnect) yr <- substr(Sys.Date(), 1, 4) mo <- as.character(as.numeric(substr(Sys.Date(), 6, 7)) - 1) temp <- tempfile() temp <- getForm("http://strikemap.clb.org.hk/strikes/api.v4/export", FromYear = "2011", FromMonth = "1", ToYear = yr, ToMonth = mo, `_lang` = "en") CLB <- readWorksheetFromFile(temp, sheet=1) unlink(temp) I have been able manually to export the requested data set and

Does XLConnect package work with Java 8?

我是研究僧i 提交于 2019-12-02 05:04:17
问题 I updated my Java version and deleted the older versions of Java. Now my XLConnect package will not load in R because XLConnectJars won't load. Here is the error message. Loading required package: XLConnectJars Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. Error: package ‘XLConnectJars’ could not be loaded Is

Invalid 'path' argument with XLConnect

偶尔善良 提交于 2019-12-02 01:25:45
I am trying and failing to get the following process to complete in R Version 3.1.2: library(RCurl) library(XLConnect) yr <- substr(Sys.Date(), 1, 4) mo <- as.character(as.numeric(substr(Sys.Date(), 6, 7)) - 1) temp <- tempfile() temp <- getForm("http://strikemap.clb.org.hk/strikes/api.v4/export", FromYear = "2011", FromMonth = "1", ToYear = yr, ToMonth = mo, `_lang` = "en") CLB <- readWorksheetFromFile(temp, sheet=1) unlink(temp) I have been able manually to export the requested data set and then read it into R from a local directory using the same readWorksheetFromFile syntax. My goal now is

Does XLConnect package work with Java 8?

北慕城南 提交于 2019-12-01 23:54:15
I updated my Java version and deleted the older versions of Java. Now my XLConnect package will not load in R because XLConnectJars won't load. Here is the error message. Loading required package: XLConnectJars Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. Error: package ‘XLConnectJars’ could not be loaded Is the only solution to reinstall an older version of Java? Try to define the path options(java.home="C:

Error in XLConnect

时光毁灭记忆、已成空白 提交于 2019-12-01 14:35:58
问题 I am trying to import an excel sheet into r. I used the following code: x <- loadWorkbook("x.xlsx") b <- readWorksheet(x, sheet="b") The first line works fine, however, running the second gives the following error: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘readWorksheet’ for signature ‘"jobjRef", "character"’ I have no missing values in that sheet. For the purpose of reproducing, download trial.xlsx from https://github.com/ahmedfsalhin