[R] [offtopic] nice R related domains to give away
Since some years I have the following domains which I don't need any longer (and in fact never used despite some plans) - developr.org - editr.org - helpr.org It makes no sense to hoard domains and I plan to give them away for a 'good cause'. I'd like to have a small fee for the costs but this is not a precondition. My email: gchappi, and then gmail.com. Cheers, Hans-Peter [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Any reason not to use RUnit any longer?
Hello, I see that quite some packages nowadays use testthat and that RUnit doesn't have recent updates. On the other hand Rccp, fTrading and others (still) test with RUnit. My old code uses RUnit and I would prefer to keep it that way unless there is an important reason to switch to testthat. If it makes a difference, I do _not_ use roxygen and stay close to R-exts standards (ok, a testing framework I'd like to have). Thanks for any advise / opinions, Hans-Peter [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Any reason not to use RUnit any longer?
Thanks a lot for the feedback, Dirk and Mehmet, My (large) test-code is in RUnit and so I'm glad to hear that it is fine. RUnit worked very well for me and I do not have a reason to switch. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Editor for Mac
> Thanks for the answers, > but I'm looking for an editor like Tinn-R. What about VM Fusion and continue to use Tinn-R then? -- Regards, Hans-Peter PS: I use TextMate (and like it) __ 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] PowerCut Killed R - is my code retrievable?
>> Also - is there a better way for the future? I know some people use IDE's >> but is that for serious programming or for building a small function and >> tweaking it? What about a version control system to (locally) save the different stages of your script files? (I use git but Subversion (SVN) may be easier and do the job). Cheers, Hans-Peter __ 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] Failed install of package xlsReadWrite
2010/2/11 : > Does anyone have a work-around for a failed installation of this package? >> library(xlsReadWrite) ... > xls.getshlib() > > However, the xls.getshlib() command fails with this error: (For the record) It probably was a corporate firewall problem. Apart from info on www.swissr.org (thanks for pointing this out) you can always download the file directly. The full listing is here: http://dl.dropbox.com/u/2602516/swissrpkg/listing.html Direct links to the current (R2.10.x/1.5.1 pkg) version, either: - download the zipped dll: http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/shlib/xlsReadWrite_1.5.1_dll.zip and manually replace xlsReadWrite.dll (in e.g. 'C:\Programme\R\R-2.10.1\library\xlsReadWrite\libs') or - download the full package: http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/2.10/xlsReadWrite_1.5.1.zip and re-install. Note: 0.0.0-versions are development versions. They will be updated when there is something 'fixworthy' while a new official version is 'in wait mode'. Currently 0.0.0 fixes a bug with non-absolute file paths in 1.5.1. Cheers, Hans-Peter __ 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] Failed install of package xlsReadWrite
> Hi, all. I too got this error, and when I went to register the correct DLL > (thinking the one downloaded but not installed might have been the > development version) I got an error that the registration had failed. > > What I typed: > > C:\Program Files\R\R-2.10.0\library\xlsReadWrite\libs>regsvr32 > xlsReadWrite.dll Executing regsvr32 is absolutely _not_ necessary. It suffice to copy the dll to the correct place (C:\Program Files\R\R-2.10.0\library\xlsReadWrite\libs). Unfortunately there is/was a bug in xlsReadWrite 1.5.1 such that with a custom R_Libs path the existing dll was not replaced (iirc). This and the relative-path bug has been fixed in the devel version. If you download the full version, the package is supposed to work right away. I currently still use XP (but don't know of any problems related with Windows 7 or Vista). Links (full, i.e. non-cran version, R2.10.x): 1.5.1: http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/2.10/xlsReadWrite_1.5.1.zip devel: http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/2.10/xlsReadWrite_0.0.0.zip Hope this helps! (Otherwise feel free to contact me by email (gchappi gmail), this really must work). Cheers, Hans-Peter __ 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] help exporting to excel via xlsReadWritePro
> I’m trying to export a file from R to excel using the xlsReadWritePro > function and I keep getting the error below. POSIXt is not currently supported (neither in data.frames nor vectors) and must be converted to other types (see ?write.xls). I almost never use POSIXlt/ct myself but it would probably be a good idea to provide support (I've added it as a request). Code: dates <- c( "2009-07-02 19:30:00", "2009-07-02 19:31:15", "2009-07-02 20:12:42" ) write.xls( data.frame( as.POSIXlt( dates ) ), "anothertestfile.xls" ) # gives error write.xls( as.POSIXlt( dates ), "anothertestfile.xls" ) # do.l > [snip] Also is there anyway to export different datasets to multiple sheets > similar to the ods function in SAS? Here is an example: # setup library( "xlsReadWritePro" ) dates <- c( "2009-07-02 19:30:00", "2009-07-02 19:31:15", "2009-07-02 20:12:42" ) mydat <- data.frame( idt = as.character( as.POSIXlt( dates ) ), odt1 = isoStrToDateTime( dates ), odt2 = isoStrToDateTime( dates ), val = c( 1, 2, 3 ), stringsAsFactors = FALSE ) class( mydat[,1] ) <- "isodatetime" # required ('character' is not currently accepted as isodatetime column (will be fixed)) class( mydat[,2] ) <- "oledatetime" # optional ('numeric' will be accepted as oledatetime column) # write data (note: FALSE is necessary to keep the data.frame) xls <- xls.new ( "testfile.xls" ) # create new spreadsheet and keep in memory write.xls( mydat[,1,FALSE], xls, sheet = 1, cols = 1 ) # write write.xls( mydat[,2, FALSE], xls, sheet = 1, cols = 2 ) # do. write.xls( mydat[,3, FALSE], xls, sheet = 1, cols = 3, colClasses = "oledatetime" ) # do. write.xls( mydat[,4], xls, sheet = 2 ) # do. in sheet 2 xls.sheet( xls, 'select', 1 ) # first sheet shall be active when spreadsheet is opened xls.close( xls )# save and close memory represention Hope this helps/clarifies things. Otherwise feel free to ask again (PM prefered as it's probably better not to use the r-help mailling list for questions about a non-free library). Btw, there will be a forum some time later. Cheers, Hans-Peter __ 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] what happened to the xlsReadWrite package
> what happened to the xlsReadWrite package? [snip] > Are there any plans for it be available again? Yes. (I do have a halfway finished version but then had much work on my regular job, my 'free-programming-time' got eaten by a e-texteditor plugin (http://github.com/swissr/rmate.tmbundle/tree/master) which took longer than expected and now was/will be again holiday time..). Sorry for being so slow but at least and as it was mentioned (thanks) the package can be downloaded here: http://treetron.googlepages.com/xlsReadWrite_1.3.3.zip. It has been tested with R2.9.0 and the recent 2.9.1. Cheers, Hans-Peter __ 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] Export data to Multiple Sheets in Excel via xlsReadWritePro
2009/7/2 Chris Anderson : > Is there a way to export multiple datasets into multiple excel spreadsheets > using xlsReadWritePro or with xlsReadWrite? I have answered the question in your other thread. See: http://thread.gmane.org/gmane.comp.lang.r.general/154614/focus=154752 Cheers, Hans-Peter __ 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] emacs: reformat \items paragraph in .Rd
(emacs newb here) After having made some changes in an \items paragraph of \arguments the lines are no longer nicely wrapped. I was looking for a command to reindent/rewrap/reformat the whole \items paragraph but couldn't find anything. The only way, I found, was to go to the end of the first line, do 'c-j' (or RET) which wraps *this* line nicely, but now there is a hard line-break to the next line. So I go back with 'c-p', delete the gap to the next line with 'c-k' and some 'c-d' s. Then got to the end of this line and start again with 'c-j', ... There certainly must be some easier way to reformat a paragraph? (I tried 'm-c-q' (not defined) and 'm-c-\' (but was not able to input the backslash); I'm on GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600). Thanks for your help! Hans-Peter __ 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] emacs: reformat \items paragraph in .Rd
Many thanks! The missing empty line was the problem, and M-q works great. Hans-Peter > Esc-q or M-q will wrap a whole paragraph. The only problem is that you need > to make sure the paragraph you want to wrap is separated from other __ 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] Image into Excel file from R
> I am aware of the various packages (xlsReadWrite, RODBC) to get data > frames into R, but I would like to copy images too. The xlsReadWritePro version could do it (see code below). It's a shareware package, but if people need/ask for a gratis license I send it (please download and check ?xls.lic first; www.swissr.org). I'm just finishing 'some' :-) RUnit tests and a new version will be released tomorrow or after tomorrow. Cheers, Hans-Peter rfile.img <- sub("origData", "origImage", rfile, fixed = TRUE) wfile.img <- sub("tmpWriteData", "tmpWriteImage", wfile, fixed = TRUE) pics <- c("pic1.jpeg", "pic2.png", "pic3.bmp", "pic4.emf", "pic5.wmf", "pic.jpg") fpics <- file.path(dirname(rfile), pics) ### test: image ### !!! tests have to be executed in sequencial order !!! test.proImage.1write <- function() { exc <- xls.open(rfile.img) xls.image(exc, "set", fpics[1], "Pic1") xls.image(exc, "set", fpics[2], "Pic2") xls.image(exc, "set", fpics[3], "Pic3") xls.image(exc, "set", fpics[4], "Pic4") xls.image(exc, "set", fpics[5], "Pic5") xls.image(exc, "set", fpics[6], c(17, 7, 20, 8)) xls.close( exc, file = wfile.img) res <- xls.image(wfile.img, "list") checkIdentical(res, c("Grafik 1", fpics)) } __ 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] Do you keep an archive of "useful" R code? and if so - how?
> Marc - > I thank you for the links and ideas. Thanks to your advice I will look more > into SVN in the future, although it sounds on the surface to require some > learning curve, so It could take me some time to start using it. If you consider investing time to learn a version control system, I would recommend looking into a distributed one. - Personally I use git. http://git-scm.com/ is a good start, http://www.github.com can be used to store code 'in the cloud'. Cheers, Hans-Peter __ 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] Excel-Export
Jens, 2009/11/23 koj : > library(xlsReadWrite) > Everything is fine, but the format of the export is not the best. For > example, I every time have to adjust the column width. Furthermore there is > no possibility to highlight some cell or make them colourful. Auto-col is supported by the underlying library and should be doable easily. Formatting probably only in the pro version, but in any case I intend to work on crossplatform support first (for both versions). Feel free to submit a feature request here: https://redmine.swissr.org/projects/xlsreadwrite username: traveleR, password: namaste (sha1 fingerprint: A4:28:1D:3A:C3:96:01:4B:8F:4C:FC:AD:E7:B5:B7:84:B1:6B:7A:E7) Cheers, Hans-Peter __ 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] Excel-Export
2009/11/24 Kevin Wright : > If had done a little searching before posting, you surely would have found > this link > https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html > which describes how to create .xls files that are customized any way that > you desire. Manually convert to html, then manually hack around with a texteditor..., not a good idea, imho. RDCOM is better. Hans-Peter __ 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] Re ad & name multiple excel sheets using RODBC
2009/5/28 Dieter Menne : > If you only have the sheet names, you should use package xlsReadWrite which > is rather fast, but has some limitations in the non-commercial version. what limitations, i.e. features do you miss? Cheers, Hans-Peter __ 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] Most used R editors
>> I am a little lonely as R users in my group. So, I would like to know which >> editor is the most used in the R community. I think Emacs+ESS is most used and the most capable (if you are willing to invest the time to learn it properly). Personally I mostly use TextMate with the R bundle (or RMate, own variant thereof). On Windows I use E-Texteditor, TM's cousin. Albeit there are some bugs & issues, E-Texteditor is quite a decent editor and with the RMate bundle (will publish it sometime) lines can be sent to RGui and info/help pops up. Wouldn't go back to TinnR... Cheers, Hans-Peter -- emacs - “a great operating system, lacking only a decent editor”. __ 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] How to convert blanks to NA
2009/6/2 Mark Na : > library(xlsReadWrite) > data <- read.xls(data,colClasses=c("character")) > > and this results in all of the empty (blank) cells in the imported > Excel file also being empty (blank) in the resulting dataframe. The pro version has an 'naStrings' argument. But this is something that should be supported since longtime also in the normal xlsReadWrite. Thanks for reminding me :-) and it's now - at least - in my Redmine tracker. Cheers, Hans-Peter __ 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] [Ann] RMate, a bundle for TextMate and E-Texteditor
I have uploaded RMate to Github. From the readme: RMate is a [TextMate](http://macromates.com/) bundle for [R](http://www.r-project.org/about.html). It is based on the [R/R Console/Rdaemon](http://svn.textmate.org/trunk/Bundles) bundles and is focused on: - easy to use, clear interface/menu - support for Windows ([E-Texteditor](http://www.e-texteditor.com/)) - editing code, R/Rd snippets and getting help/info - connect to the standard R frontends (R.app and RGui) Install via git: INSTDIR=~/"Library/Application Support/TextMate/Bundles" cd "$INSTDIR" git clone git://github.com/swissr/rmate.tmbundle.git rmate.tmbundle osascript -e 'tell app "TextMate" to reload bundles' or by hand: - download - the [master](http://github.com/swissr/rmate.tmbundle/zipball/master) (i.e. most recent) version or - choose the (latest) tagged version [here](http://github.com/swissr/rmate.tmbundle/downloads) - unzip and rename to 'rmate.tmbundle' (i.e. remove swissr- and -hash) - double click to import into TextMate' Cheers, Hans-Peter __ 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] fix for RMate (TextMate/E-Texteditor bundle)
Arg, I already needed to fix the bundle. If anyone downloaded it yesterday, please update, the help index building was broken (on Macs). Should work now. Repo/Infos: http://github.com/swissr/rmate.tmbundle/tree/master -- Regards, Hans-Peter __ 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 Excel file
> I was using older version of R (installed early). I install new version of R > (R.2.9.0) but i could not find package "xlsReadWrite" to read Excel file. As others have pointed out (thanks) you can find it here: http://treetron.googlepages.com/. It runs fine in 2.9.0. > Is there any alternatives to read Excel file ? RODBC, RExcel, gdata, use COM (search this forum for code). Cheers, Hans-Peter __ 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] xlsReadWrite library
2009/3/19 Pascal Candolfi : > Any idea why this library was removed and where could I find it for Windows > (only Unix in the Archive) ? As indicated it was for for the binary (non FOSS) component. Yesterday I checked the existing packages (xlsReadWrite(Pro) on http://treetron.googlepages.com) if they run on 'R 2.9.0 under development'. They do fine (well apart from two or three known _small_ bugs ;-). I made a fully OSS and C-based version meanwhile which downloads (or gives instruction how to compile for yourself) the necessary DLL from a non-CRAN source. However as I wanted to make sure that this 'packaging' still counts as a 'binary distribution' I explicitely asked the developer from the 3rd library (Flexcel) if this is ok. Last Friday I got his approval, so at least technically/legally it is possibled. When I'm happy with the new RUnit tests, adapted build scripts, etc., I'll ask again if 'xlsReadWrite' will be accepted on CRAN in this new source-only form. I hope so, but if not then there are other possibilities. In any case I intend to put the repo at some public space (most probably github). Cheers, Hans-Peter __ 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] Environments
>> rename(x,"C","Z") > x <- rename(x,"C","Z") > x A B Z D 1 2 3 4 -- Regards, Hans-Peter __ 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] Surface for R outside of R
> want an analysis. The best case were a surface of e.g. 8 Buttons, each click > leads to start a specific R file. My outputs are JPEG or CSV, so I don`t > need the output inside of R. Could anyone can give me some recommendations, > what could be a solution (e. g. Java)? Is such a solution possible? What about batch scripts which would be called by your GUI? (maybe you could even skip the gui...) (see ?Rscript (unix alike) or Windows FAQ, 2.12) -- Regards, Hans-Peter __ 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] Fix for xlsReadWrite 1.5.2 running in R2.12.0 (32-bit) on a Win7 64-bit platform
Argh, just now I saw a scrambled start-up message when running xlsReadWrite1.5.2 in R2.12.0 (32-bit) on a Win7 64-bit platform. If you have this situation and use xlsReadWrite 1.5.2 (probably all earlier versions also) you can download a quick fix, see below. I don't know if this also affects Vista/XP 64 bit. - Probably on the weekend I'll have time to release a proper new 1.5.3 version. This problem does _not_ occur on my Windows XP 32-bit and it also does not occur when running earlier R versions (2.11, 2.10) on Win7 64bit. No action is needed. Problem description: as it seems, windows line endings (crlf) no longer work in the above mentioned situation (at least in the startup message, maybe also for other console messages). Unix line endings (lf) seem to work fine, no more scrambling and the unit tests pass (of course). Fix (as mentioned only needed for R2.12 users on Win7 64 bit): - you can download a fixed dll from the normal swissr dropbox: http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/shlib/xlsReadWrite_1.5.2_dll.zip (md5 value: 192e045ba939d78d5097863959b020bd). Just replace the existing dll. - another way would be to delete the xlsReadWrite package locally and re-download from CRAN. The 'xls.getshlib()' command will fetch the updated dll - (I have removed the regular xlsReadWrite 1.5.2 package from the dropbox bin/win32/2.12 branch as it contains a dll with the above mentioned problem (unfortunately my make environment is broken for R2.12 building atm)) When executing 'library(xlsReadWrite)' with the updated dll, the startup message will read '..version 1.5.2 (sha1: )'. Changes have been pushed as http://github.com/swissr/xlsreadwrite/commit/17a8d1c076b622f842cae443ebff00b1bb254bbe. Cheers, Hans-Peter (author of xlsReadWrite) __ 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] Updates for xlsReadWrite (1.5.3) and xlsReadWritePro (1.6.1/3)
The xlsReadWrite[Pro] packages allow to natively read/write Excel files (.xls) on the Win 32-bit platform. About a week ago new package versions have been released: * xlsReadWrite 1.5.3 is available at CRAN (for R2.11/2.12) and from www.swissr.org/download (binary builds for R2.9 - R2.12) * xlsReadWritePro 1.6.3 is available from www.swissr.org/download (binary builds for R2.9 - R2.12) * (the full download listing is here: http://dl.dropbox.com/u/2602516/swissrpkg/index.html) ## Changes in xlsReadWrite 1.5.3 (0b78c1) ## - *important*: fix AV when reading large data (issue #110: in a subroutine a pointer (pSExp) had been 'riUnprotect'ed (Rf_unprotect) too early, the total protect/unprotect count was correct (of course) but when 'anyDuplicated' got called in the subroutine, the control flow switched to R and R then had the possibility to free 'my' pointer. Not good). Thanks to the (anonymous) user which submitted the nice bug report! - NaN values will be written as 'NaN' and behaviour (e.g. coercion) better accounts R (see read.xls.Rd, write.xls.Rd and unitTests/runitNaNaN.R). - 'dateTimeAs' argument in read.xls has been renamed to 'dateTime'. When using the default (which should be fine in most cases) this change won't affect you. - fix startup message scrambling in R2.12.0 (LF instead of CRLF - reported to Rdevel) - simplified file (unitTests/execManually.R) to run RUnit tests - misc. small/cosmetic changes (see github commits) - (internal) update makefile: support R2.12, much simplify targets, set/modify Windows System Path from within the makefile ## Changes in xlsReadWritePro 1.6.3 (93a6d7) ## - fix for startup message scrambling (use LF instead of CRLF - reported to Rdevel) - some more RUnit tests, cosmetic changes (typos, formatting, etc.) - (internal) update makefile: also support R2.12/2.9, much simplify targets, set/modify Windows System Path from within the makefile ## Changes in xlsReadWritePro version 1.6.1 ## This is a significant update and may require some small adjustments in your code. * Precompiled binary packages for R2.10 and R2.11 (see downloads) * While the package runs on R2.9 and R2.12, we have some issues with our automated 'binary-package-building-and-releasing' makefile. This will be fixed later. Please send us an email if you need the pkg for these versions now and we try to help. * Note: works with existing keys (even when already 4 years old;) Changes: --- 'meta' --- o test/ensure functionality with RUnit tests (>180) o improve consistency and add examples o issue tracking is public now and a forum has been added --- important --- o 'KEEP' argument/functionality DROPPED - reason: redundant, differences between the so-called 'keep-obj' and 'xls-obj' are confusing, complicates lowlevel code and hinders future enhancements - resolution: use xls.open, xls.new, xls.save, xls.cancel and xls.close instead o area-related arguments (from, rows, cells, ...) in read.xls/write.xls - CELLS argument SPLITTED into 'CELLS' and 'RANGE': - cells: pick single cell values and give them back as a vector or as a data.frame (the latter is new, type will be determined for each cell individually) - range: read ranges either by name or by a numeric 4-elem-vector (R1,C1,R2,C2) (A1 style, i.e. 'A1:C3', 'Sheet2!B42' could eventually be added here). o xls.sheet, NAMEORINDEX argument renamed - 'nameOrIndex' becomes 'sheet' and the default is the first/active sheet (depends if file is a physical file or an xls-obj) - 'copyAndInsert' action copies from the active sheet o xls.image, SHEET argument is needed! In light of this obligatory change the arguments have been reworked. Here are the current and older declaration: - curr.: xls.image(file, action, sheet = NA|NULL, img = NA, range = NA, target = NA) - beta: xls.image(file, action, img = NA, range = NA, name = NA) - old: xls.image(file = NA, action, nameOrIdx = NA, miscData = NA, keep = NA) o xls.range, NAMEORINDEX argument renamed - 'nameorindex' becomes 'range' o template location moved - new: R_HOME/library/xlsReadWrite/template/TemplateNew.xls - (old/erronous: R_HOME/library/xlsReadWrite/libs/template, reported by B. Ripley for free version) - (the template location in APPDATA remains unaffected) --- normal --- o read.xls - colClasses: recognizes boolean strings as logical, recognizes isodatetime formatted strings, isodatetime/isotime/isodate work for double and character string values. ??? todo: re-read formula values when one or more formulas have been modified: gives back 0 (instead of #NULL!). - rownames for data.frames are integers (when not read from Excel) - NEW ARGUMENT 'checkNames' to optionally treat colnames with 'make.names' - NEW ARGUMENT 'strictArea' - background: when the library opens an Excel file it determines the area which is containi
Re: [R] ReadWrite.xls problem
Toby, haruo0409, 2010/12/8 tkdweber : > This is my Error-Message in its German original: > Fehler in .Call("ReadXls", file, colNames, sheet, type, from, rowNames, : > Falsche Anzahl von Argumenten (11), erwarte 10 für ReadXls There was a wrong DLL for a short while in the old 1.5.2 version (I fixed a R2.12.0 related issue and unfortunately introduced this error). If you delete the old xlsReadWrite package and re-install the package (either from CRAN or see www.swissr.org/download) it really should work. 2010/12/10 haruo0409 : > I'm also annoyed at same problem. > I installed xlsReadWriter today and entered > x <- read.xls("data.xls",sheet=1) > But I got Error Message: > 以下にエラー .Call("ReadXls", file, colNames, sheet, type, from, rowNames, : > 引数の個数(11)が不正です。10 個が ReadXls に対しては必要です > (It's Japanese.Its English translation is the same as yours) What's the 'library(xlsReadWrite)' startup message? For the current version it should be: 'xlsReadWrite version 1.5.3 (0b78c1)'. Could you please give more details about 'I installed xlsReadWriter today' (which CRAN mirror, 'R.version' and '.Platform' output, is there only one 'xlsReadWrite.dll' file on your system). It is supposed to work and I am unable to find any problem. Thanks a lot! 2010/12/8 tkdweber : >Without being able to read data, the > programme renders pointless for me :-( There are many ways to read/write data in R: * Other than load/save you could use read.table/write.table (see R Data Import/Export). * Using Excel files is not the recommended way. However when you want/need it, there are several options (see http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows) Cheers, Hans-Peter PS. not that I mind to discuss things here, but as these are package specific problems I'd suggest to switch to the xlsReadWrite forum (http://dev.swissr.org/projects/xlsreadwrite/boards). You also can create an issue (http://dev.swissr.org/projects/xlsreadwrite/issues/new) or just send an email to 'support' at 'swissr.org'). __ 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] xlsReadWrite 1.5.4 and xlsReadWritePro 1.6.4 released
The xlsReadWrite[Pro] package allows to natively read and write Excel files (.xls) on the Win 32-bit platform. Changes: o fix bug with integer conversion (http://dev.swissr.org/issues/113) PROBLEM: values outside the integer range (i.e. 12345678901) didn't give an NA (and a warning message) but have been converted to a wrong value WHERE: - free/pro: reading an Excel sheet and explicitely defining: 'colClasses = "integer"' or 'type = "integer". It's assumed that only very few people do this. - pro: when (auto) detecting a data.frame column type for numeric values the type becomes an 'integer' in some situations. This probably affects more people than above SOLUTION: - an error will be raised for too large/small values (same as in read.table) - numeric data.frame column types default to 'double' (as in the free version) o adapt RUnit tests to new behaviour o some small cosmetic changes Credits to Gyorgy Ottucsak who found the problem in xlsReadWritePro and send us a report (incl. testfile). Thanks a lot! The new xlsReadWrite version will be submitted to CRAN in a moment. Both updated packages are available now from www.swissr.org/download or - full listing - here: http://dl.dropbox.com/u/2602516/swissrpkg/index.html. Cheers, Hans-Peter __ 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 dates in Excel into R
2010/7/30 Dimitri Liakhovitski : > I've wasted a lot of time trying to read in dates from Excel. Even > importing .csv files has not guarantees and often produces garbage > instead of dates. > What I found works best is saving the Excel data base as a > tab-delimited file .txt (after having formatted the dates in the > format you need, e.g., mm/dd/). And then you can read it > (including dates) into R no problems. If you are on windows and (can) use .xls files, my xlsReadWrite package should work well with dates. Cheers, Hans-Peter __ 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] Need to read an Excel File
2010/7/30 rajibshibly : > > I am trying to read an Excel file using the following: > a<-read.xls("mydata.xls", sheet=1) [snip] > Error in findPerl(verbose = verbose) : > perl executable not found. Use perl= argument to specify the correct path. > Error in file.exists(tfn) : invalid 'file' argument The 'read.xls' function in the the xlsReadWrite package (Win32 only) doesn't have external dependencies. Might be an option as well. Cheers, Hans-Peter __ 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] help
or library(xlsReadWrite) write.xls(tab, "somefile.xls") # not .xlsx or lots of other possibilities (e.g. RODBC, RExcel, gdata, WriteXLS) you would have found searching the mailling list archive or looking in the R import/export manual or the R wiki... Cheers, Hans-Peter __ 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] [R-pkgs] xlsReadWrite v1.5.2
Natively read and write Excel (.xls) files. Supports Windows 32-bit only (atm). A new version has been released: -- changes -- o read.xls - new arguments 'checkNames' - recognize NA values according to a new 'naStrings' argument - recognize NaN values - recognize 'true', 'false' (not case-sensitive) as logical when determing a class for data.frame column; when the value in the first cell is an integer, a numeric will be assumed nevertheless - colnames are more consistent with R usage (X, X.1, V1, etc.) - matrices always have rownames (as in data.frame). With FALSE rownames become (integer) 1:length(rows) - duplicated rownames no longer accepted - allow data with one row which is defined as being the colnames (i.e. no 'real' data row) - colNames/colClasses can optionally contain an entry for the column used for the rownames o write.xls - error (instead of warning) when length of character colnames doesn't fit data - write NA values according to the 'naStrings' (scalar) argument - write NaN values as 'NaN' string (instead of ending as #ZAHL!) - colNames can optionally contain an entry for the column used for the rownames o template location moved - new: R_HOME/library/xlsReadWrite/template/TemplateNew.xls - (old/erronous: R_HOME/library/xlsReadWrite/libs/template, reported by B. Ripley) o RUnit tests extended, loading simplified o improve examples and run them on the regular version, polish docu -- bugfixes -- o file: path may be absolute or relative to the current working directory. The 'relative' part was broken (feedback from several people) o xls.getshlib: sometimes existing dll could not be replaced. Now uses path of loaded dll instead of lib.loc and path (reported by G. Grothendieck) o use .Platform$r_arch for shlib path and R.version$platform in xls.getshlib to make pkg compatible with R2.12dev (reported and tips by B. Ripley) o several fixes related to row/colnames in special cases (without data) -- 'ecosystem' -- o issue tracking (developer) link change: - http://dev.swissr.org (was: https://redmine.swissr.org) - allow guest login and directly mention credentials Cheers, Hans-Peter ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ 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] Free license for xlsReadWritePro
Some years ago I travelled through Libya and it's with much emotion that I follow the news. The license below is dedicated to Mohammed Nabbous and will let you run xlsReadWritePro for free (Windows, R 32-bit): library( "xlsReadWritePro" ) xls.lic( action = "register", miscData = list( User = "R.I.P. Mohammed Nabbous", Company = "Let's hope that Libya will become free", Product = "xlsReadWritePro", Date = "2011-03-19", LicenseType = "SingleUser", Count = 1, Key = "76991137f5f554a288e8cee343a24722", WhereToStore = "ProgramFolder" ) ) Info/download at http://swissr.org. Direct download links at http://dl.dropbox.com/u/2602516/swissrpkg/index.html. Support (tracker) at http://dev.swissr.org/. Let's hope that Libya will become free, Hans-Peter __ 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] help to ... import the data from Excel
Jim, 2011/10/15 jim holtman : > You might also want to consider the XLConnect package. I have had > better luck reading/writing Excel files than with xlsReadWrite. XLConnect looks good but - as the xlsReadWrite author and planing to release a xlsx/64 bit successor - I'd be interested to learn what you mean with "better luck reading/writing". Thanks a lot and Cheers, Hans-Peter __ 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] help to ... import the data from Excel
2011/11/15 jim holtman : > Part of my problem has to do with getting through the corporate > firewall to access the other program I have to download to use it. I > just tried today and this is what I got: > >> xls.getshlib() > Loading required package: tools > --- xls.getshlib running... --- > - download.file from > 'http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/shlib/xlsReadWrite_1.5.4_dll.zip' > (timeout: 60) > Error in copyOrDownload(url) : > downloading > 'http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/shlib/xlsReadWrite_1.5.4_dll.zip' > to 'C:\DOCUME~1\kon9407\LOCALS~1\Temp\RtmpQR6rWi/xlsReadWrite.zip' failed > In addition: Warning message: > In download.file(url, fpzip.temp, method = "internal", quiet = TRUE, : > cannot open: HTTP status was '403 Forbidden' Yes unfortunately quite some people had problems downloading the shlib because dropbox (where I host the file) is being blocked b/c of corporate policies. I am working on a successor, xlReadWrite (which supports xlsx, 64 bit and probably Macs) where I try to find a better solution (probably a mirror on my own server). > I think when I was using it in the past, I had some problem with > writing to multiple output sheets so I could create tabs on the > workbook, but not really sure what was happening at the time. I have > had better luck with XLConnect in creating tabbed workbooks. Writing multiple tabs was never supported in the free version (only in Pro). XLConnect certainly looks good and also has the advantage that it is FOSS, something I cannot do because of the usage of a proprietary library. Cheers, Hans-Peter __ 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] Building binary package fails because of missing dependent package
On an (Intel Leopard) Mac I try to build a package (mxFinance) which depends on another package (mxGraphics). The dependendy is 1) a 'Depends:' in DESCRIPTION and 2) an import in NAMESPACE. - The build fails if the dependent package (mxGraphics) is not installed in the R.framework Do I need to have installed all packages which are required by packages to be built binary (source builds are ok)? Cheers, Hans-Peter --- Macintosh:mxFinance chappi$ R CMD BUILD --binary mxFinance * checking for file 'mxFinance/DESCRIPTION' ... OK * preparing 'mxFinance': * checking DESCRIPTION meta-information ... OK * cleaning src * removing junk files * checking for LF line-endings in source and make files * checking for empty or unneeded directories * building binary distribution * Installing *source* package 'mxFinance' ... ** libs ** arch - i386 gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -msse3 -fPIC -g -O2 -march=nocona -c init.c -o init.o gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o mxFinance.so init.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation ld: warning, duplicate dylib /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libgcc_s.1.dylib ** arch - ppc gcc -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/ppc -I/usr/local/include-fPIC -g -O2 -c init.c -o init.o gcc -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o mxFinance.so init.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation ld: warning, duplicate dylib /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libgcc_s.1.dylib ** R ** data ** preparing package for lazy loading Loading required package: mxGraphics Warning in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : there is no package called 'mxGraphics' Error: package 'mxGraphics' could not be loaded Execution halted ERROR: lazy loading failed for package 'mxFinance' ** Removing '/var/folders/xr/xr01D7JAEtGe4S5uaDQSgTI/-Tmp-/Rinst881133514/mxFinance' ERROR * installation failed __ 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] problem with writing data to *.xls file
> I read data from *.xls file and i did some caliculations on that data and > now i have to create a column in the same .xls file > i tried it with *write.xls() *but the thing is it deleted all the columns > previously presented in that file and it created a column and inserted data > can any one suggest what to do for this You cannot insert a column in the sheet but you can write a data matrix/frame which contains the newly calculated column. myfile <- "test.xls" # read data #dat <- read.xls( myfile ) dat <- cbind( 1:4, rep(41,4), rep(43,4) ) # calculate and prepare full data to write calc <- dat[,2] + 1 dat <- cbind( dat[,1], dat[,2], calc, dat[,3] ) # write (sheet will be overwritten with new data) #write.xls( dat, myfile ) -- Regards, Hans-Peter __ 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] Dates and times from Excel
> Excel stores times of the day as fractions of a day so I wrote a function to > convert the fraction to a number of seconds, extract the hours, minutes and > seconds and output it in ISO standard format (%H:%M:%S). What about the 'colClasses' or 'dateTimeAs' argument in 'read.xls' which gives back an iso-date-time character string. Or you could use the 'dateTimeToStr' function to convert the date number to a character string formatted as indicated. As a question: would additional entries (e.g.) 'posixctdatetime' and/or 'chrondatetime' for the 'colClasses' argument be useful? -- Regards, Hans-Peter __ 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] xlsReadWrite package repository for Ubuntu
2009/3/2 Prof Brian Ripley : > The CRAN Windows ones. It is a windows-only package, see > http://cran.r-project.org/web/packages/xlsReadWrite/index.html > (incidentally to you: it seems no longer maintained and does not build under > R-devel on Windows, see > http://cran.r-project.org/bin/windows/contrib/2.9/check/xlsReadWrite-check.log > The maintainer has not responded to requests for a fix.) I didn't get a request (my email was ' instead of ). I'll look into the issue this weekend. However there might be a problem because the package contains binary code and maybe xlsReadWrite has to be put on a place other than CRAN (I'll ask Rcore about this in a separate email). In any case I absolutely intend to maintain the package also in future. AFAIK it works well (apart from a small rowname bug which surfaced recently ;-) and provides a pragmatic alternative to the OSS R packages gdata and RODBC) 2009/3/3 Marc Schwartz : > You perhaps missed the key point in Uwe's response, which is that the > package is only available under Windows, as it depends upon Windows > specific functionality (MS Office API via a third party library which is > available for Windows only) to natively read and write Excel files. It's correct that xlsReadWrite is currently only available for Windows. However it doesn't use the MS Office API but works directly with the file format (BIFF8), i.e. Excel is _not_ required. True is, that it uses a third party library (Flexcel, TMSSoftware). This library supports FreePascal which means that theoretically xlsReadWrite could be compiled for Linux/Mac (tried once, didn't succeed, will try again later (now also using Macs and Debian/Ubuntu)). -- Regards, Hans-Peter __ 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] Creating an Excel file with multiple spreadsheets
2009/3/9 Phil Spector : > The xlsReadWrite package provides write.xls for Windows, but it cannot write _multiple_ spreadsheets -- Regards, Hans-Peter __ 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] read.xls question
2009/3/15 David Scott : > On Sat, 14 Mar 2009, Mathew, Abraham T wrote: > [snip] > Just checking on CRAN xlsReadWrite is not currently available. There is an > archived version available however. Thanks for mentioning. The reason is that CRAN is strict(er) now with binary submissions (which is not a bad thing) and the build also broke technically with R-2.9 because I used a private build variable which is no longer supported. I adapted the package to use C code and download the necessary 3rd party binary code from an external e.g. non-CRAN site. Now I am waiting to get the ok from the 3rd party library provider before submitting it again and see what is possible. Besides from the archive you can get the xlsReadWrite package here: http://treetron.googlepages.com/ (direct link: http://treetron.googlepages.com/xlsReadWrite_1.3.3.zip). - As an R newbie (OP) it is maybe better to use something more standard,e.g. RODBC package, eventually (it's good but you need Perl!) the gdata package or use plain old .csv files (but watch out fro dropped decimal places!) . 2009/3/15 Rodrigo Aluizio : > [snip] > A better alternative to this package is RODBC, which also read excel 2007 > files. Take a look on it at the CRAN web site. If you mean better because of Excel 2007 then I disagree: xls files work well with Excel 2007, the format is widely in use and if you reach their limit (65536 rows by 256 columns) you'd better choose a database (and use RODBC) imho. Reading natively without depending on additional layers (driver, perl, COM) benefits too. - If you mean 'more R standard' or OSS then I agree. Cheers, Hans-Peter __ 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.