OpasnetUtils/Fetch: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(alternative added) |
||
Line 7: | Line 7: | ||
==Code== | ==Code== | ||
<rcode | <rcode | ||
name="answer" | name="answer" | ||
Line 25: | Line 26: | ||
</rcode> | </rcode> | ||
=== Alternative === | |||
{{comment|# |Fetch should take 'dependencies' as argument and download variables to global memory. Fetch2 does that and I move to suggest that we replace fetch with Fetch2|--[[User:Teemu R|Teemu R]] 11:28, 15 June 2012 (EEST)}} | |||
<rcode label="Initiate functions"> | |||
# Fetch2 #################### loads all given dependencies to global memory | |||
Fetch2 <- function(dependencies, evaluate = FALSE) { | |||
for (i in 1:nrow(dependencies)) { | |||
if(!exists(dependencies$Name[i])) { | |||
objects.get(dependencies$Key[i]) # Key is the R-tools session identifier (seen at the end of the url) | |||
if (evaluate) get(dependencies$Name[i])@output <- EvalOutput(get(dependencies$Name[i])) | |||
# Eval not necessarily needed at this point | |||
} | |||
} | |||
} | |||
</rcode> | |||
==See also== | ==See also== | ||
Revision as of 08:28, 15 June 2012
[show] |
---|
Description
fetch downloads a variable.
Code
Alternative
----#: . Fetch should take 'dependencies' as argument and download variables to global memory. Fetch2 does that and I move to suggest that we replace fetch with Fetch2 --Teemu R 11:28, 15 June 2012 (EEST) (type: truth; paradigms: science: comment)