« first day (60 days earlier)      last day (3231 days later) » 

1:57 PM
@DavidArenburg Should I remove your data table solutions from my edited post ?
 
@StevenBeaupré nvm, deleted. As long as data.table showing who's the boss there, I don't care really.
 
Haha ;P
It's indeed pretty bossy
 
though really surprising it outperforms table so much. Wonder if tabulate will be ant better
 
Yes I was surprised by the count() performance as well.
But, once again, data.table outperforms dplyr...
tabulate would strip the factors no ?
 
not sure
dont have time to try
but it should be more efficient than table
as it its "work horse"
 
2:17 PM
tabulate's doc says it "strips" the factor in the sense of just looking at it as integers, yeah
by the way, another interesting benchmark: a for loop beating Reduce: stackoverflow.com/a/30949753/1191259 (josilber vs josilber2)
 
Yes, levels(df[[1]])[tabulate(df[[1]])>=3] really killed it.
 
yeah, shouldn't discount r core's coding prowess, i guess :)
 
@Frank usually when he loses a benchmark he writes a Rcpp solution
then he always wins
 
Yeah, who's bossy now :P
 
he won (against himself) before the benchmark, i mean :)
 
2:22 PM
I actually was very suspicious regarding table results from the beginning (as already mentioned)
@Frank Reduce is also a for loop btw
so its shouldn't be hard to beat
but usually he loses with base solutions
see most of his answers are edited later with Rcpp solutions
 
oh, didn't know that. figured all the functions on the ?Reduce page were special, having capitalized names and referring to concepts from "real" programming languages
anyway, he caveats Rcpp solutions regarding the cost of their compile time. and Rcpp really is the right solution for efficiency in many cases where i've seen him use it
 
its right antidote against data.table solutions usually
 
i like this term "logic golf" akrun used
 
yeah, i still cant understand why your solution is equivalent to OPs logic, but it sure looks like a code golf
which is good as far as Im concerned. It almost feels like R was designed as a code golf language as almost nothing can be efficiently solved without it
 
i tried to explain in the answer. the op initializes to true and then assigns false where !a & b, which is the same as simply initializing to a | !b
well, code golf technically refers to minimizing the character count of the code, i think. r's not very good at that -- way too many parentheses
 
2:35 PM
I'm surprised by Reduce inconsistency, min of 6K max of 85K :s
 
@StevenBeaupré i think it may have to do with the big memory requirement of the Reduce approach in this case. maybe sometimes R asks the operating system for enough memory but gets rebuffed/delayed because it's so big...? dunno
 
That makes sense
 
 
1 hour later…
3:46 PM
@Frank how removing with = FALSE will make it harder for people to learn?
Quite the opposite IMHO
Also, did you mean DT[[int_or_char]] (with a [[)?
 
it will be harder because they will continue using data.frame syntax until they hit an inconsistency. like DT[,a] not having drop=TRUE or DT[,1.5] giving 1.5 (since Arun only proposed it for integers and characters, not numerics)
that's how most people approach things, not reading the documentation until they hit an inconsistency
(me too)
the [[ doesn't let me pass a vector of ints or chars
that's why i sometimes use [.noquote et al
 
@Frank [[ should work for both
 
i feel like the list version of [ should have a name (like every other function does), but cannot find it
it does not, it's for one element
last i checked...
 
oh you a mean a vector
right
how is it different from data.frame though
 
DF[1:2] works fine, gives DF subsetted to columns 1 & 2
you use it in your answers, i thought, like DF[,newcols] <- lapply(...) which can be written as DF[newcols] <- lapply(...), not sure which way i've seen you write it
 
3:54 PM
hmm, I see what you mean
I think DT[1:2] should work too with the new changes
why not?
it's just like DT[, 1:2, with = FALSE]
 
because what if i want to select rows by number? must i then write DT[i=1:2] ?
that wouldn't be so bad, but i think that sort of inconsistency would really make it much harder to learn
 
then it should be DT[,1:2]
yeah, i didn't think about that part though
it seems like you thought it thru
im so messed up on work, that I have no time for nothing lately
though its interesting that I never though that DT[1:2] != DF[1:2]
They both somehow made sense to me without thinking about it
 
yeah, the DF[1:2] thing feels like a hack to me, but it's nice to have
 
@Frank Im not sure why its a hack. It depends what are you thinking, row wise or colwise
In base R they think colwise, similar to ncol(DF) == length(DF)
 
yeah, i've gotten used to thinking about data.frames & data.tables as lists, thanks to seeing lapply(.SD,fun) enough times, but it still seems strange to treat them like more than simple tables/spreadsheets when taking advantage of it with DF[1:2] and length(DF). just a subjective thing
 
 
2 hours later…
6:10 PM
Do you guys avoid answering questions from users who have an history of not upvoting/ticking/commenting quality answers ?
When I see a low-rep user asking a poorly formulated question, I'm always a bit hesitant. I feel like I'm going to waste my time trying to help someone who is not even willing to help himself.
 
6:54 PM
@StevenBeaupré nah, not for voting/ticking. i mostly just judge by the question itself. if i avoid a question because of the user's history it's probably something like: they were advised of a better way of doing something and nonetheless persisted in asking a string of questions premised on doing it the bad way. or if there's a comment stream of them fighting with folks beneath that particular question. basically, i'll avoid a question if the asker doesn't want to be helped
 
7:17 PM
I agree. I usually don't bother.. but I feel these users don't grasp the basic mechanics of SO. Maybe I should point them to the SO tour
 
8:01 PM
@StevenBeaupré When I see that a user has a history of not upvoting/accepting answers, I usually point them to the respective help pages. I've seen it a number of times that the behavior changed. So, pointing them the explanations of the basic mechanics of SO will improve SO as well.
but if the OP doesn't want to be helped ... I give up as well
 

« first day (60 days earlier)      last day (3231 days later) »