« first day (680 days earlier)      last day (2495 days later) » 

12:25 AM
anyone?
 
/
 
 
5 hours later…
5:16 AM
Anyone what?
 
probably
anyone here?
goodmorning btw
online nice and early!
looked like a fun job
bit far way, New York
 
Looks interesting, but out of my field or territory. :)
 
Can someone help out here:
4
A: Efficient subsetting in R using 2 dataframes

mrdwabI don't know if it's any more efficient, but I would think you could also do something like this to get what you want: subs <- apply(test, 1, function(x) c((x-2):(x+2))) full[which(full$dt %in% subs), ] I had to adjust your "3" to "2" since x would be included both ways. Benchmarking (just...

I had naively assumed that the OP was just going to be subsetting based on a range of integers.
But in their update (after removing the accept mark from @Spacedman and marking my answer correct), they are matching using > or < decimals, where my simple solution doesn't work.
So, their benchmarks were really fast for my solution (nothing to match) and slower for @Spacedman and @Andrie
Both of their solutions work as the OP expects.
I've asked them to reaccept @Spacedman's answer, because my next answer would be virtually exactly the same as @Andrie's if I wanted to get the right output.
 
Annoying when the OP changes the rules of the game
You can ask the OP to change, but ultimately SO allows the OP to decide which answer he thinks is best
 
@PaulHiemstra I'm more surprised they would accept an answer without checking that it works! As soon as I saw the new runif statement, I knew my answer would be out.
It seems that the OP got the message though. I see the question has been updated again to use floor(runif...)
 
5:33 AM
:)
@mrdwab require(fortunes); fortune(15)
 
@PaulHiemstra Nice. I didn't know about the fortunes package.
 
6:25 AM
:), fortunes is nice
I added fortunes to my startup
so everytime I launch R I get a nice quote :)
 
for(i in 1:10)print(fortune()) used to be my entertainment before SO chat.
 
6:46 AM
better than soap operas on TV :)
"look what Hadley is doing right now!"
 
7:14 AM
@mrdwab do you think that OP on data.frames within an object could have an S4 object? I suspect he's got a list, though.
 
@RomanLuštrik My guess is a list, simply because of the info from the earlier linked post.
 
 
4 hours later…
11:11 AM
@Andrie I can replicate your 8 warnings. 64bit W7 with 2.15.1.
 
Thank you.
 
Bit unclear what the OP wants
0
Q: Handling different vector lengths caused by na.omit in sapply?

hans0l0I have a data.frame with several columns some of which contain NAs. I want to run the following function suggested by Farnsworth over every single column: hpfilter = function(x,lambda=1600){ eye <- diag(length(x)) result <- solve(eye+lambda*crossprod(diff(eye,lag=1,d=2)),x) retur...

I gave it a try, but I'm not sure.
 
More than a bit. More like a byte or even a kilobyte unclear.
:-P
 
:)
and it might be that the OP does not want his solution when he thinks it over
 
Hi, I have a query regarding R5 reference class, I m not able to get info online can I ask it here ?
 
11:22 AM
I would ask on the r-devel list
 
Thanks for the pointer Dirk
 
Also: they are called Reference Classes. R5 was a short-lived joked that proved to be inadmissible as Simon already had something else called R5.
We read the '[r]' tag in SO. If we don't answer, we don't have an answer. Reposting here buys you NOTHING.
 
@DirkEddelbuettel Au contraire, you get the wrath of Dirk for pennies!
 
Even cheaper than that.
 
I call them R7E Classes, in the spirit of I18N...
 
11:32 AM
Now you merely have to convince John Chambers to adopt the name.
 
Actually I call them ThisHasAlreadyBeenDoneNicerInPython classes
 
while(1) { downVoteForPythonSnobbery(Spacedman); Sys.sleep(1) }
I have the feeling I have seen you make that point before.
Soon references to Pavlov's dog will be replaced with ones to Spacedman barking 'already better in Python' whenever someone taps the knee that is "OO in R" discussions.
 
I note that snobbery is the upper classes looking down on the lower classes. Pun intended.
 
Pavlov's contribution to neuroethology was purely accidental. It was an interesting thing they noticed when working with digestive enzymes.
 
@Spacedman is probably doing the same in the Pyton chatroom whenever someone asks about statistics: "Already done better in R". Could someone go and check?
 
11:40 AM
Heh. Hence do your programming in python and call R with Rpy :)
 
12:12 PM
@DirkEddelbuettel I have fortran code which overflows on -O3
not on -O2
I'm fine with O2, but what are the reasons for this?
 
"Doctor, doctor, it hurts when I do this." "Then don't do it"
Go and fix gfortran
@RomanLuštrik See, you can get my wrath also by mentioning Fortran :)
 
hmmmm, my compiler skills aren't that great :)
@DirkEddelbuettel you have a lot of anger my dear Dirk
“Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.”
 
Nobody's are, which is why these things are buggy. You could consider creating a self-contained example and submitting at the gcc bugtracker. After you checked that 4.7.* or 4.8.* don't exhibit it.
 
ok, thanks
 
@PaulHiemstra You have no idea how mellow I am these days.
 
12:15 PM
@DirkEddelbuettel so there was more anger in the past....
 
I posted a message on the ggplot2 mailing list an hour ago. Mailing lists feel so quaint in comparison to SO...
 
G
 
12:32 PM
H
 
 
1 hour later…
1:45 PM
@PaulHiemstra do you have access to different gfortran versions?
I could help with 4.7.* if it suits, but would need something self-contained (evidently)
 
2:33 PM
@GSee do you know if anyone has done any work with options in the blotter/FinInst/quantstrat tool chain?
 
2:49 PM
AFAIK, not really. You can define options via twsInstrument or with option_series.yahoo. and, parse_id supports a couple different formats of option ids. I've downloaded some options data and plotted it. But that's about it
@JoshuaUlrich
@JoshuaUlrich There's certainly more support for options than there is for bonds. ;-)
 
lol, that's good to know.
 
3:07 PM
Hi
 
@Andrie: you totally destroyed my helpful edits. Jerk.
 
Success!
 
@JoshuaUlrich In theory, it should just work once you define your options, and in theory you should be able to define your options however you like using option and option_series (although something more automatic like I mentioned before is probably easier) See ?parse_suffix to see the formats that it will recognize.
 
im writing a loop for EM algorithm (aware of mclust but not using it) and am a little stuck at the moment
 
@Andrie At least I got a good pun in the comments after @joran.
 
3:09 PM
so i have values from the M step (using optim function) that i wish to pass back to the E step
they are in the format of opt1$par["mu1"]
im just wondering how i should pass this back in terms of notation, should i collect the E and M terms together
they are in the format of opt1$par["mu1"]
 
@Andrie ...apparently my pun is being overlooked by many.
 
@JoshuaUlrich Took me a second, but I get it now.
 
5 values from the M step being passed back to the following format t <- c(opt1$par["mu1"], opt1$par["mu2"]
 
@DirkEddelbuettel I only have one gfortran here on my work computer, which I do not administer myself. I'll have a look tomorrow which version of gcc I use. Thanks for the feedback
 
Anytime
 
3:28 PM
Enjoying your little rep bonanza for reading the docs back to people, are we @Andrie? :)
 
 
3 hours later…
6:01 PM
Hi @DirkEddelbuettel, since you just mentioned your littler, I have a question about it which I will phrase in the form of an expression: r -e 'library(zoo)'
Loading required package: stats
Error : .onLoad failed in loadNamespace() for 'zoo', details:
call: assignInNamespace("as.Date.numeric", function(x, origin, ...) {
error: locked binding of ‘as.Date.numeric’ cannot be changed
Error: package/namespace load failed for ‘zoo’
Execution halted
However, Rscript -e 'library(zoo)' works fine
 
You need to load methods as well, I suspect.
But on my box:
edd@max:~$ r -lzoo -e'cat("Hello, world\n")'
Hello, world
edd@max:~$
As well as
edd@max:~$ r -e'library(zoo)'
Loading required package: stats

Attaching package: ‘zoo’

The following object(s) are masked from ‘package:base’:

as.Date, as.Date.numeric

edd@max:~$
 
hmm. Maybe I've got an old zoo on this box
 
Stock Ubuntu 12.04 I think. /usr/bin/r is dated Mar 6, does not look like a local build
 
Got it. I just needed sudo apt-get install r-cran-zoo instead of checking out, building and installing myself
 
6:17 PM
The two ought to be equivalent as R CMD INSTALL should give you a refreshed zoo as well, no?
By the way, my all-time favourite littler script: update.r, in the examples/ dir. You may have to comment out the four or five lines for BioC (9 to 13 in my copy), put into into the path (I use ~/bin) and then just do ~/bin/update.r every couple of days.
 
I'm not sure what the problem is. I got it working on one box, but not the original. The one that works was giving an error:
$ r -lzoo -e 'cat("hello\n")'
Error in library(zoo) : there is no package called ‘zoo’
Execution halted
even though I had installed with R CMD INSTALL. After apt-get install r-cran-zoo, it works
But, the other box still has the same problem as it did originally
 
Check .libPaths()
Also r -lzoo -e'...' runs in non-interactive mode, so the rope I gave you recently with ~/.Rprofile may now be around your neck...
 
.libPaths() is the same on both boxes
but may not include what it should
[1] "/home/garrett/R/x86_64-pc-linux-gnu-library/2.15"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
 
I always make sure I do not have [1] which I hate with a passion.
Unix is multiuser. Packages belong in /usr/local if local, or /usr if packaged, but should be available for all.
And [1] is just fscked up with the 2.15, introducing a versioned path that'll just break with the next release of R.
 
thanks for the advice. I'll see if I can detect any other differences later.
 
6:35 PM
@joran Well, it just proves my point that there is scope to improve the docs!
 
@DirkEddelbuettel, Ok. So, zoo shows up in 3 out of 4 of those directories on my .libPaths()... and they are all different versions.
 
[4] should be reserved for recommended packages, so [1] to [3] I presume?
 
yep. 1.7-7, 1.7-6, 1.7-0, respectively
 
[3] is driven by distro releases, [1] you should nuke leaving you [2] and update.r to remain a happy camper.
 
Thanks!
@DirkEddelbuettel, you don't run ~/bin/update.r as sudo do you?
Warning in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, :
'lib = "/usr/local/lib/R/site-library"' is not writable
Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, :
unable to install packages
Execution halted
Man, I've got a lot to learn about computers
 
6:46 PM
Of course not. Make /usr/local/lib/R/site-library/ writeable by you. I tried by giving it a reasonable group, but then noone is in the group
On my box:
edd@max:~$ ls -ld /usr/local/lib/R/site-library/
drwxrwsr-x 215 root staff 4096 Aug 27 19:54 /usr/local/lib/R/site-library/
edd@max:~$
and I am member of 'staff'. Et voila, eternal peace.
The reason you can't write there is why you ended up with the the dreaded [1]
 
Sounds easy...
garrett@Work2nix:~$ ls -ld /usr/local/lib/R/site-library/
drwxrwsr-x 14 root staff 4096 Jun 19 2011 /usr/local/lib/R/site-library/
garrett@Work2nix:~$ members staff
garrett
still same error though
I know, I know
Aug 22 at 16:16, by Dirk Eddelbuettel
@user1584009 This is not a help desk.
:-)
 
Odd, maybe try a new shell just to make sure. And you can of course make the directory 0777 as well...
 
7:08 PM
chmod worked
Thanks for the support session. Sorry, everyone else, for the clutter
 
Good. But something odd is going on with your id and group membership.
 
This is the first Ubuntu computer I ever used. There's a lot of odd stuff going on with it ;-)
 
@GSee Yeah, first odd thing is that you don't have to reboot it every other day.
 
:-D
 
Usually, I only reboot for kernel updates.
 
7:12 PM
@DirkEddelbuettel could it be that root is not a member of staff?
never mind. that doesn't make sense
 
7:28 PM
I think your machine simply detects that you are a relative Unix newb and harasses you.
It is a rite of passage. We have all been through it.
 
any thoughts on: stackoverflow.com/questions/12184974/loop-or-apply-function
 
I have a thought about whether it does you any good to ask if we saw a question on the main site
 
7:44 PM
i also have a thought......
 
@YesSure It's not clear what you're trying to do or what your question is.
 
ok i will reread it and see if i can clarify, it may be a wood for the trees scenario
 
@YesSure, you win
 
8:23 PM
@YesSure printing the optimized parameters does not help clarify your question...
 
@JoshuaUlrich not done yet with additions
@JoshuaUlrich crystal or still foggy?
 
8:43 PM
Not clearer to me at all. Maybe someone else will understand.
 
@YesSure Your question seems to me to be both too broad (whole books are written on the "best iterative process") and too localized (I have a hard time seeing how this will benefit anyone other than you).
 
ok cheers, thanks for taking the time to look anyway, much obliged
 
@YesSure, I tried your code (even though I don't really understand it) and for opt2$par I got 5 NAs
 
i just ran it exactly as its posted and got the exact values posted
 
Then try it in a clean R session
I tried it on both Windows and Linux
 
8:53 PM
just did and same result, running R 2.14.2
windows
 
That's an old version of R
 
@YesSure, your code doesn't work unless you have the minqa package loaded
 
yes i have that, thats why it wasnt working for you
warnings() tells you that
 
@YesSure Requiring the people you're asking to help you to discover and solve that on their own is not a good way to encourage them to continue to help you...
3
 
Yep. That's it for me. Voting to close as too localized.
 
9:04 PM
i was of the impression you guys had the majority of packages installed, however comment noted and retained
 
@YesSure What, all 4000 of them!? Not likely, we like R, but not that much :P
 
@YesSure The majority of 4000 packages? Installed, maybe. But loaded?
 
haha, fair enough, i must have a couple of hundred already, so i thought the hardcore would be streets ahead
ok ok point taken
 
Even if we had all 4000 packages loaded we may get different results for some things depending on the order in which the packages were loaded.
 
@YesSure I don't load any packages automatically at startup. I always take care of that at the very beginning of my R scripts to ensure they're as reproducible as possible by anyone.
 
9:09 PM
ok thanks joshua thats a good lesson to learn
 
@JoshuaUlrich Inserting footnote here: "modulo the fact that I run random SVN revisions of stuff off R-Forge"
 
@DirkEddelbuettel Yes, that too, and the random SVN revisions are development versions of the packages I use the most.
 
@DirkEddelbuettel, you have a box that has all CRAN packages installed on it, right? How long would it take to load them all?
 
I had (have?) courtesy access on a virtual machine in Vienna that has access to all sources, making grep etc easy. Don't think all are loadable.
I at one or actually two times build systems that built all of CRAN into .deb packages though.
Loading all at once was never a design goal though.
 
9:43 PM
The extent to which people seem to refuse to read documentation continues to astonish. Latest case:
0
Q: Writing the data frame to MySql DB table

pandhaleHow to write the data frame in R into MySQL? dateTime host authId sessionId status action 2012-08-22 14:58:23 foo.com 221501398 2c10b368ae23ba3 questions#instant_answers 2012-08-22 14:58:23 foo.com 221501398 22c10b368ae23 que...

 
10:15 PM
That indeed looks something a basic example would contain. Ah well, what's one to do...
 

« first day (680 days earlier)      last day (2495 days later) »