« first day (558 days earlier)      last day (2748 days later) » 

7:43 AM
Hello
 
8:08 AM
Hello
 
 
1 hour later…
10:05 AM
I have a Time column like
                  Time
1  2015-09-07 22:15:00
2  2015-09-07 22:21:00
3  2015-09-15 12:50:00
4  2015-10-13 21:01:00
5  2015-10-21 16:52:00
6  2015-10-21 16:52:00
7  2015-10-21 16:52:00
8  2015-10-21 16:52:00
9  2015-12-01 23:33:00
10 2015-12-30 01:53:00
using geom_bar function I got this type of picture
but I want 2015-11-01 in there...how to do that?
 
@user2100721 I suppose that isn't what you are looking for?
 
Here is my code
structure(list(Time = structure(c(1441644300, 1441644660, 1442301600,
1444750260, 1445426520, 1445426520, 1445426520, 1445426520, 1448992980,
1451420580), class = c("POSIXct", "POSIXt"), tzone = "")), .Names = "Time", row.names = c(NA,
-10L), class = "data.frame")
ggplot(data = df,aes(x=cut(df$Time,breaks = "month"))) + geom_bar()
 
I don't get the question
 
@Tensibai they want to show up missing date as well.
 
awwww
I think I did saw something like that somewhere (using seq.date IIRC), give me a sec
 
10:16 AM
yes, I saw too, can't find it.
 
I want this type of pic
 
I think tidyr or dplyr has something like "fill in, complete", or we could just create dummy continuous dates dataframe and merge, then plot
 
It was using floor_date but that doesn't scale for non existent values :/
 
this looks like a dupe, any targets?
 
@Tensibai but cut has that level too
levels(cut(df$Time,breaks = "month"))
[1] "2015-09-01" "2015-10-01" "2015-11-01" "2015-12-01"
 
10:25 AM
Yep, it was a wrong memory :)
 
@user2100721 with this, you get what you want I think:
ggplot(data.frame(table(cut(df$Time, breaks = "month"))),
       aes(x = Var1, y = Freq)) +
  geom_bar(stat = 'identity')
 
10:42 AM
Am I wrong to feel like this answer is a bit condescending? Too lazy/angry to edit... anyone with more polite language here? :)
 
after the edit it seems ok to me
 
"no you cant", "Read ?ifelse carefully and carefully. Your code...", " No need to touch ...", anyway :)
 
@ProcrastinatusMaximus Thanks...it works perfectly
 
@zx8754 it is indeed a bit blunt; could be refrased to: "It is better to do it this way"
 
10:57 AM
@ProcrastinatusMaximus Anyway, I think his language is in general a bit off. That's another reason I don't want to edit. Probably language/culture barrier, although living in the UK, I expected a better attitude.
 
@zx8754 edited :-)
 
I would say it was 'acceptably blunt'...
 
@user2100721 :-)
 
How's everyone doing today? We've got a public holiday tomorrow because of a horse race, which I find a bit odd..
 
@SymbolixAU for ahorse race? even the French or Belgians don't come up with a reason like that ;-)
2
 
11:06 AM
ha - yeah; and in September we have a day off because of 'footy'
 
you get an official off day early in this week...sounds good to me though little bit odd too for the reason
 
good point; I had completely forgotten that it's also odd to have a day off on a Tuesday - for some reason I couldn't see past the horse race
 
anyway: I'm doing fine, had a lovely weekend :-)
now working hard on a report about the international trade of small & medium enterprises
 
@ProcrastinatusMaximus if possible, could you summarise your report into 1 sentence for us? :D
 
11:24 AM
@zx8754 tough challenge: the report is going to be around 100 pages long :-/
 
pad it out with lots of images; that's my advice. And it makes it look longer / more important
 
@ProcrastinatusMaximus I sure you can do it! Give it a try.
 
@SymbolixAU yeah, i know; we use a plot on nearly every page ;-)
@zx8754 now I think of it, trying to summarise it in one sentence is a nice exercise for preparing the presentation :-)
 
ELI5 or "An alleged scientific discovery has no merit unless it can be explained to a barmaid.", methods basically :)
 
1:06 PM
Deleted.
 
?
 
He is saying hello
 
That too. :)
 
2:08 PM
Hellooo people! Presentation is over, Dubai is beautiful and I feel young again :)
4
Well...younger :p
 
In other news, you gotta love meaningless edits that simply want to inform you that they took their upvote away
 
2:26 PM
Quote of myself: "and have chef run on the amster " Best typo ever :p
One of the most awfull answer I did see
 
hullo any and all
i say we close this as something: stackoverflow.com/q/40334837
 
3:02 PM
@Frank looks like a pretty normal Q to mee (though OP could have included the desired result)
 
@ProcrastinatusMaximus their illustration of the data doesn't match the MRE, also i would bet that they are not actually looking at a matrix
(doesn't match in that the dates are formatted differently, i mean)
 
@Frank he certainly is sloppy on the example data
anyway, something like dt1[grep('([A-Za-z]+ )([0-9]{1,2}[,] )(\\d{4})', V1), V2 := V1][, V2 := na.locf(V2)][V1!=V2] should solve his problem
 
for questions that inevitably need a regex treatment, that sort of sloppiness makes it into a chameleon question i guess, like "oh sure, your answer works for the example, but i have a person named 'January 1, 2010 Brown'" or "oh, but actually i have my dates formatted like [x]"
placeholder / pseudocode examples for regex don't really cut it, i guess
 
@Frank true
left a comment asking to improve the question
 
3:31 PM
ok
this fellow is getting tiresome, but i'm considering directing him or her to SO chat to prevent further mailbox spamming github.com/Rdatatable/data.table/issues/…
i'd give better than even odds that they didn't know that DT[1:2, x := log(x)] was a doable thing
 
4:08 PM
hm, i wonder if there's some function to reorder by reference with respect to an arbitrary ordering stackoverflow.com/q/40345910
oh, guess i found it:
o = DT[ DT[, sum(y), by=x][order(-V1), x], on="x", .I, by=.EACHI]$I
.Call(data.table:::Creorder, DT, o)
DT
 
4:36 PM
@Frank I don't care about this FR as long as I don't have to use this type of syntax. `%<>% is not very convenient to type and easy to misstype on my German keyboard layout.
 
yeah, i wish r supported custom operators not wrapped in %%. it's not very convenient on my us/qwerty either
 
@Frank But at least you can hold the shift key. I've got < and > on the same key (the one left to your z).
 
@Roland oh, ouch!
 
My < and > are on the same place as Roland's. Backtick ` is on Alt Gr + 7, though.
 
4:55 PM
new reply says:
> And I have yet to really read and a cogent argument of the the superiority of %:=% (or an alternate) to %<>% .
i mean, what are they expecting? we're talking about UI here
might as well be talking about camelCase versus the_right_way
necessary keystrokes and hand contortions are relevant, but i guess this individual cannot be swayed
 
5:49 PM
Does anyone have any idea how to save a larger picture using Word option of rmarkdown in windows?
larger in the sense of height and width
 
6:22 PM
 
@user2100721 Arguments fig.width and fig.height don't do it for you?
 
@RichScriven duped
 
@RomanLuštrik I found this
according which all of them will be exported on that specified size
 
@user2100721 Right, but you can also adjust each chunk's options, or even globally.
 
6:36 PM
@user2100721 With little experience in converting to Word, I tried the options you cite today for an ioslides and it didn't work.
 
I am not sure how to adjust for each chunk
@RomanLuštrik ok...thanks for your help
 
By specifying the options.
E.g.: {r echo = FALSE, fig.width = 7}
Ah, the backticks are missing.
The way you would use echo, cache, tidy and the like... you use fig.width.
Check out knitr docs, this is very basic and shouldn't be hard to dig up.
 
Thanks....done...I never used rmarkdown before. Maybe that's why I asked this question
 
6:55 PM
@opla sorry, we've set a bar of 1k rep for this room, as shown in the rules linked in the room description
@Roman i think you need to show them what it means to use default values stackoverflow.com/a/40348529 their last edit suggests they don't get it
 
@Frank 50 parameters is tricky in any case.
 
yeah
 
Does anyone know if one can easily parallelize purrr::map?
 
their fn has other big problems, like: they should read the data in once and store it in the environment of the function, not read it in on each fn call
 
@Frank Currently I'm leaning towards a named vector and adjusting the flow inside the function based on that.
But I'm afraid that without fully understanding the end game of OP, it's hard to suggest an optimal solution.
 
7:12 PM
@RomanLuštrik yeah, that makes sense. actually, if you use a named list, there are two benefits: of course, the args can have multiple types; but also, you can do a data.table join like DT[arglist, on=names(arglist), id]
since their query seems to be of the form arg1 == val1 & arg2 == val2 & ...
i have a similar function i use interactively, but decided to write it as r <- function(ids = idDT[ my_default_query, id ]){ ... }, so i have my template right there to see if i ever need to use a different query, visible by typing args(r)
 
7:58 PM
Lately that Masi guy is asking a lot of R questions.
and some of them are pretty basic - stackoverflow.com/questions/40330096
 
@zx8754 hm, yeah, i'd expect most people to move beyond their pseudocode there before asking a question
now i'm kind of regretting answering, since they seem unfamiliar with r syntax and so probably shouldn't be going way beyond it into this NSE stuff...
 
@Frank still better than complete "give me code/google for me" type of questions, OP knows about programming, just struggling with R-way of things.
 
yeah
 
8:22 PM
bah, I got excited that there's a new version of R, then read news() and realized it's almost all bugfixes. I'm not sure why I expected anything else, but still...
 

« first day (558 days earlier)      last day (2748 days later) »