« first day (492 days earlier)      last day (2800 days later) » 

12:31 AM
yeah, though this way (i had thought) would use binary search, but turns out i was wrong.
 
1:42 AM
wtf is the point of this rollback war
guess it's old
 
 
1 hour later…
2:59 AM
It asked for a dplyr approach, anyway this one is good as long as nobody post a good dplyr approach :-) — akrun 2 mins ago
*sigh*
 
 
2 hours later…
5:28 AM
Thanks, great approach. I need to brush up on my base skills! Suggested an edit to suit my needs. — JWilliman 3 hours ago
"Brush up on my base skills." - You mean "learn R"?
3
 
6:24 AM
Hello hello :-)
 
6:54 AM
Morning people
 
@DirtySockSniffer as expectedly, nurka posted some verbatim of eddis answer and stole the tick
 
7:15 AM
Howdy there
 
7:32 AM
morning peeps
 
7:42 AM
hello Sotos, David, Tens and Erasmo :-)
 
morning @Cath :)
 
Hello @Cath
 
7:59 AM
Halo
 
hey @zx8754 :-)
in this question I guess the result is expected as the value "15" and the initial table are joined and so 15 is kept as the value for the key variable (at least this is how I understand it), but this is very unlikely to be desired. The problem doesn't occur if the join is on 2 tables but in the question example, what would be the way to keep the original value ?
 
8:40 AM
No idea what's going on here stackoverflow.com/questions/39161484/…
 
9:17 AM
@Sotos, what does he by 'random'? I don't follow either..
 
9:35 AM
Don't know what to do with this
 
@Axeman too broad close, i need to do this, then that, then this, I know how, give me codez
 
okido
"please give me a three day workshop"?
 
@Cath they could keep old value in the dummy column then assign it back on?
@Axeman 3*8*100=$2400 please
 
@zx8754 probably something like that, like creating a anonymous data.table instead of using a single value ? it would be very convenient to have parameter like keep.original : data.table.subset[J(15), roll = "nearest", keep.original=TRUE] ;-)
 
@Cath github feature request :)
 
10:30 AM
@zx8754 jan is on the subject, he linked to a issue report, but maybe yes, it would be worth a FR
 
@Cath sup
Did you ditch your burka yet?
 
11:19 AM
@zx8754 no need actually ;-)
@DavidArenburg hey David :-) yep, definitely opted for the regular bikini this year ;-p
 
11:45 AM
after a bunch of bugs in some of my scripts (that were ALL fixed before production, mind you), my colleague hits me with the 'i think you shouldn't write code'
 
@erasmortg hope it was a joke comment, even then I wouldn't tolerate it.
 
@zx8754 it was, she and i have a very particular relationship (full of 'ribbing'), i am extremely tired today, so i think ill leave early
 
there are days like that... ;-)
 
and there are days when you really shouldn't write code
 
the place i work for is extremely small, and the people that have some sort of coding proficiency are less than 5 (me included), ive been awake since 2:30 a.m. today, so im not at my peak :)
 
11:56 AM
I cannot seem to be able to install data.table 1.9.7 (@erasmo that would make your colleague say to me "I don't think you should touch a computer" ;-p )
 
@Cath I'm going on vacation to mexico for three weeks in a couple of months, and she will be tasked to run some of my stuff while I'm gone, this includes some heavy terminal use, we shall see :p
I didn't even know there was a data.table 1.9.7 :s, what happened to the hype? this place was buzzing with the release of 1.9.6
:)
 
@Cath whats the code you are using?
Maybe the French authorities don't allow data.table v 1.9.7 in France
 
@Cath put your bikini on it should work
 
@erasmortg 1.9.7 is the devel version
 
12:03 PM
@DavidArenburg I tried install.packages("data.table", type = "source",repos = "http://Rdatatable.github.io/data.table") but that gave me "non-zero exit status" error. install_github seems to work but very verbose...
 
there is always a devel version of some sort
 
ok, install_github worked, the blabla doesn't seem to indicate a problem :-)
@zx8754 I don't have a webcam at work, that could cause a problem ;-p
I probably had way too long vacations : is the condition to move from table1 to table2 in this question crystal clear to everyone but me ?
 
I'm guessing filter out all zeros, but only for Pathogenic
 
12:20 PM
@Cath if the last state within a group is 0 then drop last zeros, otherwise keep?
 
@Axeman indeed that works and is what kaksat posted. Seem simpler than akrun cond
@zx8754 and that could be that too... the Q is quite unclear imo (apart from being a sure dupe)
 
@Cath it's gone
 
if you want people to guess what the condition is, at least make an example that allows only one to work...
@zx8754 héhé :-)
 
This Q is kind of confusing stackoverflow.com/questions/38879961/…
It's basically "take my unsorted data and convert it into another unsorted form"
 
@DavidArenburg lol exactly my thought when I saw it
 
12:31 PM
@DavidArenburg Output seem clear, but why would you need that output...
 
@zx8754 how is it clear to you?
isn't clear to me at all
neither of the columns is ordered there. Everything is messed up except that some dupes are near each other
looks like the French government logic in one picture
 
@DavidArenburg yes they are trying to put dupes one after another... don't ask me why :)
 
@DavidArenburg, but the original is sorted, no?
 
@Axeman no column is sorted in the original neither
@Axeman Actually the first column looks sorted in the original
 
all(order(DT$Tag1) == 1:nrow(DT))
I think he wants some kind of simultaneous sort of both tags
 
12:40 PM
@Axeman or just DT[, is.unsorted(Tag1)]
which tells me that neither the first column is sorted
or even DT[, lapply(.SD, is.unsorted)] (though the last column needs to be converted to a Date)
@erasmortg btw, I hear that kind of things from my current boss all the time
 
@DavidArenburg? But it is sorted? If I just look at it? Does is.unsorted do anything special with duplicates? Sorry, I don't use data.table very often.
sorry nvm
 
is.unsorted is base R....
is.unsorted(c(1,1,2)) seem to handle dupes correctly
 
it's a slow friday
 
If you do is.unsorted(c(1,1,2, strictly = TRUE)), then it will return TRUE
 
Sorry my confusion came from using the short version of DT. I'm taking a break
 
12:47 PM
@Axeman row 19
 
Maybe it's sorted on pmin(Tag1, Tag2)?
No nvm
 
hmmm... OP asks how to supress some digits from a string. But then, what he really wants is to keep those digits but on a 6-digits basis. That's not even an X/Y problem. More like X/Z or...
 
@DavidArenburg what ended up happening with your situation? Given the local time, I get it you're still in Israel as opposed to California?
If i may :)
 
@erasmortg I left that job 3 months ago
Im working in Tel-Aviv now
 
1:02 PM
I'd ask how's the new place treating you, but I guess I got the answer already :/ I hope the boss' is just ribbing, although yeah, that grinds sometimes
 
@Cath it's funny how every regex answer keep piling up comments with multiple alternatives
 
@DavidArenburg trying to understand what the heck .*? is supposed to do
 
non-greedy cathem all
 
yeah that the non greedy part that makes it work... smooth :-)
 
it's just a way to stop on the first hypen
 
1:08 PM
just like using sub but more complicated...
 
Is it allowed to stop at the first hypen in France?
 
depends on what you mean by "hypen" (choose the right typo o_O)
 
I mean hyphen
 
yeah I knew that ;-)
 
@zx8754 it seems you discovered the reason for purrrr package
 
1:15 PM
@DavidArenburg I never used it, just a guess.
 
oh, I hoped you'll enlighten me
 
I am not that too deep into tidyverse yet
 
@Cath Why is that question downvoted. seems okay
 
@PierreLafortune hmmm
did you just took my non-greedy idea there to an answer
 
I saw the comments, but I didn't see your answer
 
1:23 PM
@zx8754 deep enough not to call it hadleyverse though
@PierreLafortune didn't downvote but definitely lack of effort
 
@DavidArenburg Your answer creates two portions and captures the second. You used gsub to search. I did not take your and I don't like the insinuation that I did
 
should this be reopened now (with the edit) to be close as dupe ?
@David @Pierre anyway OP seems to want something different than what he asked for
I want to prefix the numbers with 0's so that I can make it six digits and then concatenate it again so that I can match with my original data. Hence I am extracting numbers and then making those as six digits with irrespective of any digit and then I would concatenate. — Vinay 34 mins ago
 
@Cath it's okay if this question is one step in a bigger process. OP is not asking for the final product, just this step.
 
I think OP wants str_replace(x, str_extract(x, "\\d+"), str_pad(str_extract(x, "\\d+"), 6, pad = "0"))
or rather
replace_string <- str_extract(x, "\\d+")
str_replace(x, replace_string, str_pad(replace_string, 6, pad = "0"))
to prevent @David from yelling at me :-)
I wish we could do sub("^(\\d)+-.+", sprintf("%06d", as.numeric(\\1)), x) though
 
1:47 PM
gsubfn("^(\\d+)", ~sprintf("%06d", as.numeric(.x)), x)
[1] "000266-VN22.5P-AC" "000292-VN22.6P-BC" "000300-VN22.7P-CC" "000316-VN22.8P-DC"
 
@PierreLafortune what kind of sorcery is that ? ;-) (didn't know this package)
 
@Cath it's a cool package. It takes a little getting used to at first, but can be useful
 
Hi guys, any way to see who has downvoted mutliple of my answers at the same time? answers are quite old so it looks like somebody just lists my answers and go there to downvote :)
 
I think the privilege is reserved for the mods @jangorecki
 
hi @jan :-). who did you annoy ? I guess serial downvoting will be reversed, the mod can know who inflicted that to you but very likely they will keep the user name to themselves...
 
1:59 PM
should I ask mods to check that? it somehow looks like a spamming
even worse because one of those answers is actually the best answering the question, and now got -1 :)
OK, looks like it is well described here: meta.stackexchange.com/questions/126829/…
Thanks, I flagged one of those answers, I hope the mods will warn downvoter :)
 
@Pierre I guess melt & reshape2 are not hadleyverse/tidyverse. From the hadleyverse, you can only see them with a powerful telescope that allows you to look back before the universe was formed, along with extensive education in hadleyography. re stackoverflow.com/a/39169242
anyway, melt has an na.rm arg, eh? melt(A, id=c("Id1","Id2"), na.rm=TRUE)
 
3:29 PM
@jangorecki seems the binding lock on mtcars and similar objects is not very strong. i can still drop columns with set and if i do data(mtcars) then i can even do setDT(mtcars) directly on it. i don't know if it's the intention for data.table to respect those locks, though
 
@Frank I'm guessing the lock is on the name/env combination, so you can't touch that, but if you start messing directly with the underlying memory location, then all bets are off. DT probably doesn't check that an arg passed to it is locked and happily modifies it when it shouldn't. Totally guessing though.
 
ok, that'd make sense
we were commenting about how mtcars %>% setDT actually doesn't throw an error: stackoverflow.com/questions/39167033/… which is why i was trying stuff out. dunno how/why magrittr gets around this
 
3:45 PM
Gah, not at all what I expected. Seems like %>% bypasses the error checking that does exist in DT. The actual locked object is changed.
<shudder>
 
3:57 PM
@DirtySockSniffer prolly the sort of comment you want to send to the trash bin there. what bothered me about his post was the lack of a link. i'm sure i've asked akrun to cite it a few times elsewhere. not that eddi cares about it, but still
 
One of my favorite answer comments. stackoverflow.com/questions/26566557/…
 
heh :)
 
@Frank - You can trash it then, I don't know how.
 
Boy do I hate github search. It's like it is purposefully bad. Why would you ever want to search for special characters like "<-" in code? Right?
For example, try to find the definition for setDT through the search...
 
@DirtySockSniffer oh, figured you did, feel like i've seen you delete msgs plenty anyway. it's "roomâ–¼" > "move messages" if you want it, fyi
@BrodieG yeah, i'm stumped
 
4:08 PM
@Frank - forgive me, but I don't know what "roomâ–¼" > "move messages" means either.
Where is "roomâ–¼"?
 
@DirtySockSniffer Just under the topic
:p
 
@DirtySockSniffer upper right, it's a drop down menu under the room description if you're on a computer
 
Only options are "full transcript" & "create new bookmark"
 
I'm not a room owner, btw
 
4:10 PM
too late, now you are (again)
 
not sure when/why you unbecame a room owner .. ?
 
Okay where am I moving it? Trash?
 
yeah, any of several rooms with a name like trash works
 
1 message moved to Trash can
Oh neat. Haha
I bet there are a lot of trashy comments there
 
4:11 PM
yup
i've also migrated my comments i thought were stupid there, but apparently pings don't die chat.stackoverflow.com/transcript/message/31934409#31934409
 
@Frank okay, this is a bug in data.table. You can circumvent the lock checking by creating a reference to a locked object in an unlocked environment:
mtcars2 <- mtcars; setDT(mtcars2); mtcars
 
That's not true. Never once have I looked past the "leave" link
 
This converts mtcars to a data.table because mtcars is not copied since mtcars2 is never modified.
mtcars2 still points to the same underlying SEXP.
 
@BrodieG oh, that's interesting. though maybe they aren't concerned about respecting those locks? i mean data.table(a=1:2)[, set(.SD, j="b", v=3)] gives a (different) error about being locked while set(mtcars, j="mpg", v=NULL) does not...?
the SEXP stuff is a little over my head, since i rarely/never go that far into the internals
 
Wow, 19 upvotes for explaining the docs
 
4:19 PM
@Frank Perhaps, though the fact that they are checking for locked objects suggest to me modifying locked objects is unwanted behavior by authors.
 
yeah
@DirtySockSniffer now 21. yeah, people like to be read the docs and to see posts that lead to bug reports and FRs, i reckon, and to share such things
 
5:24 PM
@Frank It's a good question, no doubt.
Must be on the front page. It has 2700+ views
 
could be on twitter or that daily SO digest thing Bhargav talks about
i can't evaluate the question, since i don't use the package
 
6:13 PM
if anyone gets a hold of @MichaelChirico, might want to warn him off edits like this stackoverflow.com/posts/1296673/revisions in light of the competing perspective about it chat.stackoverflow.com/transcript/message/32469982#32469982
i find this frame_data syntax so strange, like someone painstakingly entered all those values with quotes, commas, whitespace? stackoverflow.com/q/39172444
 
Wow the gossip in that room is much juicier than here.
 
Akrun Li
 
heh
 
an alright answer, it's not like they started with "try code dump" or something
 
Yeah. I was about to just post my comment. The answer is that simple.
 
6:57 PM
need a dupe for "i tried data$newnames[i]<- but ack!" stackoverflow.com/q/39172978
or a comment about it anyway
 
@Frank - That lapply could be lapply(data[c("white", "black")], "/", data$total)
 
ok, guess i'll comment to that effect, close as typo
@DirtySockSniffer yeah, good point
 
Hmm, I wonder why this doesn't recurse through b * X
formula=~a+b*X
rapply(as.list(formula), as.list)
[[1]]
`~`

[[2]]
`+`

[[3]]
a

[[4]]
b * X
 
7:21 PM
 
@zx8754 or the people who use the hadleyverse could write or find a canonical "oops, we decided to unleash namespace clashes on you" Q&A to dupe close it against
@DirtySockSniffer yeah, mystery to me. formulas are hard to work with...
if i take z = formula[[2]][[3]] and as.list it, it does break down
and weirder rapply(rapply(as.list(formula), as.list), as.list) ... so recursively applying recursion is what does the trick
 
 
1 hour later…
9:14 PM
Check out the edit history here. Why do you think he would he change the OP's code like that?
Very strange
 
probably copied original, edited it to make sense to himself (as i sometimes do) and accidentally pasted that back instead of the op's original, stranger and less readable code
not very dplyrish for akrun to recommend DF$x there, though
ought to be doing a join or something
either my eyes are broken or every post is flashing when i click on it these days
saw nothing on meta about it, so assuming the former
 
I have seen that too
 
hm, and if i click the share link it refreshes too quick to copy the url
oh here we go
19
Q: Question is flickering

JB NizetFor one or two days, I've noticed that questions on Stack Overflow are frequently flickering: disappearing for a short while and then reappearing. I first thought it did it when a new edit or comment was posted (which would already be annoying), but it seems to do it sometimes even when nothing...

 
 
1 hour later…

« first day (492 days earlier)      last day (2800 days later) »