On Sat, 24 May 2008, Allin Cottrell wrote:
BTW, please watch out for some changes in CVS: I'm moving the
R-file writing apparatus from gui_utils.c to a new file,
lib/src/foreign.c, so as to support command-line invocation of
chunks of external script, as per Ignacio's suggestion.
E.g., based on the example in the manual:
<script>
open bjg.gdt
foreign language=R
# extract the log series
y <- gretldata[, "lg"]
# estimate the model
strmod <- StructTS(y)
# save the fitted components
compon <- as.ts(strmod$fitted)
# save the estimated variances
vars <- as.matrix(strmod$coef)
# export into gretl's temp dir
gretl.export(compon)
gretl.export(vars)
end foreign
append @dotdir/compon.csv
vars = mread("(a)dotdir/vars.mat")
print vars
</script>
This works in CVS. I'll do some proper testing tomorrow.
("foreign language=ox" should be a possibility too, but it's not
ready yet.)
Allin.