Re: [Rd] Convert "\" to "/"?
Hi, Garrett: On 6/9/2012 7:54 PM, G See wrote: One work around is to comment out the lines that `scan` reads. (x<- back2ForwardSlash()) #c:\Users\ all.equal(x, '#c:/Users/') Thanks. This works well enough to be useful. Or, you could pass a text arg through the dots (x<- back2ForwardSlash(text="c:\\\users")) all.equal(x, 'c:/users') This is not acceptable, because "sos-manual.pdf" displays ... 'text="c:\\users"', which would likely confuse readers. Thanks again. Spencer HTH, Garrett On Sat, Jun 9, 2012 at 8:40 PM, Spencer Graves wrote: Hello, All: I have for years copied an address like "C:\Program Files\R\R-2.15.0\library\MASS\scripts" from Windows Explorer into R, then manually replaced "\" with "/". I have a function to automate this added to the development version of "sos". However, it generates a warning in "R CMD check" ("parse error: unexpected input"). I have so far not found a way to eliminate the warning without wrapping examples in "\dontrun" or making the examples hard to understand; neither of these alternatives are acceptable. The following is my current solution: back2ForwardSlash<- function(nmax=1, what=character(), sep='\n', ...){ x2<- scan(what=what, nmax=nmax, sep=sep, ...) x.<- gsub('\\', '/', x2, fixed = TRUE) } (x<- back2ForwardSlash()) c:\Users\ all.equal(x, 'c:/Users/') # TRUE x2.<- back2ForwardSlash(2) c:\u\a b\n o d:/pqr/ all.equal(x2., c('c:/u/a b/n o', 'd:/pqr/')) # TRUE QUESTION: Might anyone have a better solution and / or simple, clear examples that do not generate a warning in "R CMD check"? NOTE: In case you want to try this development version of "sos" including this function, it is available via "svn checkout svn://svn.r-forge.r-project.org/svnroot/rsitesearch/" or install.packages('sos', repos = "http://R-Forge.R-project.org";). Thanks, Spencer p.s. Prof. Ripley provided a way to do this on R-help several years ago. Unfortunately, I've been unable to find his solution. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] x11 icon and class
On 7 June 2012 at 15:05, Philip Johnson wrote: | The X11 device driver does not provide the X window manager with an icon | (_NET_WM_ICON) or, under some circumstances, with a class (WM_CLASS). Nice! That had bugged me for a few years too as things like various taskbars and panels never show the R logo for eg the plot windows. If R Core does not respond to this, I suggest you and take this offline and try to see if I can make this a regular patch for the Debian package which underlies the Ubuntu distribution package as well as the Debian / Ubuntu "backports" available via CRAN. I guess I could test with the pre-releases of R 2.15.1. Cheers, Dirk | This hinders usability under the new stable version of Ubuntu, which has | a (new) user interface centered around icons. | | I am not sure if this was a conscious choice by r-core or simply a low | priority. In case of the latter, I attach a patch against R-devel (as | of 6 June) that specifies: |1) _NET_WM_ICON as a slightly tweaked version of Rlogo-5.png (48x48 | pixels, circle filled-in with white to be legible; ARGB data hardcoded | as a constant array in a new file "rlogo_icon.h"). |2) WM_CLASS (for reasons unclear to me, previously WM_CLASS was only | set #ifndef USE_Xt) | l | As Ubuntu is the single most popular linux distribution, perhaps others | will find this patch useful. I have tested on both 32- and 64-bit | versions of linux. | | Regards, | Philip | | -- | diff -Naur R-devel/src/modules/X11/devX11.c R-devel-patched/src/modules/X11/devX11.c | --- R-devel/src/modules/X11/devX11.c 2012-05-28 20:53:33.0 -0400 | +++ R-devel-patched/src/modules/X11/devX11.c 2012-06-07 14:48:40.359041743 -0400 | @@ -70,6 +70,7 @@ | typedef int (*X11IOhandler)(Display *); | | #include "devX11.h" | +#include "rlogo_icon.h" /* hard-coded ARGB icon */ | | #include | | @@ -1580,8 +1581,9 @@ | | XStoreName(display, xd->window, xd->title); | | -#ifndef USE_Xt | /* For those too idle to make use of Xt (PR#14588) */ | +/* Not sure reason for above comment -- even with Xt, WM_CLASS | + is not set on xd->window */ | XClassHint *chint; | chint = XAllocClassHint(); | if (chint) { | @@ -1590,7 +1592,13 @@ | XSetClassHint(display, xd->window, chint); | XFree(chint); | } | -#endif | + | +/* set window icon -- hardcoded into rlogo_icon.h */ | +XChangeProperty(display, xd->window, | +XInternAtom(display, "_NET_WM_ICON", False), | +XInternAtom(display, "CARDINAL", False), 32, | +PropModeReplace, | +(const unsigned char*) rlogo_icon, 2 + 48*48); | | /* set up protocols so that window manager sends */ | /* me an event when user "destroys" window */ | diff -Naur R-devel/src/modules/X11/rlogo_icon.h R-devel-patched/src/modules/X11/rlogo_icon.h | --- R-devel/src/modules/X11/rlogo_icon.h 1969-12-31 19:00:00.0 -0500 | +++ R-devel-patched/src/modules/X11/rlogo_icon.h 2012-06-07 14:54:07.219041708 -0400 | @@ -0,0 +1,51 @@ | +unsigned long rlogo_icon[] = { | +48,48, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1868983,0x27e837a,0x6959595,0x2a888b85,0x5881857f,0x7d7f827b,0x9b7e827a,0xb17c8078,0xc07c7f78,0xc97c8179,0xca797e76,0xc3777c73,0xb4777b74,0x9d747971,0x8074786f,0x5b757870,0x2e797d75,0x77e847e,0x164685f,0x16b7168,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, | + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38a8d88,0x68b8f89,0x288b8e89,0x71868983,0xba848881,0xf68
[Rd] Multiple sub-architecture: linking issue
On 8 June 2012 at 12:27, Renaud Gaujoux wrote: | PS: Dirk do you want me to post this on the Rcpp list for record? Yes, that generally is where Rcpp questions / comments / hints should go. As for multi-arch builds, I am not sure we even thought about supporting this so if it breaks your use of Rcpp and related packages, you get to keep the pieces. That said, I'd be interested in supporting it eventually but I guess I want to first understand better how/if it is supported (on Linux) by R itself. Dirk -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Multiple sub-architecture: linking issue
On Jun 10, 2012, at 9:24 PM, Dirk Eddelbuettel wrote: > > On 8 June 2012 at 12:27, Renaud Gaujoux wrote: > | PS: Dirk do you want me to post this on the Rcpp list for record? > > Yes, that generally is where Rcpp questions / comments / hints should go. > > As for multi-arch builds, I am not sure we even thought about supporting this > so if > it breaks your use of Rcpp and related packages, you get to keep the pieces. > That said, I'd be interested in supporting it eventually but I guess I want > to first understand better how/if it is supported (on Linux) by R itself. > R itself of course supports it and essentially all packages (including Rcpp ;)) have to because we require it on Windows and OS X since all binaries there are multi-lib. As far as R is concerned it works equally well on Linux - the problem there is more on the side of distributions, because it is more unusual to have multi-lib Linux (originally it was used on Linux only to get 3rd party [mostly proprietary] 32-bit binaries working on 64-bit systems and that is now less of an issue). As I said in the original post it works reasonably well on Debian (not for all libraries since only a subset is available, but all the basic ones) -- there were shakeups in Ubuntu which were messing with the multilib support, so I don't know the current status but I can check at work tomorrow (probably not for something as ancient as natty, though). Cheers, Simon > > -- > Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel