search for: lobstr

Displaying 13 results from an estimated 13 matches for "lobstr".

2020 Mar 27
2
object.size vs lobstr::obj_size
...? ?object.size(new("A", stuff=raw(0)))? ? ? # 680 bytes > ? ?object.size(new("A", stuff=runif(1e8)))? # 680 bytes > > Why wouldn't object.size() look at the content of environments? > > > As the author, I'm obviously biased, but I do like lobstr::obj_sizes() > which allows you to see the additional size occupied by one object given > any number of other objects. This is particularly important for > reference classes since individual objects appear quite large: > > A <- setRefClass("A", fields=c(stuff="A...
2020 Mar 27
1
object.size vs lobstr::obj_size
...es > >? ? ? ? ?object.size(new("A", stuff=runif(1e8)))? # 680 bytes > > > >? ? ?Why wouldn't object.size() look at the content of environments? > > > > > > As the author, I'm obviously biased, but I do like > lobstr::obj_sizes() > > which allows you to see the additional size occupied by one > object given > > any number of other objects. This is particularly important for > > reference classes since individual objects appear quite large: > > > > A...
2020 Mar 27
0
object.size vs lobstr::obj_size
...;A", stuff=raw(0))) # 680 bytes > > object.size(new("A", stuff=runif(1e8))) # 680 bytes > > > > Why wouldn't object.size() look at the content of environments? > > > > > > As the author, I'm obviously biased, but I do like lobstr::obj_sizes() > > which allows you to see the additional size occupied by one object given > > any number of other objects. This is particularly important for > > reference classes since individual objects appear quite large: > > > > A <- setRefClass("A", f...
2020 Mar 27
4
object.size vs lobstr::obj_size
Hi Tomas, On 3/27/20 07:01, Tomas Kalibera wrote: > they provide an over-approximation They can also provide an "under-approximation" (to say the least) e.g. on reference objects where the entire substance of the object is ignored which makes object.size() completely meaningless in that case: setRefClass("A", fields=c(stuff="ANY"))
2020 Mar 27
0
object.size vs lobstr::obj_size
...="ANY")) > object.size(new("A", stuff=raw(0))) # 680 bytes > object.size(new("A", stuff=runif(1e8))) # 680 bytes > > Why wouldn't object.size() look at the content of environments? > As the author, I'm obviously biased, but I do like lobstr::obj_sizes() which allows you to see the additional size occupied by one object given any number of other objects. This is particularly important for reference classes since individual objects appear quite large: A <- setRefClass("A", fields=c(stuff="ANY")) lobstr::obj_size(...
2020 Feb 19
2
object.size vs lobstr::obj_size
....ethz.ch/pipermail/r-help/2020-February/465700.html My apologies for cross-posting, which I am aware is impolite and I should have posted on R-devel in the first place - but I wasn't sure. Here is my question again: I am currently working through Advanced R by H. Wickham and came across the `lobstr::obj_size` function which appears to calculate the size of an object by taking into account whether the same object has been referenced multiple times, e.g. x <- runif(1e6) y <- list(x, x, x) lobstr::obj_size(y) # 8,000,128 B # versus: object.size(y) # 24000224 bytes Reading through `?obje...
2020 Mar 27
0
object.size vs lobstr::obj_size
...ry/465700.html > > My apologies for cross-posting, which I am aware is impolite and I > should have posted on R-devel in the first place - but I wasn't sure. > > Here is my question again: > > I am currently working through Advanced R by H. Wickham and came > across the `lobstr::obj_size` function which appears to calculate the > size of an object by taking into account whether the same object has > been referenced multiple times, e.g. > > x <- runif(1e6) > y <- list(x, x, x) > lobstr::obj_size(y) > # 8,000,128 B > > # versus: > object....
2020 Mar 27
0
object.size vs lobstr::obj_size
On 3/27/20 4:39 PM, Herv? Pag?s wrote: > Hi Tomas, > > On 3/27/20 07:01, Tomas Kalibera wrote: >> they provide an over-approximation > > They can also provide an "under-approximation" (to say the least) e.g. > on reference objects where the entire substance of the object is > ignored which makes object.size() completely meaningless in that case: > > ?
2024 Mar 04
1
[External] Re: capture "->"
...ols instead of the problematic -> and <-, for example you could use <.~ and ~.> which are not at all flipped or changed before you get a chance to parse your expression. It might make your language parser a bit trickier though. Let's see how these things turn into R's AST using `lobstr`: > library(lobstr) > ast(A ~.> B) ??`~` ??A ????`>` ??. ??B > ast(A <.~ B) ??`~` ????`<` ? ??A ? ??. ??B You'd have to unpick that tree to figure out you've got A and B on either side of your expression, and that the direction of the expression is L-R or R-L....
2019 Aug 29
2
?Syntax wrong about `?`'s precedence ?
...using `<-` : x <- 2 ? 3 #> [1] 5 x #> [1] 2 Here first `x <- 2` is evaluated, then its output is added to 3, and the result `5` is printed. and we verify that `x` is still `2`. Showing lower precedence for `?` consistent with the doc. Hadley Wickham's package `lobstr` makes it easy to compare the parse trees: lobstr::ast({x = 2 ? 3}) #> o-`{` #> \-o-`=` #> +-x #> \-o-`?` #> +-2 #> \-3 lobstr::ast({x <- 2 ? 3}) #> o-`{` #> \-o-`?` #> +-o-`<-` #> | +-x #>...
2024 Mar 04
1
[External] Re: capture "->"
...gt; problematic -> and <-, for example you could use <.~ and ~.> which are not > at all flipped or changed before you get a chance to parse your expression. > It might make your language parser a bit trickier though. Let's see how > these things turn into R's AST using `lobstr`: > > > library(lobstr) > > ast(A ~.> B) > ??`~` > ??A > ????`>` > ??. > ??B > > ast(A <.~ B) > ??`~` > ????`<` > ? ??A > ? ??. > ??B > > You'd have to unpick that tree to figure out you've got A and B on either &gt...
2024 Mar 04
1
[External] Re: capture "->"
...<-, for example you could use <.~ and ~.> which are > not > > at all flipped or changed before you get a chance to parse your > expression. > > It might make your language parser a bit trickier though. Let's see how > > these things turn into R's AST using `lobstr`: > > > > > library(lobstr) > > > ast(A ~.> B) > > ??`~` > > ??A > > ????`>` > > ??. > > ??B > > > ast(A <.~ B) > > ??`~` > > ????`<` > > ? ??A > > ? ??. > > ??B > > > > You...
2019 Jul 21
1
Recommended Reading: Advanced R Second Edition
...nity member interested in the development of R reads "Advanced R Second Edition", which explains R Language Core concepts cristal clear, and shows the motivation behind libraries such as "rlang", "purrr", "bench", "profvis", "sloop", "lobstr", above others. I'm sure you will learn something new and enjoy the Reading! Digital Book (Free): https://adv-r.hadley.nz/ Physical Book: https://www.amazon.com/Advanced-Second-Chapman-Hall-CRC/dp/0815384572/ref=mp_s_a_1_1?keywords=advanced+r+second+edition&qid=1563703482&s=gate...