« first day (1612 days earlier)      last day (1687 days later) » 

6:28 AM
@Frank2 You are not allowed to speak here :P
3
Good morning
^delete last Natty link
 
6:52 AM
hi all :-)
@zx8754 gone
 
If anyone wants to invest some time this could change title to "differences between all those sums" and give a canonical answer. stackoverflow.com/q/9676212/680068
so simple noone asked before? stackoverflow.com/q/58023035/680068
^ btw amazing column and row names :)
 
7:20 AM
@zx8754 How to sum data.frame column values?
 
@Bulat Welcome!
@Bulat yes, that dupe is good enough, thanks for flagging.
 
@zx8754 for the canincial answer, would you want mathematical.coffee answer updated ?
 
@Bulat I'd suggest to add a new answer.
 
@zx8754 I have done so, not sure if that is what your were looking for exactly. there are many other ways that can be done in R including data.table and tidyverse notations
 
7:37 AM
I was more thinking of showing the differences of "sum, cumsum, rowsum, rowSums, colSums"
 
7:50 AM
Right, this can also be done ) I probably would not add rowsum, as question is about column. cumsum is not different from sum. If you have an example of good canonical answer, it would be useful
 
good morning!
 
8:16 AM
 
8:40 AM
@zx8754 do I understand it right that when there is no history of breast & prostate cancer in your family, you have a lower risk?
 
@Jaap yeah, true for most cancers
But doesn't mean it won't happen to you, just lower risk. There are many patients in our database with zero family history of any cancer but still with prostate cancer.
 
@zx8754 I know, I have already had cancer once (19 years ago now)
 
@Jaap more that, when there is history, you have a higher risk
 
@Cath that's indeed what I read, but was wondering if it would work the other way around as well
 
8:55 AM
@Jaap usually "we" tlak in term of risk factors and so you have the "baseline" = normal risk, same for everyone, so it's more about assessing how higher the risk is in the presence of a risk factor. But of course, technically, if you don't possess the risk factor you have a lower risk compared to someone who has it
 
"baseline" = normal risk: Also means we still got a lot to learn about the cancer. In an ideal world baseline should be 0. Then we can say if you don't/do have X, Y and Z, then your risk is zero.
 
we're indeed still far from that ----^ situation
 
9:29 AM
@zx8754 Environmental factors are not taken in account then ?
 
@Tensibai can be among the risk factors
 
@Tensibai they are hiding in baseline risk :)
 
About cancers I think about radioactivity, and as there's a 'general radioactive noise' on earth, I assume a risk 0 doesn't exists (I.e: the ideal world has 0 environment risk factor ?)
 
epigenetics whole new territory, we (our group) stays clear of it at the moment. We have collaborators who work on this nothing big came up yet.
 
 
3 hours later…
12:11 PM
@Queen k
 
12:31 PM
Can't believe this has no simpler solution.... code-golfing anyone? stackoverflow.com/q/58027378/680068
 
12:47 PM
df[, 2:3][df[, 2:3]==4] <- names(df)[2:3][which(df[, 2:3]==4, arr.ind=TRUE)[, 2]]
df[, 2:3][df[, 2:3] == 1 | df[, 2:3] == 2 | df[, 2:3] == 3] <- ""
@zx8754 ^----- not sure it's better in term of code-golfing anyway
kind of the same as Ronak actually except no sapply
 
yup, that's what I want to avoid
 
@zx8754 yeah.... I thought so ;-)
 
I am more thinking of creating new dataframe and just cbind with 1st column
 
what about getting another data.frame with same structure but empty and then fill only the 4
 
hah great minds think alike or smth
 
12:50 PM
ah yes sorry, didn't read your comment above :-/
 
 
1 hour later…
1:54 PM
@Cath your second line could be just: df[,2:3][df[,2:3]<4] <- ""
 
@Tensibai indeed ! It didn't work "the vectorized way" with %in%, I didn't try < #facepalm
 
:D
 
probably should come at first line, as, afterwards, the comparison still works but with the characters, not numers anymore.
I guess, you can also go with a switch but the fact that it's not vectorized makes it quite "painful" to use...
 
I was thinking about ifelse
 
like df[, 2:3] <- lapply(2:3, function(x) sapply(df[, x], switch, "", "", "", names(df)[x]))
would that even work ??
ah yes, that works ^^
@zx8754 the above line is not elegant and still pb of coercing numeric columns into character but it should be pretty good for a codegolf competition ;-)
 
2:03 PM
sapply within lapply ? ...
 
@Tensibai have to because of switch...
anyway, gave this ugly-but-one-liner option ^^
 
df[,2:3] <- lapply(2:3, function(x) { ifelse(df[,x] < 4, "", colnames(df)[x]) })
Works as well
oops, < 4
 
@Tensibai indeed. I like switch but when there is only 2 options, why make it cmplicated
you want to post as separated ? edit mine and make it a wiki ?
 
I did post it
With a bit terse explanation around (which is still better than "try this" I think)
 
2:21 PM
@Tensibai maybe suppress the assignment to df and the curly brackets to make it more clear that this is simple?
 
2:31 PM
Boaf ...
I find it more defined like this
 
3:00 PM
added another possibility with sweep @Cath @Tensibai
 
3:27 PM
Were you guys aware that we have a Slavic esperanto? twitter.com/RFERL/status/1174669471115440129?s=19
 
3:39 PM
@Jaap Great too :o)
 
4:05 PM
@zx8754 :)
 
 
1 hour later…
5:32 PM
I committed the sin of asking about performance on a question about performance stackoverflow.com/questions/58032064/…
 
5:46 PM
@camille thou shall not do that :P
 
 
1 hour later…
7:08 PM
@camille How was the sandwich?
 
7:53 PM
@Axeman lol delicious, smoked whitefish salad
After flagging moderators, he deleted the answer altogether. I'll just never understand
 
8:10 PM
@camille He doesn't like comments on other peoples answers. He prefers passive aggressive edits in his answers.
 
 
2 hours later…
10:33 PM
anyone used BigQuery? i'm finding it absurdly slow (trying it for the first time today) -- waited almost an hour to pull 6m rows, and still waiting
guess this is par for the product:
1
A: big query load job is stuck forever in running state

enccThis does not look like an error to me. My load finished successfully after 4 hr.

 

« first day (1612 days earlier)      last day (1687 days later) »