[R] R strange behaviour when building huge concatenation

Jagat.K.Sheth at wellsfargo.com Jagat.K.Sheth at wellsfargo.com
Tue Nov 27 18:13:08 CET 2012


You probably hit a buffer limit in X11/xterm on your ubuntu machine with copy and paste. I get that behavior with Putty using your vector or when pasting (long) commands into Putty. 

If you really prefer copy and paste for this vector then try something like

> eval(parse(text=scan("clipboard", what="")))
Read 2357 items
> head(p1x)
[1] 2 1 0 0 0 7
> tail(p1x)
[1] 0 0 5 0 4 0

Otherwise you can save your code and source() the file. There is also ESS (Emacs Speaks Statistics) and friends if you want to avoid copy/paste approach.  

BTW you can use Ctrl-C to get back to command prompt in your R console rather than typing "q" in your output below. 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of angeloimm
> Sent: Tuesday, November 27, 2012 9:04 AM
> To: r-help at r-project.org
> Subject: Re: [R] R strange behaviour when building huge concatenation
> 
> Hello John
> It seems correct to me too but in my R console it seems to not be
> working
> Here there is what I did:
> i copied the statement on one row (leaving and removing the final
> useless
> semi colomn)
> i tried to execute it in the R console (in order to open my R console I
> simply opened a terminal window on my ubuntu machine and I typed "R")
> when I click "enter" the inserted statement doesn't not run...I simply
> see
> the cursor on a new line and this new line starts with "+"
> 
> Here there is a little stack of what I see on my terminal:
> , 1, 1, 2, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 17, 2, 2,
> 0,
> 2, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0,
> 0,
> 1, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 7, 0, 0, 1, 0, 0, 3, 0, 0, 2,
> 4,
> 0, 1, 0, 0, 0, 0, 2, 1, 0, 4, 2, 0, 0, 1, 3, 0, 0, 1, 0, 0, 1, 0, 1, 1,
> 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 1, 0, 1, 1, 3, 3, 0, 0, 0, 0, 1, 0, 2,
> 0,
> 1, 0, 0, 0, 1, 1, 0, 2, 0, 2, 0, 3, 0, 4, 0, 1, 1, 0, 0, 1, 0, 3, 0, 0,
> 0,
> 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0, 6, 0, 0, 0, 0, 3, 0, 0, 0, 2, 5,
> 0,
> 1, 0, 0, 1, 0, 1, 0, 0, 2, 0, 1, 2, 0, 0, 7, 0, 0, 2, 0, 2, 2, 0, 0, 0,
> 0,
> 0, 2, 0, 8, 0, 0, 5, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 2,
> 1,
> 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 2, 0, 0, 1, 0, 1, 2, 0, 0, 1, 0, 2, 0,
> 0,
> 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 9, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 1,
> 1,
> 1, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0,
> 0,
> 1, 4, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0,
> 0,
> 6, 0, 0, 0, 0, 1, 0, 0, 2, 6, 0, 1, 0, 0, 0, 0, 2, 0, 7, 0, 1, 2, 1, 1,
> 1,
> 0, 0, 1, 5, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 5, 1,
> 0,
> 1, 2, 0, 0, 1, 2, 0, 1, 0, 2, 0, 1, 2, 7, 1, 2, 0, 0, 0, 5, 0, 4, 0))
> +
> +
> +
> +
> +
> 
> Each time i click enter i go on a new line starting with "+"
> Then if i start in tying some character I get an error like this:
> 
> +
> +
> + q
> +
> + q
> Errore: unexpected symbol in:
> "
> q"
> 
> Sometimes this error (Errore: unexpected symbol in:) appears in the
> statement execution
> 
> Here there are my sessionInfo() result:
> > sessionInfo()
> R version 2.14.1 (2011-12-22)
> Platform: i686-pc-linux-gnu (32-bit)
> 
> locale:
>  [1] LC_CTYPE=it_IT.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=it_IT.UTF-8        LC_COLLATE=it_IT.UTF-8
>  [5] LC_MONETARY=it_IT.UTF-8    LC_MESSAGES=it_IT.UTF-8
>  [7] LC_PAPER=C                 LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=it_IT.UTF-8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> 
> I really don't know why this happens....above all because it seems to
> me a
> very very simple statement...
> Thank to all you for the support
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/R-strange-
> behaviour-when-building-huge-concatenation-tp4650817p4650970.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list