[ESS] R's scan function and ESS's refusal to send a blank line from code to *R*

Vitalie Spinu spinuvit at gmail.com
Fri Dec 2 20:26:49 CET 2011


> ESS won't send a "blank line" from the R script to the R session, so
> the *R* process is "stuck" there until user goes to the *R* terminal
> and manually hits enter.
>
> If Emacs/ESS were sending the empty lines through properly,  the scan
> would know work is finished. As John said to me, it should finish like
> so:
>

This is a customizable behavior of ESS:

(setq ess-eval-empty t)

should do the job.

Vitalie.

> x <- scan()
>> 1: 1 2 3
>> 4: 4 5 6 7
>> 8: 8 9
>> 10:
>> Read 9 items
>>
>
> I'm using Debian Linux, Emacs 23.3.1 and ESS 5.14, in case that matters.
>
> I've tested this with RStudio and it does not have the same trouble,
> it will send the blank line to *R* and the process moves on.
>
> What do you think?
>
> Here's the 'real life' example from the sem package help file
>
> library(sem)
> model.dhp <- specifyModel()
>    RParAsp  -> RGenAsp, gam11,  NA
>    RIQ      -> RGenAsp, gam12,  NA
>    RSES     -> RGenAsp, gam13,  NA
>    FSES     -> RGenAsp, gam14,  NA
>    RSES     -> FGenAsp, gam23,  NA
>    FSES     -> FGenAsp, gam24,  NA
>    FIQ      -> FGenAsp, gam25,  NA
>    FParAsp  -> FGenAsp, gam26,  NA
>    FGenAsp  -> RGenAsp, beta12, NA
>    RGenAsp  -> FGenAsp, beta21, NA
>    RGenAsp  -> ROccAsp,  NA,     1
>    RGenAsp  -> REdAsp,  lam21,  NA
>    FGenAsp  -> FOccAsp,  NA,     1
>    FGenAsp  -> FEdAsp,  lam42,  NA
>    RGenAsp <-> RGenAsp, ps11,   NA
>    FGenAsp <-> FGenAsp, ps22,   NA
>    RGenAsp <-> FGenAsp, ps12,   NA
>    ROccAsp <-> ROccAsp, theta1, NA
>    REdAsp  <-> REdAsp,  theta2, NA
>    FOccAsp <-> FOccAsp, theta3, NA
>    FEdAsp  <-> FEdAsp,  theta4, NA
>
> --
> Paul E. Johnson
> Professor, Political Science
> 1541 Lilac Lane, Room 504
> University of Kansas
>
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list