Re: [R] XLConnect readWorksheet comma decimal sign
Hi, XLConnect can very well deal with missing values. By default, only blank cells (cells not containing any values) will be treated as missing values. Cells containing the text NA are not automatically treated as missing values as NA is a valid non-missing text string. If you want to treat the text NA as missing value identifier, you can use the method setMissingValue. Generally, XLConnect determines the column type based on the cell types of the containing cells (yes, Excel cells are typed!). Therefore, if there are cells with text, XLConnect will decide to read that column in as text (treating missing value identifiers accordingly, as described above). You may also use the arguments colTypes and forceConversion for further controlling how cell values should be interpreted. Please see the reference manual for more detailed information. Regards, Martin no change when setting it to dot. I seems that XLConnect is not able to deal with NA in Excel, means its string instead an number after importing. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] xlsx file read in R
Hi Nico, please let me know the details of sessionInfo() in R. Also, what version of Java are you running? If you could post the output of java -version from the command line that would be great. Note that XLConnect requires at least Java 1.6. Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/xlsx-file-read-in-R-tp4651829p4652003.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] CreateThread failure since R 2.15.2 (32-bit)
I tried with Java 1.6.0_20 and 1.7.0_09. It actually doesn't matter what command I'm running with system. Any command will fail with the same error message. But for the example I posted, yes, I was using ls from Rtools. I found that I can only reproduce this with R 2.15.2+ 32-bit on Windows 32-bit. There are no issues with R 2.15.2+ 32-bit on Windows 64-bit. Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/CreateThread-failure-since-R-2-15-2-32-bit-tp4651411p4651651.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] CreateThread failure since R 2.15.2 (32-bit)
Dear R users developers, I coming across the following issue since R 2.15.2 32-bit (running on Windows XP 32.bit; some output left out for conciseness): setInternet2(TRUE) require(rJava) .jinit() getCRANmirrors() system(ls , intern = TRUE) Error in system(ls, intern = TRUE) : CreateThread failed My details are as follows: sessionInfo() R version 2.15.2 (2012-10-26) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252 [4] LC_NUMERIC=CLC_TIME=German_Switzerland.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rJava_0.9-3 The failure appears since R 2.15.2, i.e. also with R 2.15.2patched and with R-Devel. It does, however, not appear with e.g. R 2.15.1 or R 2.14.2. Also, I don't get the issue with R 2.15.2 64-bit (running on Windows 7 Professional 64-bit). Also note that the issue seems related to rJava in that running the same without the rJava part (and therefore without initializing a JVM instance) runs fine: setInternet2(TRUE) getCRANmirrors() system(ls , intern = TRUE) Any ideas on what the issue might be? Thanks Best regards, Martin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Import/Export excel files to/from R, without changing the file type
XLConnect requires Java 1.6+ to be installed. You can get Java from http://www.java.com/getjava/ Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/Import-Export-excel-files-to-from-R-without-changing-the-file-type-tp4650717p4650766.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Import excel file
Hi Cyril, please let me know the following details: - sessionInfo() output from R - Version of XLConnect you are using - Version of rJava you are using - Version of Java you are using (complete output of java -version on the command line) - Value of the JAVA_HOME environment variable if it is set (e.g. output of Sys.getenv(JAVA_HOME) in R) Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/Import-excel-file-tp4649755p4650087.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rJava Out of Memory Error
Hi Matthew, The problem is that the underlying JVM is running with a fixed maximum heap size. When you load a workbook in XLConnect, an in-memory representation of that workbook is created (in Java by Apache POI). Reading and writing data additionally requires memory due to communication of your data from and to the JVM. Depending on the size of your workbooks and the data you are dealing with you may need to increase the maximum heap size available to the JVM. Please have a look at our FAQ at http://www.mirai-solutions.com/site/index.cfm?id_art=69890actMenuItemID=31456plainerr=yesvsprache=EN on how to do this. Other functions that you might be interested in are xlcMemoryReport and xlcFreeMemroy. Hope that helps. Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/rJava-Out-of-Memory-Error-tp4647881p4648170.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Cannot create Java virtual machine (-1)
Hi Roger, note that since version 0.1-7 of XLConnect Java 1.6 is required - it won't work with Java 1.5. However, the problem you describe is another one. It's most likely related to your Java setup/configuration and therefore independent of XLConnect. You can verify this by running the following statements in R: library(rJava) .jinit() You should actually see the same error message. What version of rJava are you using and do you have any environment variables like JAVA_HOME or PATH set? Also the output of sessionInfo() could be of interest. Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/Cannot-create-Java-virtual-machine-1-tp4639585p4639650.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Java problem - XLConnect/xlsx package
Hi Rainer, Looking at your sessionInfo() it looks like you are using 32-bit R on 64-bit Windows 7. My guess is that the installed JVM is 64-bit. This leads to an architecture clash between R and Java. It is important to make sure that the architectures of R and the JVM match, i.e. either both are 32-bit or both are 64-bit. Can you verify if this is the case? Run java -version on the command line to see whether you are using a 32-bit or 64-bit JVM. Regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/Java-problem-XLConnect-xlsx-package-tp4631304p4631365.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] write.xls
Hi Spencer, it looks like you either don't have Java installed or the architectures of R and your JVM don't match, i.e. your running 64-bit R (as noted from your sessionInfo() output) but are using a 32-bit JVM. In any case installing 64-bit Java should resolve your issue. Hope that helps. Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/write-xls-tp4630642p4630787.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.
Hi Mike, as others have already suggested, there might be a problem with quoting. Otherwise, did you already have a look at the package vignette ( http://cran.r-project.org/web/packages/XLConnect/vignettes/XLConnect.pdf http://cran.r-project.org/web/packages/XLConnect/vignettes/XLConnect.pdf ) that gives a number of examples on how to read/write Excel files? Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/Can-t-read-xlsx-file-into-R-Seem-Seem-to-have-XLConnect-loaded-tp469p4624156.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] nice report generator?
Hi Michael, Hi all, an alternative for reading/writing tables from/to Excel is the package XLConnect. It is platform-independent and therefore runs under Windows, UNIX/Linux Mac. It supports reading/writing worksheets as well as named ranges. In addition, for reporting purposes, there is support for cell styles. You can find an example here: http://miraisolutions.wordpress.com/2011/08/31/xlconnect-a-platform-independent-interface-to-excel/ XLConnect – A platform-independent interface to Excel . With respect to cell styles: you either completely code up the styling according to your needs using /setCellStyle/ (which can be cumbersome if you need to apply a lot of styling) or you can use so-called style actions controlled via /setStyleAction/. See the XLConnect reference manual for more information. Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/nice-report-generator-tp4169939p4365144.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] XLConnect Error
Hi Daniel, you can get Java from http://www.java.com/en/download/manual.jsp?locale=en Simply download and follow the instructions. Hope that helps. Martin -- View this message in context: http://r.789695.n4.nabble.com/XLConnect-Error-tp3628528p3991681.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Reading Parts of Excel Files (within a sheet)
Hi Peter, the readWorksheet function of the XLConnect package seems to do what you are looking for. It has arguments startRow, startCol, endRow endCol. Alternatively, you could define a named region in Excel that encompasses the data that you are interested in. Then you can use the readNamedRegion method to read only the defined range. Best regards, Martin Studer -- View this message in context: http://r.789695.n4.nabble.com/Reading-Parts-of-Excel-Files-within-a-sheet-tp3814447p3856138.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.