« first day (759 days earlier)      last day (2538 days later) » 

 
2 hours later…
 
3 hours later…
9:30 AM
Whoa, got shot down on bioinformatics SE on my very first question.
Looks like programming questions about BI are off the table there.
 
9:58 AM
next time just post it on SO ;-)
 
10:18 AM
It would appear I have misunderstood what the site is all about.
Perhaps next time I need to research what kind of questions are on-topic there.
 
10:56 AM
 
 
2 hours later…
 
3 hours later…
 
1 hour later…
4:29 PM
should we link these two : 1 & 2 ?
 
 
1 hour later…
5:32 PM
quick data.table question. I'm using the ':=' trick to create columns because it's neat
However, when I'm reusing a column that I just created it doesn't work.
Is there a way to make that work?
test <- data.table(a=1:5,b=6:10)
test[, ':='(c=a*b,
            d=c/a)
     ]
Error in c/a : non-numeric argument to binary operator
 
I don't think you can use in a := expression a column created in the same expression...
I would simply do : test[, c:=a*b][,d:=c/a]
this is efficient as well since := doesn't create copies
 
yeah, however, I have a lot of columsn to create
 
 
2 hours later…
 
1 hour later…
9:05 PM
@PLapointe Create a function that returns both columns as a list.
 
@PLapointe Could slightly modify to
test[, c("c", "d") := {
  c = a * b
  d = c / a
  .(c, d)
}]
 
9:29 PM
ty both
 

« first day (759 days earlier)      last day (2538 days later) »