« first day (1253 days earlier)      last day (2039 days later) » 

5:52 AM
Hello
 
6:16 AM
Hello :)
maybe delete ---^ as well ?
 
Morning all
 
7:03 AM
@RonakShah gone
 
How do I use col.names to specify the columns names in fread?
nvm...I was adding it in read_csv instead of fread
lol
need more coffee
 
7:39 AM
@Sotos lol
Hello
 
Hello hello :-)
 
@Sotos or new glasses ;-)
 
@Jaap Probably both :D
 
or choose your verse: tidy or dt
 
Quick question: when (/if) applying for data scientists' position, did you have theoritical questions? (a colleague of mine has a 30 min skype interview tomorrow for a job in New Zealand (!!) and she asked me but I've not been in a job interview in years so I have absolutly no idea... _o_ )
 
7:47 AM
@zx8754 I m trying to migrate everything in dt
I need that speed :)
@Cath Theoretical questions like supervised Vs unsupervised...?
 
@Sotos or even more specific I guess
 
data scientist - is so broad, some call it DS even if it actually is about data entry. Depends on job position requirements.
 
@Cath I had interviwers ask me questions about their use cases, i.e. how would you go about predicting NO2 omissions in each city and why?... and they expected an answer of 'I would use a regression model, which depending on the relation ship of the variables could be linear or logistic or ...'
 
@zx8754 indeed. I guess it's modelisation as the interview is also with a "phycisian-modeliser" (o_O)
@Sotos exactly that kind of "specific" she (my colleague) was wondering about. Thanks :-)
 
@Cath No problem. Good luck to her :)
 
7:57 AM
@Sotos thanks :-)
 
What is the alternative package for combining ggplot objects?
It would seem I can never remember its name.
 
@Cath this might help, if they have a profile: glassdoor.co.uk/Interview/index.htm
@RomanLuštrik cowplot
 
@RomanLuštrik gridextra?
 
@RomanLuštrik same as @Sotos also egg or something like that ?
 
cowplot! Thanks.
 
8:02 AM
@zx8754 excellent ! thanks !!
 
cowplot = "Claus O. Wilke", not the best name for a package.
 
@RomanLuštrik or patchwork?
 
Oh, nice. This should be a blog post. All the alternatives for combining plots.
 
@RomanLuštrik there is already... can't find :/
 
@zx8754 "cowplot" sounds more like "a new type of visualisation, seeing data like big ruminants" than "nicely arranging plots" ;-)
 
8:11 AM
 
@Jaap looks like it to me
 
thx & hammered
 
I bet arc knew 100% what it would look like.
 
@Tensibai o_O
@zx8754 agreed, nobody is that naive !! :'D
 
@zx8754 It was meant to be a package with random stuff for people in his lab.
As far as I understand.
 
Not judging/blaming, but the fact is name of package is off from its function.
 
@zx8754 Yes. He's talked before about just putting the relevant stuff in a new package. That would probably be a good move.
 
9:47 AM
@Tensibai rofl
 
10:06 AM
most hated statement on SO : "It works on the sample dataset but on my real dataset.........." -_-
 
close as £"$% you
 
11:05 AM
Hey @Jaap, I was going through this answer of yours. Is there a (easier than re-doing it 3-4 times) way to do it for more than one columns?
I only have two columns that need that operation so I did it by hand but I wanted to see If there is a neat way of generalizing
 
@Sotos it depends whether the umber of element for the list columns are equal
@Sotos a reproducible example would help ;-)
 
@Jaap Of course they are not the same :) let me get you an example from my actual data
FYI, those are DNS logs
 
11:25 AM
@Sotos isn't this answer a better fit for your problem?
the values seem to be comma-separated values instead real lists
 
@Jaap That dt I got by dcast(d2, groups ~ query_type, list, value.var = 'answer')
ooops
maybe I pasted tostring one
1 message moved to Trash
structure(list(groups = c(1, 4, 6, 7, 12, 13), A = list(c("74.125.133.102",
"74.125.133.138", "74.125.133.139", "74.125.133.100", "74.125.133.113",
"74.125.133.101"), "52.170.194.77", c("198.185.159.144", "198.49.23.144",
"198.185.159.145", "198.49.23.145"), c("104.17.83.18", "104.17.84.18"
), "52.109.8.20", "104.120.216.86"), AAAA = list(character(0),
    character(0), character(0), character(0), character(0), character(0)),
    CNAME = list("www-google-analytics.l.google.com.", c("emea1.notify.windows.com.akadns.net.",
I could do it strings of course but I chose list for efficiency
 
11:48 AM
two questions:
- most columns in your example are now empty; is this always the case or just in this example?
- if they are not empty, do they contain lists with more than one item as well?
 
@Jaap Everything. Some are NAs some are lists with length 1, and some with > 1
The ideal function would recognize the list columns and unlist them
So I will not have to specify which columns to unlist
 
re my previous question, I think this is good enough, if someone doesn't mind hammering (already voted as "why code not working")
thanks @Jaap :-)
 
@Cath hammered :-)
 
:-)
 
12:27 PM
 
12:43 PM
@Sotos possible solution:
cols <- c("A","CNAME")

DT1 <- DT[, .(groups)]

for(j in cols) {
  sdc <- match(j, names(DT))
  DT1 <- DT1[setnames(DT[, unlist(.SD), by = groups, .SDcols = sdc], "V1", j), on = .(groups)]
}
I only used the non empty columns here; for the complete data, you might try:
cols <- names(DT)[sapply(DT, is.list)]

DT1 <- DT[, .(groups)]

for(j in cols) {
  sdc <- match(j, names(DT))
  DT1 <- DT1[setnames(DT[, unlist(.SD), by = groups, .SDcols = sdc], "V1", j), on = .(groups)]
}
 
12:55 PM
1 message moved to Trash
 
was already afraid that would happen when applied to the full data :-(
 
Oh, I thought I fixed it by changing NA to NA_character_
but nope
 
have to pick up my wife from the train station; will be back in about half an hour
 
@Jaap see you in a bit
 
1:28 PM
 
1:47 PM
3 messages moved to Trash
I m a bit off today :/
 
coffee doesn't help anymore?
 
@zx8754 One of those days again where memories overtake your mind
hard times unfortunately :/
 
2:20 PM
@Sotos if you're unlisting columns with lengths(V1) != lengths(V2), might as well unlist them into separate tables..? ADT = DT[rep(1:.N, lengths(A)), "groups"][, A := unlist(DT$A)] etc
otherwise, unclear what the desired output would be
re generalization: id = "groups"; cols <- c("A","CNAME"); lapply(setNames(, cols), function(x) DT[rep(1:.N, lengths(DT[[x]])), ..id][, (x) := unlist(DT[[x]])][])
 
@Frank That is acceptable too. However, the final goal is to be able to do it without defining cols (i.e. find the is.list cols by itself)
I guess Jaap's method (cols <- names(DT)[sapply(DT, is.list)]) is fine here. Let me try that on my full dataset
 
@Sotos cols = names(DT)[sapply(DT, function(x) (!is.atomic(x)) && sum(lengths(x)) > 0L)]?
 
@Frank YES!!!! And how fast that was!!!
Thank you :)
 
np, glad it worked :D
 
Time to find some botnets now :))
2
well...tomorrow, not now
 
 
4 hours later…
6:02 PM
this behavior seems like a bad idea, wonder if it's inherited from S or something:
3
Q: Why doesn't if ("T") throw an error even though "T" is not a logical vector?

HeklaI stumbled upon this when I tried to find out why some function I wrote gave unexpected output. > if ("T") print("why?") [1] "why?" Why does this work instead of giving out an argument is not interpretable as logical error? That is what happens to every other string passed to if, except "T", ...

 
6:20 PM
But it's documented.
So it's all good, man. Anyone watching Better call Saul?
 
7:16 PM
@RomanLuštrik watched it into S2 so far, and like it a lot. i blame peak tv for my not being caught up
re "peak tv", i mean variety.com/2016/tv/opinion/…
 

« first day (1253 days earlier)      last day (2039 days later) »