Re: [Rd] Is it a good idea or even possible to redefine attach?

2014-08-10 Thread Grant Rettke
Thank you for that pleasant and concise explanation! I will keep at it. Grant Rettke | ACM, ASA, FSF, IEEE, SIAM g...@wisdomandwonder.com | http://www.wisdomandwonder.com/ “Wisdom begins in wonder.” --Socrates ((λ (x) (x x)) (λ (x) (x x))) “Life has become immeasurably better since I have been

Re: [Rd] Is it a good idea or even possible to redefine attach?

2014-08-10 Thread Grant Rettke
As it turns out, my approach was a bit aggressive. A critical package was using it and could see my new attach! I will just warn, and encourage: .First - function() { gcr - new.env() gcr$unsafe.attach - attach gcr$attach - function(...) { warning(NEVER USE ATTACH! Use

[Rd] How to redefine `require' to generate a warning and delegate work to the original require?

2014-08-10 Thread Grant Rettke
Good afternoon, My goal is to warn the user any time that they use the `require' function. The reason is that they probably wanted to use `library' instead. There is a case where they should use the former though, so I just want to issue a warning. My approach was to: • Re-bind `require' to

Re: [Rd] How to redefine `require' to generate a warning and delegate work to the original require?

2014-08-10 Thread Jeroen Ooms
On Sun, Aug 10, 2014 at 7:22 PM, Grant Rettke g...@wisdomandwonder.com wrote: │ Error in gcr$original.require(...) - require : │ '...' used in an incorrect context I think you mean: gcr$original.require - base::require. You don't need the parentheses since you are not defining or calling a

[Rd] Fastest way to merge 300+ .5MB dataframes?

2014-08-10 Thread Grant Rettke
Good afternoon, Today I was working on a practice problem. It was simple, and perhaps even realistic. It looked like this: • Get a list of all the data files in a directory • Load each file into a dataframe • Merge them into a single data frame Because all of the columns were the same, the

Re: [Rd] Fastest way to merge 300+ .5MB dataframes?

2014-08-10 Thread Joshua Ulrich
The same comment Jeroen Ooms made about your last email also applies to this one: it is better suited to R-help. -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Sun, Aug 10, 2014 at 1:18 PM, Grant Rettke g...@wisdomandwonder.com wrote: Good afternoon, Today

Re: [Rd] Fastest way to merge 300+ .5MB dataframes?

2014-08-10 Thread Grant Rettke
My sincere apologies. Having read http://www.r-project.org/posting-guide.html , I had wanted to post this one to R-help. Grant Rettke | ACM, ASA, FSF, IEEE, SIAM g...@wisdomandwonder.com | http://www.wisdomandwonder.com/ “Wisdom begins in wonder.” --Socrates ((λ (x) (x x)) (λ (x) (x x))) “Life

[Rd] Error when assigning value in environment which is a locked binding

2014-08-10 Thread Winston Chang
If an environment x contains a locked binding y which is also an environment, and then you try to assign a value to a binding inside of y, it can either succeed or fail, depending on how you refer to environment y. x - new.env() x$y - new.env() lockEnvironment(x, bindings = TRUE) # This

Re: [Rd] Error when assigning value in environment which is a locked binding

2014-08-10 Thread Winston Chang
Another oddity - even though there's an error thrown in assignment to x$y$z, the assignment succeeds. x - new.env() x$y - new.env() lockEnvironment(x, bindings = TRUE) x$y$z - 1 # Error in x$y$z - 1 : cannot change value of locked binding for 'y' x$y$z # [1] 1 So I assume there must be a bug