[R] R strings from C
Ott Toomet
siim at obs.ee
Wed Dec 19 21:18:09 CET 2001
Hi,
I am trying to study R internal behaviour. So long, I have not
succeeded to access the value of R strings from C.
I use:
void salvesta_tabel(
SEXP data_frame,
SEXP file
)
{
printf( "nimi %d\n", (R_CHAR)( file));
}
and from the R side:
salvesta.tabel <-
function (x, file = "") {
.Call( "salvesta_tabel", x, file)
}
When calling from R as
salvesta.tabel( x, "file")
R always crashes while printing the %d part. So I assume that the
function R_CHAR is not the right one to access the value of the
variable file, I have experimented several other ways but so long
unsuccessfully, both Venables & Ripley ,S-programming' and ,Writing R
extensions' seem not to touch that issue.
Any suggestions?
And thanks in advance,
Ott Toomet
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list