This is cool! Thanks, Allin!
Artur
Am 01.02.20 um 20:02 schrieb Allin Cottrell:
Up till now there's been no support for sending string-valued
series
to an R function (with R_functions on, that is). All you'd get in R
was the numeric codes.
New in git: string values are passed to R; and also you can return an
array of strings from R. Trivial example:
<hansl>
set R_functions on
foreign language=R
strvals <- function(s) {
cat("Hello from R\n")
print(s)
u <- unique(s)
print(u)
}
end foreign
nulldata 8
series s = {1,2,3,4,1,2,3,4}'
stringify(s, defarray("a", "b", "c", "d"))
print s
eval R.strvals(s)
</hansl>
Allin
_______________________________________________
Gretl-devel mailing list -- gretl-devel(a)gretlml.univpm.it
To unsubscribe send an email to gretl-devel-leave(a)gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/