[Rd] Hex sticker
Is there a canonical place to add a hex sticker to a package? I've found use of man/figures and inst/. A nice sticker has been made for survival and since it is a required package I don't want to mess it up. Terry T. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Hex sticker
FWIW man/figures/logo.png is picked up by pkgdown web sites, and also by roxygen if you have a man page for the package itself. Gabor On Tue, Jan 22, 2019 at 1:34 PM Therneau, Terry M., Ph.D. via R-devel wrote: > > Is there a canonical place to add a hex sticker to a package?I've found > use of > man/figures and inst/. > A nice sticker has been made for survival and since it is a required package > I don't want > to mess it up. > > Terry T. > > > [[alternative HTML version deleted]] > > __ > 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] Objectsize function visiting every element for alt-rep strings
On Mon, 21 Jan 2019, Martin Maechler wrote: >> Travers Ching >> on Tue, 15 Jan 2019 12:50:45 -0800 writes: > >> I have a toy alt-rep string package that generates >> randomly seeded strings. example: library(altstringisode) >> x <- altrandomStrings(1e8) head(x) [1] >> "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1" >> "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc object.size(1e8) > >> Object.size will call the set_altstring_Elt_method for >> every single element, materializing (slowly) every element >> of the vector. This is a problem mostly in R-studio since >> object.size is called automatically, defeating the purpose >> of alt-rep. There is no sensible way in general to figure out how large the strings would be without computing them. There might be specifically for a deferred sequence conversion but it would require a fair bit of effort to figure out that would be better spent elsewhere. I've never been a big fan of object.size since what it is trying to compute isn't very well defined in the context of sharing and possible internal state changes (even before ALTREP byte code compilation could change the internals of a function [which object.size sees] and assigning into environments or evaluating promises can change environments [which object.size ignores]). The issue is not unlike the one faced by identical(), which has a bunch of options for the different ways objects can be identical, and might need even more. We could in general have object.size for and ALTREP return the object.size results of the current internal representation, but that might not always be appropriate. Again, what object.size is trying to compute isn't very well defined. RStudio does seem to call object.size on every assignment to .GlobalEnv. That might be worth revisiting. Best, luke > > Hmm. But still, the idea had been that object.size() *shuld* > return the size of the "de-ALTREP'ed" object *but* should not > de-ALTREP it. > That's what happens for integers, but indeed fails to happen for > such as.character(.)ed integers. > > From my eRum presentation (which took from the official ALTREP documentation > https://svn.r-project.org/R/branches/ALTREP/ALTREP.html ) : > > > x <- 1:1e15 > > object.size(x) # 8000'000'000'000'048 bytes : 8000 TBytes -- ok, not really > 8048 bytes > > is.unsorted(x) # FALSE : i.e., R's *knows* it is sorted > [1] FALSE > > xs <- sort(x) # > > .Internal(inspect(x)) > @80255f8 14 REALSXP g0c0 [NAM(7)] 1 : 1000 (compact) > > > > > cx <- as.character(x) > > .Internal(inspect(cx)) > @80485d8 16 STRSXP g0c0 [NAM(1)] >@80255f8 14 REALSXP g1c0 [MARK,NAM(7)] 1 : 1000 (compact) > > system.time( print(object.size(x)), gc=FALSE) > 8048 bytes > user system elapsed >0.000 0.000 0.001 > > system.time( print(object.size(cx)), gc=FALSE) > Error: cannot allocate vector of size 8388608.0 Gb > Timing stopped at: 11.43 0 11.46 > > > > One could consider it a bug that object.size(cx) is indeed > inspecting every string, i.e., accessing cx[i] for all i. > Note that it is *not* deALTREPing cx itself : > >> x <- 1:1e6 >> cx <- as.character(x) >> .Internal(inspect(cx)) > > @7f5b1a0 16 STRSXP g0c0 [NAM(1)] > @7f5adb0 13 INTSXP g0c0 [NAM(7)] 1 : 100 (compact) >> system.time( print(object.size(cx)), gc=FALSE) > 6448 bytes > user system elapsed > 0.369 0.005 0.374 >> .Internal(inspect(cx)) > @7f5b1a0 16 STRSXP g0c0 [NAM(7)] > @7f5adb0 13 INTSXP g0c0 [NAM(7)] 1 : 100 (compact) >> > >> Is there a way to avoid the problem of forced >> materialization in rstudio? > >> PS: Is there a way to tell if a post has been received by >> the mailing list? How long does it take to show up in the >> archives? > > [ that (waiting time) distribution is quite right skewed... I'd > guess it's median to be less than 10 minutes... but we had > artificially delayed it somewhat in the past to fight > spammers, and ETH (the hosting instituttion) and others have > increased spam and virus filtering so everything has become > quite a bit slower ] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: luke-tier...@uiowa.edu Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Objectsize function visiting every element for alt-rep strings
I think that object.size() is most commonly used to answer the question, "what R objects are consuming the most memory currently in my R session?" and for that reason I think returning the size of the internal representations of objects (for e.g. ALTREP objects; unevaluated promises) is the right default behavior. I also agree it would be worth considering adding arguments that control how object.size() is computed for different kinds of R objects, since users might want to use object.size() to answer different types of questions. All that said, if the ultimate goal here is to avoid having RStudio materialize ALTREP objects in the background, then perhaps that change should happen in RStudio :-) Best, Kevin On Tue, Jan 22, 2019 at 8:21 AM Tierney, Luke wrote: > On Mon, 21 Jan 2019, Martin Maechler wrote: > > >> Travers Ching > >> on Tue, 15 Jan 2019 12:50:45 -0800 writes: > > > >> I have a toy alt-rep string package that generates > >> randomly seeded strings. example: library(altstringisode) > >> x <- altrandomStrings(1e8) head(x) [1] > >> "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1" > >> "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc object.size(1e8) > > > >> Object.size will call the set_altstring_Elt_method for > >> every single element, materializing (slowly) every element > >> of the vector. This is a problem mostly in R-studio since > >> object.size is called automatically, defeating the purpose > >> of alt-rep. > > There is no sensible way in general to figure out how large the > strings would be without computing them. There might be specifically > for a deferred sequence conversion but it would require a fair bit of > effort to figure out that would be better spent elsewhere. > > I've never been a big fan of object.size since what it is trying to > compute isn't very well defined in the context of sharing and possible > internal state changes (even before ALTREP byte code compilation could > change the internals of a function [which object.size sees] and > assigning into environments or evaluating promises can change > environments [which object.size ignores]). The issue is not unlike the > one faced by identical(), which has a bunch of options for the > different ways objects can be identical, and might need even more. > > We could in general have object.size for and ALTREP return the > object.size results of the current internal representation, but that > might not always be appropriate. Again, what object.size is trying to > compute isn't very well defined. > > RStudio does seem to call object.size on every assignment to > .GlobalEnv. That might be worth revisiting. > > > Best, > > luke > > > > > Hmm. But still, the idea had been that object.size() *shuld* > > return the size of the "de-ALTREP'ed" object *but* should not > > de-ALTREP it. > > That's what happens for integers, but indeed fails to happen for > > such as.character(.)ed integers. > > > > From my eRum presentation (which took from the official ALTREP > documentation > > https://svn.r-project.org/R/branches/ALTREP/ALTREP.html ) : > > > > > x <- 1:1e15 > > > object.size(x) # 8000'000'000'000'048 bytes : 8000 TBytes -- ok, not > really > > 8048 bytes > > > is.unsorted(x) # FALSE : i.e., R's *knows* it is sorted > > [1] FALSE > > > xs <- sort(x) # > > > .Internal(inspect(x)) > > @80255f8 14 REALSXP g0c0 [NAM(7)] 1 : 1000 (compact) > > > > > > > > cx <- as.character(x) > > > .Internal(inspect(cx)) > > @80485d8 16 STRSXP g0c0 [NAM(1)] > >@80255f8 14 REALSXP g1c0 [MARK,NAM(7)] 1 : 1000 (compact) > > > system.time( print(object.size(x)), gc=FALSE) > > 8048 bytes > > user system elapsed > >0.000 0.000 0.001 > > > system.time( print(object.size(cx)), gc=FALSE) > > Error: cannot allocate vector of size 8388608.0 Gb > > Timing stopped at: 11.43 0 11.46 > > > > > > > One could consider it a bug that object.size(cx) is indeed > > inspecting every string, i.e., accessing cx[i] for all i. > > Note that it is *not* deALTREPing cx itself : > > > >> x <- 1:1e6 > >> cx <- as.character(x) > >> .Internal(inspect(cx)) > > > > @7f5b1a0 16 STRSXP g0c0 [NAM(1)] > > @7f5adb0 13 INTSXP g0c0 [NAM(7)] 1 : 100 (compact) > >> system.time( print(object.size(cx)), gc=FALSE) > > 6448 bytes > > user system elapsed > > 0.369 0.005 0.374 > >> .Internal(inspect(cx)) > > @7f5b1a0 16 STRSXP g0c0 [NAM(7)] > > @7f5adb0 13 INTSXP g0c0 [NAM(7)] 1 : 100 (compact) > >> > > > >> Is there a way to avoid the problem of forced > >> materialization in rstudio? > > > >> PS: Is there a way to tell if a post has been received by > >> the mailing list? How long does it take to show up in the > >> archives? > > > > [ that (waiting time) distribution is quite right skewed... I'd > > guess it's median to be less than 10 minutes... but we had > > artificially delayed it somewhat in the past to fight > > s
Re: [Rd] pmax and long vector
> Kasper Daniel Hansen > on Mon, 21 Jan 2019 21:51:55 -0500 writes: > Gabe, I don't (yet) know much about long vectors at the C level. So feel > free to address this. > Duncan, I'll see what I can do regarding systematically compiling a list of > functions without long vector support. These days I frequently work with > big enough matrices that I need it. Thank you, Kasper, Duncan and Gabriel! I agree with Duncan about "probably be useful to R Core". Best, Martin > On Mon, Jan 21, 2019 at 3:09 PM Gabriel Becker > wrote: >> Kasper, >> >> If you're not interested or dont have time to create said patch yourself >> let me know and i can do it. >> >> Best, >> ~G >> >> On Mon, Jan 21, 2019, 11:36 AM Duncan Murdoch > wrote: >> >>> On 21/01/2019 12:35 p.m., Kasper Daniel Hansen wrote: >>> > I see that base::pmax() does not support long vectors. >>> > >>> > Is R-devel interested in reports like this; ie. is there a goal of full >>> > support for long vectors in "basic" functions, something I at least >>> would >>> > greatly appreciate? >>> > >>> > MRE: >>> > >>> >> pmax(rep(1L, 3*10^9), 0) >>> > >>> > Error in pmax(rep(1L, 3 * 10^9), 0) : >>> >long vectors not supported yet: >>> > ../../../R-devel-src/src/include/Rinlinedfuns.h:522 >>> >>> >>> I think a carefully tested patch that fixes pmax (it would need to >>> change this call from length() to xlength(), and make some other >>> necessary changes that follow from this), would probably be useful to R >>> Core, and could be posted to bugs.r-project.org. >>> >>> It might also be useful on R-devel to post a list of all known commonly >>> used functions that don't support long vectors; this could be updated on >>> a regular basis. This might encourage people to produce patches as above. >>> >>> I'm not so sure a report about a single function won't just get lost. >>> >>> Duncan Murdoch >>> >>> __ >>> R-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-devel >>> >> > [[alternative HTML version deleted]] > __ > 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