Difference between revisions of "OpasnetUtils/Drafts"

From Testiwiki
Jump to: navigation, search
(Answer: timepoints improved)
(Answer)
Line 638: Line 638:
 
# In other words, this will integrate over obstime at specified timepoints.
 
# In other words, this will integrate over obstime at specified timepoints.
 
X, # X must be an ovariable with a column of the same name as obstime.
 
X, # X must be an ovariable with a column of the same name as obstime.
obstime # obstime must be a single-column data.frame of observation times.  
+
obstime, # obstime must be a single-column data.frame of observation times.  
 +
sumtimecol = TRUE # Should the timecol be summed up?
 
# obstime and timecol may be numeric (by coercion) or POSIXt.
 
# obstime and timecol may be numeric (by coercion) or POSIXt.
 
) {
 
) {
Line 651: Line 652:
  
 
out <- data.frame()
 
out <- data.frame()
 +
if(sumtimecol) by <- setdiff(marginals, timecol) else by <- marginals
  
 
for(i in obstime[[timecol]]) {
 
for(i in obstime[[timecol]]) {
Line 656: Line 658:
 
temp <- aggregate(
 
temp <- aggregate(
 
temp[paste(X@name, "Result", sep = "")],
 
temp[paste(X@name, "Result", sep = "")],
by = temp[colnames(temp) %in% setdiff(marginals, timecol)],
+
by = temp[colnames(temp) %in% by],
 
FUN = sum
 
FUN = sum
 
)
 
)

Revision as of 17:14, 15 February 2015



Question

Which functions are so useful that they should be taken into OpasnetUtils package? This page contains draft function which will be included when they are good enough and found important.

Answer

Call the objects stored by this code from another rode with this command:

objects.latest("Op_en6007", code_name = "answer")

+ Show code

See also

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>