« first day (706 days earlier)      last day (2592 days later) » 

1:06 AM
3 messages moved to Trash
 
 
4 hours later…
4:42 AM
@Sotos, not metal, but enjoyable in a nerdy way: youtube.com/watch?v=h3kqBX1j7f8
 
5:06 AM
i give rstudio a D for effort:
2
Q: Disable Auto completion in R studio

PaulFraterDoes anyone know how to completely disable automatic completions in Rstudio? I don't see an option for it in Tools > Global Options; only a way to turn it to 'Manual (tab)' or 'When Triggered'. I can't enter a tab while typing code and it's driving me crazy. Thanks, Paul

i don't know how people can use this without within-line indentation
 
6:07 AM
@Frank Ctrl-I does reindent lines
 
6:20 AM
Morning all
@A5C1D2H2I1M1N2O1R2T1 hah.... George Kollias is in there! I jammed with him a couple of times :)
 
Hello all
 
Hi @jogo
 
howdy
I'm trying to translate a load of data.table commands into SQL... feel like I'm taking a giant programming step backwards
 
6:42 AM
Hi all !
 
@Cath Hello. Maybe you should undelete your answer where I used crossprod. OP says my values are incorrect, so maybe your approach gives them what they're after....
 
Hello
Another useless tag
 
@A5C1D2H2I1M1N2O1R2T1 Hi Ananda, well crossprod was the function I was trying to remember but couldn't hence the handmade solution :-/. I don't see how your solution would not work but if OP gave data for the special case, I can try my way on them. Maybe OP is wrong about what they think should be the output ;-)
 
Aloha!
 
6:59 AM
Hello @A5C1D2H2I1M1N2O1R2T1 . thx for editing my answer yesterday.
 
7:13 AM
8 messages moved to Trash can
 
@mtoto In the question or answer? You link to a comment...
 
sorry, meant the Q
 
rforexcelusers.com/book ... why not just get R book.
 
"You will finally be able to work with bigger data. Take on more interesting projects at work and look like a genius to your coworkers."
 
8:09 AM
Yeah, with 1048576 rows in Excel it's not a big data.
 
Howdy
 
What is the dplyr solution for this: stackoverflow.com/questions/18462736
 
mutate_each?
 
@m0nhawk would this add as new column or mutate existing ones? I want to avoid cbind step
by the way feel free to add answers, I have no intention.
 
0
A: Loop through columns and add string lengths as new columns

m0nhawkWith dplyr you can use mutate_each: > df %>% mutate_each(funs(length = str_length(.))) col1 col2 col1_length col2_length 1 abc adf qqwe 3 8 2 abcd d 4 1 3 a e 1 1 4 abcdefg f 7 ...

:D
Already.
@zx8754 Yes, it will create a new one.
 
8:23 AM
nice, thank you
 
But, if you specify just funs(str_length(.)), without length = , then it will replace.
 
Do you mind adding this base lapply for completeness? cbind(df, lapply(lapply(df, as.character), nchar))
 
"summarise_each() and mutate_each() will be deprecated in a future release."
 
o_O replaced with what
 
Will be replaced with mutate_all, mutate_at and mutate_if. :)
@zx8754 That's the same, as other answer, no?
 
8:29 AM
the other one needs stringr package, up to you of course :)
 
Oh.
You can add. I prefer not to post several answers in one answer.
 
8:46 AM
Interesting, can you come up with math way of doing this, avoid loops: stackoverflow.com/q/43064431/680068
 
There is already the shortest possible solution: rev(sequence(5:1)) :)
 
yup, new function of the day for me
> Note that sequence <- function(nvec) unlist(lapply(nvec, seq_len)) and it mainly exists in reverence to the very early history of R.
 
9:20 AM
@zx8754 - it piqued my interest...
 
9:35 AM
 
 
2 hours later…
11:22 AM
@A5C1D2H2I1M1N2O1R2T1 problem was just because of duplicates Individual/Camera in the real data (hence the example wasn't representative), I edited your answer, I hope you don't mind. (I'll probably re-delete mine ;-) )
 
@Cath, thanks for the edit. I would have just done unique(mydf) though ;-)
 
@A5C1D2H2I1M1N2O1R2T1 yep something inside me was telling me that mydf[!duplicated(mydf), ] was not the best way... must have been your voice ;-)
@A5C1D2H2I1M1N2O1R2T1 there you go :-)
 
I wish I could vote up that answer ;-) (Browsing on my phone right now, so I didn't want to screw up the edit....)
 
lol
 
11:44 AM
 
12:05 PM
11 messages moved to Trash can
 
@Jaap invited me to "Trash can" - highs of the day :)
 
always a pleasure ;-)
 
@UweBlock ok, thanks... but actually i can't figure out what that means/does. i see it sometimes jumping to the next line is all ..?
damn, and that friggin' "yank" nonsense that overrides my "redo" action is an atrocity
 
12:27 PM
@Frank can't figure out how to use redo properly... CTRL+Y just pastes.
 
@zx8754 Ctrl+Shift+Z
 
12:46 PM
@zx8754 yeah, i disabled yank in the shortcut settings so i can use it for redo. unfortunately, disabling clippy the helpful dropdown menu (bound to TAB) does not have any effect
 
 
3 hours later…
3:25 PM
anyone else getting the wrong output from this answer? stackoverflow.com/a/43072330 i see plenty of upvotes so maybe my hadleyverse is out of date
 
The answer is edited.
 
ah ok
 
@Axeman nice answer here stackoverflow.com/a/43073165 i guess mutate unnest is the idiom, but it looks quite inefficient (considering it constructs a list column and then expands it)... is this idiom the answer to Brodie's question from yesterday?
yesterday, by BrodieG
Is it still the case that dplyr cannot accept grouped values that have more than 1 row? If so that's astonishing. I'm thinking of this issue @eddi brought up:
 
4:16 PM
tidyr::complete is a nice feature essentially missing from data.table (... it's quite a hassle to build a CJ, type out on=, apply a fill rule... and requires typing col names many times)
 
@Frank, Yeah i find myself using mutate(map(...)) in combination with nest and unnest more and more often
 
map is purrr, right?
 
It makes a ton of problems easier, but I agree that it isn't effecient as map isn't vectorized
@Frank correct
 
@Axeman conceptually, it's nice, but if it's an idiom (and i think it must be since there's no other way to address Brodie's question), they ought to bundle the steps as expand() or something
it gets messy since it's crossing functions from 3 (!) different packages, though
that's more packages than i have loaded 99% of the time
 
I'm not sure if Hadley has decided list columns are the way to go. Last year he seemed a bit doubtful. For the this I do on a day-by-day basis they are nice, but I suspect many people (also here) will think they are awful.
And I agree on the packages, I usually just load tidyverse though.
 
4:25 PM
ah, now i'm remembering:
Jun 22 '16 at 20:40, by David Robinson
yeah: using a list column, then using something like tidyr::unnest and purrr::map with broom::tidy/augment/glance, is the gist. Of those the most replaceable is purrr::map with lapply. Differences are minor (e.g. map can accept a formula, not just a function)
 
@Axeman As far as I can tell he's all-in on list columns. There was some hinting in one of his recent talks that RStudio is working on a better way to display them.
He deprecated purrr::by_row and by_group with a recommendation to just use a list column and unnest
 
@alistaire Ah ok, cheers.
 
The new SE vignette is up. It has more pieces, but certainly easier to work with.
 
@Frank My answer there would be df %>% group_by(b) %>% slice(rep(1, 3)).
 
And "quosures", which are going to make me feel like a 4 year old trying to be cute whenever I have to say it (even if they are a good idea).
 
4:32 PM
@Axeman nice soln for that case, yeah
 
@Frank I don't see a map solution, since it's not really a rowwise operation, but rather on a single row in the group. A bit of an odd example perhaps? Don't see myself using that. Perhaps I would then simply slice(1) first and then mutate(map.
 
yeah, slicing can't generalize to arbitrary-length "mutations", but it's a good tool to keep in mind for special cases
@alistaire zomg, that !! is ridiculous looking. functions that assume certain cols exist in a table are a bad idea for seriously programming around (looking at his a = mean(a) example) -- should be defining a class or something i guess
 
my_summarise <- function(df, ...) {
  group_by <- quos(...)

  df %>%
    group_by(!!!group_by) %>%
    summarise(a = mean(a))
}
^- That one is just annoying, why use group_by as your variable name there..
 
i was fine with seeing quo, but then enquo... what is this, french? oof, and then quos. that doesn't look like the start of any word i would use in talking about data, programming or stats... maybe the "grammar of data analysis" is going to write its own esperanto
 
It looks much easier than the current lazyeval stuff though
 
4:46 PM
At the bottom, I think it says the notation is originally from lisp
(not quo, but the rest)
 
@alistaire ah ok
is there an html compiled version of this up? i'm curious what quo(summarise(code code code)) prints as
 
Yeah, it works if you install the github versions of dplyr and rlang
although I still have to load both; for some reason the rlang functions aren't getting exported by dplyr. Maybe due to install order.
 
Will the _ SE versions still work for the foreseeable future?
 
They're already deprecated, though I can't see them disappearing too soon; there's a lot of people who have code that uses them at this point
 
@alistaire you mean they're deprecating .dots? i was wondering why he was proposing this !!!group_by to take a list of args when .dots already does that...
 
4:52 PM
@Frank exactly. Apparently all the _ functions were supposed to be placeholders, and this system just took a long time to get right.
 
oh, i see. totally understandable while the package is still 0.5 or whatever it is
 
The addition of := seems annoying, but otherwise this all looks quite good to me.
I won't have to see lazyeval::interp(~a, a = as.name(b)) ever again.
 
@Axeman Yeah, I don't love := either. I guess there's a backend limitation, but it seems like it could've been worked out by overloading = (though that's speculation, I guess).
 
i like the .data$ idea, but the rest not so much
(still waiting for gh dplyr to install, wow this is long)
 
Yeah. It seems to like gcc better than llvm, in my experience.
 
5:01 PM
hm, vignette(package="dplyr") # no vignettes found, so...
 
I think devtools::install defaults to build_vignettes = FALSE
 
yeah
yeesh, the dependencies here are crazy. fails now because it wants some bindr package and also whines 'bindrcpp_RcppExport_validate' not provided by package 'bindrcpp'... enough for today of that
 
5:34 PM
hmm, so now dplyr is going to override both !! and :=
 
@DavidArenburg well, if it makes it any better, i'm sure those are in rlang or grrlang or erlang or something instead
sort of screws up the old !!num for num!=0 trick, though
 
@Frank not sure what do you mean by that
I think dplyr (and certainly tidyverse) export those
 
@DavidArenburg i mean that although that is a dplyr vignette, i'm sure he put the computing-on-the-lang stuff in a separate package, as is his wont
that's what lazyeval and rlang are, innit?
(i'm speaking as someone who will never use these and so doesn't know much)
 
I think I saw a sentence saying "dplyr export those too" or something
 
oh ok, that's a new direction then
 
5:42 PM
but that doesn't matter really
I think most people just loading tidyverse now
which probably export those
 
@DavidArenburg speaking of programming on tables, the data.table faq dropped its 1.6 on eval-quote, at least in my gh version. odd. also, i made some notes re programming with data.table: franknarf1.github.io/r-tutorial/_book/… it's for a tutorial to colleagues new to r, so i probably won't go any more elaborate
2
 
@Frank you mean there is no faq regarding eval/quote anymore?
 
@DavidArenburg yeah, if i type vignette("datatable-faq") it is missing there
 
I dont think I ever used it anywhere else rather on SO
 
hm, i may have used it once or twice so far, expect i may need to do so more
 
5:49 PM
anyway, I wonder how that := is going to work now
I mean if you post a data.table answer on a Q where OP has tidyverse loaded
 
@Frank I'm guessing this adopting the conventions of base::quote and base::enquote.
 
anyway, gtg
 
cya David
@BrodieG ahh ok
sounds like a bad extrapolation from enqueue, enfilade, etc, but i see it's actually in my dictionary
 
6:17 PM
hi all
 
HI
 
6:34 PM
hiya
 
7:30 PM
@Frank Nice overview of programmatic use of data.table. Always one of the more frustrating things with DT.
 
@BrodieG thanks :) yeah, i find it about equally frustrating in base R. i still have to learn how to properly program up a formula
 
 
2 hours later…
OP lost track of David's first name here stackoverflow.com/q/43080086 they looked at the answer and yet ask again... not really sure what their question is now
 
it's only been 3 years. You can't expect for new verbs to be added to vocabulary that quickly. /s
Direct consequence of creating the box dplyr lives in.
 
 
1 hour later…
11:17 PM
@zx8754 - I went a bit over the top ... stackoverflow.com/a/43065525/5977215
 
close as typo (in the sense that they didn't try anything) or dupe stackoverflow.com/questions/43080086/…
 

« first day (706 days earlier)      last day (2592 days later) »