[Rd] R_ParseVector problem: it's cutting off after the decimal point

Roland Boubela roland.boubela at gmail.com
Wed Mar 19 17:22:44 CET 2008


Dear all,

my aim is to integrate R in an interactive visualisation software
called Bulk Analyzer developed by VrVis (http://www.vrvis.at).

the code:

SEXP e, tmp;
ParseStatus status;

PROTECT(tmp = mkString("x <- c(1.234,-3.45)"));
PrintValue(tmp);
PROTECT(e = R_ParseVector(tmp, -1, &status, R_NilValue));
PrintValue(e);
UNPROTECT(2);

produces the following output:

[1] "x <- c(1.234,-3.45)"

expression(x <- c(1, -3))


I'm using MS Visual C++. The code works fine in a small test project
with the same R startup settings (attached) as in the Bulk Analyzer
project.
Is there any setting or condition for this parser behaviour?

Kind regards,
Roland N. Boubela


> sessionInfo()
R version 2.6.2 (2008-02-08)
i386-pc-mingw32

locale:
German_Austria.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
================================================
    // init R
    Rf_initEmbeddedR(0, NULL);

    Rstart Rp = &rp;
    R_DefParams(Rp);

    // root of the R installation
    Rp->rhome = get_R_HOME();

    // root of the users directory
    Rp->home = getRUser();

    // UImode: RGui, RTerm, LinkDLL
    Rp->CharacterMode = LinkDLL;

    // function which reads input for R from a console
    Rp->ReadConsole = myReadConsole;

    // function which writes output from R to a console
    Rp->WriteConsole = NULL;
    Rp->WriteConsoleEx = myWriteConsoleEx;

    // called during i/o, eval, graphics in ProcessEvents
    Rp->CallBack = myCallBack;

    // handles messages for the user from R
    Rp->ShowMessage = myShowconcise Message;

    // user interaction: a user is asked a question an should answer
with YesNoCancel (maybe dialog)
    Rp->YesNoCancel = myYesNoCancel;

    // on R state changed: busy(=1)/idle(=0)
    Rp->Busy = myBusy;

    Rp->home = getRUser();

    // R-Settings...
    Rp->R_Quiet        = (Rboolean)FALSE;
    Rp->R_Interactive    = (Rboolean)TRUE;
    Rp->RestoreAction    = SA_RESTORE;
    Rp->SaveAction        = SA_NOSAVE;

    // our parameters
    R_SetParams(Rp);
    R_set_command_line_arguments(0, NULL);

    GA_initapp(0, NULL);
    readconsolecfg();

    /// run_Rmainloop() starting in a different thread



More information about the R-devel mailing list