« first day (444 days earlier)      last day (2731 days later) » 

1:37 AM
 
If we find the RSS feeds to be bothersome, I'll remove them.
 
 
8 hours later…
9:59 AM
good morning!
 
10:38 AM
Hidy ho!
I gotta change rooms, brb.
 
 
7 hours later…
5:28 PM
I am stumped here:
0
Q: Mapping R code to dependencies, e.g. with data.table and ggplot2

IteratorI am sifting through a package and scripts that utilize the package, and would like to identify external dependencies. The goal is to modify scripts to specify library(pkgName) and to modify functions in the package to use require(pkgName), so that these dependencies will be more obvious later. ...

Am I missing some very obvious tool, doing it all wrong, or are dependencies supposed to be hard to find?
I look at my approach to finding these dependencies and think it looks naive and crude.
 
not sure what the problem is....
what do you mean 'stuck on data.table'?
 
Ah, feedback on my wording is also very helpful. :)
 
have you got scripts that do 'foo(x)' and you are trying to find out where foo came from?
 
I have a package, "myPackage", and a bunch of scripts that are run via Rscript.
For the package's functions, I want to find which depend on data.table. Even though it is loaded when the package is loaded, I still want to find these and add a require() to them, in case I move them out of the package.
 
ah ha
 
5:34 PM
For the scripts, some used data frames, some used data tables. I want to get rid of the data frame scripts, but that's hard. So, I figure I can find the data table scripts and the complement will be the data frame scripts.
I have been earning many new belts in regex-fu lately.
 
so what defines a 'data.table' script? one that uses function data.table?
 
A rough guess: this is impossible to automate for all cases.
 
Well, data.table describes an object, and some methods on those objects. I am looking for the scripts that either use the object (data.table) or functions on those objects.
@Andrie I love it when you say impossible. :)
 
ewww yeah
 
But, in this case, I agree.
That's my penultimate paragraph. :)
 
5:36 PM
The only approach I can think of is to insert a debug statement in each function that reports the class of the object that is being processed.
 
can you not just refer to your documentation? [rofl]
2
 
@Spacedman Ahem. :)
 
Then the only challenge is to write test code with 100% coverage of all functions.
 
this is where python is winning. you can call methods on objects without having to import whole namespaces
 
Actually, the package code is documented - the data table functions all have DT in the name. :)
But I want to be super sure....
As for the scripts, these are junk.
I am rewriting them to behave as they should behave.
 
5:38 PM
My point is I'm pretty sure I can write a function that will work for either data.frame or data.table input, and you won't be able to tell what class the object is, unless you ask the object to tell you its class.
 
@Andrie You're absolutely right. dim(), head(), etc. come to mind...
 
Trivial example: add2 <- functionx(x)x+2
OK. I'm glad I could help. Now need to get undistracted...
 
Hehe
 
Good luck, @Iterator
 
Thanks. I think that what I'd like is something that reports which packages are loaded during execution of code. That would be dynamic analysis. I don't know if my crude method could be beaten by static analysis.
But I am not familiar with the dynamic analysis tools, other than Rprof.
 
 
3 hours later…
8:42 PM
Hello!
 
How you all doing on this lovely Friday night?
BTW, did you hear that one, that even the calendar goes WTF after Tuesday?
 
I'm still at work... and my calendar goes Sunday, Monday, Monday, Monday, Monday, Monday, Saturday
 
Mmmmmm, then.
 

« first day (444 days earlier)      last day (2731 days later) »