« first day (761 days earlier)      last day (2536 days later) » 

hello @ all !
@Natty tp
 
@m0nhawk small advise: include a profile pic and a short description (like in your SO profile); that will make it much more likely that people will follow you back
@Natty tp
 
good morning
 
6:52 AM
Hello
 
@alistaire interesting package!
 
datatable + r Thought we are using instead of .
 
Hi all :-)
@zx8754 definitely, problem is, is OP talking about data.table or is it just then name they gave to the format of their data...
 
Good morning all... Happy Monday :)
 
7:16 AM
May 15 at 14:42, by Jaap
probably mistagged; especially newbies use the word table a lot and consequently (in their line of thinking) a table containing data is a data.table ....
 
I proposed a small change, though it won't help much probably.
 
@Axeman good one, I noticed some posts are using datatable instead of dt, for shiny questions.
 
@Axeman approved it
 
@zx8754 Yeah I have gotten confused by that as well to be honest.
 
7:44 AM
thanks, 44 is gone :)
 
 
9:11 AM
a quasi copy/paste of someone else's answer and an edit with an off-topic answer just to have something different seem quite legitimate reasons for DV...
Okay, downvotes for showing a more compact option and based on a misleading comment — akrun 3 hours ago
 
he must be living in an alternate universe
2
 
@Cath I wonder how he would react if the roles were reversed
 
@Sotos we know what happens when he thinks the roles are reversed. Like "I posted first" or "this has already been posted" etc.
 
9:27 AM
@Cath or even "please remove", "I posted 2.65643457 seconds earlier" or "Remove or I m going to tell on you" :p
 
@Jaap I'm not very active on Twitter. Just reading some news and updates from various personalities. :)
 
10:37 AM
:-)
 
10:47 AM
data.table question:

library(data.table)

x <- mtcars[1:3,1:3]

setDT(x)
mpg cyl disp
1: 21.0 6 160
2: 21.0 6 160
3: 22.8 4 108

is.data.table(x)
[1] TRUE

x[ , mpg, newCol := paste(cyl, disp, collapse = ",")] # doesn't work
x[ , list(mpg, newCol := paste(cyl, disp, collapse = ","))] # doesn't work

?
I need 1st column as is, second and third pasted together.
 
@zx8754 if you use := then you need the definition only of newCol. All other columns are in the data.table as they are before.
 
Oh, so I can't create a new var and subset columns?
 
x <- mtcars[1:3,1:3]; setDT(x); x[ , newCol := paste(cyl, disp, sep = ",")]
 
@jogo thanks, but I want to remove pasted columns
 
@zx8754 change them to NULL, but I doubt that you can do that in one step
 
10:56 AM
cool, that's the question I guess.
 
x <- mtcars[1:3,1:3]; setDT(x)
x[ , newCol := paste(cyl, disp, sep = ",")][, ':='(cyl=NULL, disp=NULL)][]
 
I guess x[ , newCol := paste(cyl, disp, sep = ",")][, :=(c("cyl", "disp"), NULL)] one line 2 steps.
backticks don't print...
 
@Cath too many brackets :P
compared to df$newCol <- paste(...); df[, c("mpg", "newCol")]
 
ho, it can be done in one step:
x <- mtcars[1:3,1:3]; setDT(x);
x[, ':='(newCol=paste(cyl, disp, sep = ","), cyl=NULL, disp=NULL)][]
 
@zx8754 Or you could just do x = x[ , .(mpg, newCol = paste(cyl, disp, collapse = ","))] if you don't care about by reference stuff and want a similar functionality to dplyr or base
 
11:02 AM
thanks that looks better, I have small data, so efficiency shouldn't matter, just want to keep dt as dt.
 
@Cath hello Cath! you can use ' or even "
 
@DavidArenburg is my question a dupe? Couldn't find any relevant post by searching.
 
@zx8754 I'm not sure what exactly the question is about. You are basically trying to select few column from a data.table
 
@Cath wrap the codeblock in three backticks, then it works: x[ , newCol := paste(cyl, disp, sep = ",")][, `:=` (c("cyl", "disp"), NULL)]
 
question is create new column then subset?
 
11:06 AM
all the by reference part is irrelevant here, it seems. There should be a question regarding selecting columns from a data.table on SO, I'd bet
 
I see, I will leave the post here then, thank you all!
 
you could post a question if you like
 
@Jaap how about if we have more than 2 columns we want to drop. not happy with NULL assignment part :)
 
but just dont blame me for downvotes :)
3
 
I will start the post with "I am new to dt...."
 
11:09 AM
don't, I will edit it out ;-)
@zx8754 if you just want to keep one old column and the new (pasted) column, then follow David's suggestion
 
Trump is in Jerusalem right now, btw
so I've decided to work from home in order to avoid truffic
 
@Jaap thanks Jaap, I always forgot... :-/
 
@David I wonder how that visit is gonna go down after sharing israeli intel with the russians
 
@DavidArenburg heard that on the radio this morning, though everybody else in the US have more reason than he has to "wail"...
 
@mtoto We are basically Muricas puppets, so I don't think Trump cares too much about it
he is much more worried from his own Federal court and Europe
@Cath It would be funny if they won't allow him to come back to America
 
11:20 AM
@DavidArenburg that would be so good !
 
One of our Knesset members taking a selfie with Trump like a teenager:
:facepalm:
One of these times when Trump actually looks like the adult in the group
 
LOL! Melania in Tel Aviv is as MISERABLE, as Melania in the U.S. Watch her push away the CREEP's hand. PRICELESS😂😂… https://twitter.com/i/web/status/866599179958833152
 
@zx8754 wow she takes no prisoners
I actually feel sorry for him
 
heh, not sure who to feel sorry for.
 
she knows better protocol than him, SAD.
 
11:32 AM
him being ignored so publicly, or her being stuck in this relationship...
 
@zx8754 she chose to be by his side. I don't understand why people keep saying that
 
It is between them, no-one knows their setup. If I were her, I would divorce take 50% and chill.
 
she is an immigrant that married a billionaire and became the First Lady- I don't feel sorry for her
 
"immigrant" - irrelevant
 
most immigrants aren't so lucky
@zx8754 it is, an immigrant usually starts from the very buttom
unlike people who were born in US, know the language, the cilture, have family to support them, usually are much wealthier
 
11:49 AM
@DavidArenburg Any reason why you used collapse = "," instead of sep = "," or just finger trouble?
 
@UweBlock I just copied Tokhirs code, I have't actually look at it or ran it
 
12:01 PM
@DavidArenburg Sorry. I overlooked this in the @zx8754 's posting. @jogo silently corrected it.
 
12:12 PM
 
@mtoto yes, it has like 5 good dupes
not sure about that vote counts there
 
already killed it
 
thx
 
It's so unusual to see the deleted answers. :)
 
@Queen k
 
@Natty tp
 
@Queen k
 
1:29 PM
 
Voted.
 
thanks :-)
 
@Natty tp
 
2:49 PM
I totally knew one could "use sprintf" but as far as I'm concerned I just didn't see how... : stackoverflow.com/a/44115885/4137985
 
3:16 PM
@Cath closed
 
 
3 hours later…
6:05 PM
 
6:39 PM
@m0nhawk reminds me of this in R
user image
2
@Frank pls kill stackoverflow.com/questions/44116224/… (it didn't have r tag on it)
 
7:07 PM
@DavidArenburg killed
@Queen k
 
@Jaap thanks, I forgot you can do that with another r hammer
that basically means that two hammers of any tag can hammer any question on SO- no matter what tags it have on it
 
7:27 PM
Put tags, kill Q, remove tags? :)
Visual Studio is unusable on 14 inch screen with R layout.
 
7:47 PM
luckily RStudio is ;-)
 
@Jaap On my PC I have moved to Visual Studio for a few months already, but on laptop the RStudio still be used. :)
 
Aquamacs is on my 'to-try-out'-list; anyone having experience with it? (or with emacs in general)
 
8:15 PM
@Jaap I've been trying to learn GNU Emacs, but the number of basic shortcuts to learn (how to move your cursor, cut and paste, etc.) means I'm still working on tutorials/docs (the docs have their own tutorial, of course), and haven't even figured out how to install ESS yet.
 
8:28 PM
I'm afraid Aquamacs just dropped to the bottom of that list
 
8:45 PM
Aquamacs looks like it makes some of the basics more straightforward, but at the end of the day, learning Emacs is like learning a complete text-based OS.
 
9:29 PM
@DavidArenburg Cool! I didn't know of that easter egg !
 
 
1 hour later…
close as ... unfortunately in my 'real' world situation stackoverflow.com/questions/44121670/…
 

« first day (761 days earlier)      last day (2536 days later) »