Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

paste character limit [duplicate]

Tags:

terminal

r

gnome

Possible Duplicate:
Why and where are \n newline characters getting introduced to c()?

I am running R (version 2.15.1) in a bash shell (version 4.2.36(1)) in the GNOME terminal (version 3.4.1.1). Sometimes I write my code in a text file and then paste it directly into the console (when running R). I didn't have any problems until the scripts I was pasting grew in length. Now, it appears that any code greater than 4206 characters (including \n) is rejected (i.e., the first 4206 characters are accepted and the remaining code is truncated; the truncation is accompanied by the terminal "bell" sound). This character limit is not specific to bash or GNOME terminal because I do not observe a character limit when pasting into e.g., vi. Therefore, I suspect that the character limit is imposed by R, but do not know how to change it, assuming it is a user-configurable parameter. Can the paste limit be changed and if so, what parameter governs it?

like image 996
user001 Avatar asked Nov 04 '12 06:11

user001


People also ask

Is there a character limit for copy and paste?

Text is limited to 255 characters when copying and pasting from Excel into a Strater table. To work around this, you can do one of the following: Click the File | Open command in Strater to open the Excel file.

How do I get past 255 character limit in Excel?

The MATCH function has a limit of 255 characters for the lookup value. If you try to use longer text, MATCH will return a #VALUE error. To workaround this limit you can use boolean logic and the LEFT, MID, and EXACT functions to parse and compare text.

How much can you copy and paste at once?

The Office Clipboard allows you to copy up to 24 items from Office documents or other programs and paste them into another Office document.

How much can clipboard hold?

However, the clipboard history is only available for copied text and images up to 4 MB in size. To enable the clipboard history feature, follow the steps below.


1 Answers

It looks like you're running into a known limitation of the console. As it says in Section 1.8 - R commands, case sensitivity, etc. of An Introduction to R:

Command lines entered at the console are limited[3] to about 4095 bytes (not characters).

[3] some of the consoles will not allow you to enter more, and amongst those which do some will silently discard the excess and some will use it as the start of the next line.

Either put the command in a file and source it, or break the code into multiple lines by inserting your own newlines at appropriate points (between commas).

The value is hard-coded in src/include/Defn.h : #define CONSOLE_BUFFER_SIZE 4096, so you would need to recompile R to change it.

like image 77
Joshua Ulrich Avatar answered Sep 20 '22 07:09

Joshua Ulrich