[Rd] Problem with cut and paste corruption

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Feb 26 16:57:17 CET 2010



On 26.02.2010 12:03, Ian Thurlbeck wrote:
>
> Dear All
>
> We have noticed a problem when cut-and-pasting a largish section
> (> 4096 bytes ?) of R code from an editor to an R session.

It is a bad idea to do that in any case.
If you have such huge data or code, save the data / code to a file and 
read that one. If it is R code, use source() to do so.



> System is Fedora 12 i386 with updates, R-2.9.0 and R-2.10.1 at least.
>
> Problem disappears if you start R with --no-readline !


So you hit the readline buffer limit.


> If happens independently of the editor (tried vim/kate) and the
> terminal (tried konsole/gnome-terminal)
>
> Could you please try and reproduce the problem and see if it is
> limited to Fedora (Windows XP seems to work fine) ?

There are buffer sizes and you probably hit one of them. So no need to 
try. You cannot expect Copy & Paste to work for an arbitrarily sized string.

Uwe Ligges



> I've attached a 5K data file aids.R from the gss package which seems to
> trigger the problem. Just load aids.R into an editor and cut-paste
> into a fresh R session and you should see something like:
>
> ...
> + "224", "2
> + "233", "234", "235", "236", "237", "238", "239", "240", "241",
> Error: unexpected numeric constant in:
> ""224", "2
> ...
>
> Many thanks
>
> Ian
>
>
> aids.R
>
>
> "aids"<-
> structure(list(incu = c(28, 14, 10, 10, 23, 13, 12, 37, 6, 4,
> 13, 11, 21, 8, 33, 13, 8, 20, 37, 20, 18, 8, 27, 43, 17, 8, 11,
> 15, 10, 4, 32, 23, 32, 10, 15, 28, 34, 34, 17, 29, 17, 29, 38,
> 61, 12, 38, 32, 46, 30, 34, 53, 13, 22, 4, 37, 60, 53, 20, 38,
> 62, 24, 37, 41, 18, 10, 24, 25, 39, 25, 5, 29, 19, 14, 35, 18,
> 68, 48, 16, 48, 47, 10, 69, 55, 22, 16, 23, 4, 11, 30, 13, 10,
> 36, 38, 48, 26, 29, 31, 12, 70, 67, 63, 33, 32, 32, 50, 21, 33,
> 17, 53, 10, 65, 29, 53, 36, 12, 11, 36, 31, 49, 15, 9, 11, 24,
> 4, 43, 43, 80, 36, 68, 58, 23, 55, 12, 41, 46, 51, 39, 63, 51,
> 44, 39, 29, 51, 63, 40, 22, 48, 64, 79, 89, 54, 16, 17, 29, 18,
> 15, 29, 21, 25, 24, 0, 48, 21, 37, 26, 13, 20, 17, 8, 29, 41,
> 19, 28, 18, 19, 18, 33, 40, 58, 63, 18, 59, 33, 56, 72, 32, 37,
> 62, 41, 38, 32, 11, 10, 19, 37, 37, 20, 13, 6, 35, 23, 27, 12,
> 49, 26, 42, 12, 16, 14, 38, 18, 62, 35, 42, 10, 20, 30, 34, 40,
> 59, 16, 37, 15, 40, 40, 21, 20, 43, 46, 19, 48, 5, 23, 32, 31,
> 42, 20, 24, 38, 29, 43, 11, 63, 27, 13, 62, 15, 14, 83, 34, 29,
> 55, 34, 54, 19, 20, 52, 57, 63, 38, 24, 31, 14, 64, 76, 25, 29,
> 19, 20, 52, 33, 10, 49, 36, 17, 60, 29, 67, 24, 19, 29, 32, 49,
> 40, 68, 61, 53, 22, 32, 23, 27, 47, 38, 27, 41), infe = c(80,
> 64, 57, 54, 63, 52, 49, 71, 38, 35, 40, 38, 48, 31, 54, 34, 26,
> 37, 53, 35, 33, 22, 40, 52, 26, 16, 19, 22, 17, 11, 38, 29, 33,
> 13, 64, 75, 79, 77, 60, 69, 57, 68, 76, 99, 49, 74, 68, 81, 75,
> 69, 85, 44, 53, 35, 67, 84, 83, 49, 66, 90, 52, 75, 68, 45, 36,
> 49, 48, 62, 48, 28, 50, 40, 35, 55, 38, 87, 67, 35, 67, 66, 28,
> 87, 73, 40, 33, 40, 20, 27, 46, 29, 26, 52, 53, 74, 41, 43, 45,
> 26, 83, 80, 76, 45, 44, 43, 61, 32, 44, 27, 63, 19, 73, 37, 61,
> 44, 19, 18, 43, 37, 55, 21, 15, 17, 30, 5, 49, 48, 85, 41, 72,
> 62, 27, 59, 16, 45, 49, 54, 42, 66, 54, 47, 42, 31, 53, 65, 42,
> 24, 50, 65, 80, 90, 55, 17, 18, 75, 66, 54, 67, 59, 62, 60, 36,
> 83, 54, 70, 59, 42, 49, 46, 37, 57, 69, 47, 56, 45, 46, 45, 60,
> 66, 83, 65, 20, 61, 34, 57, 73, 34, 39, 63, 42, 39, 57, 35, 34,
> 42, 60, 59, 41, 34, 27, 56, 44, 47, 32, 69, 46, 61, 31, 35, 33,
> 57, 36, 80, 53, 60, 27, 37, 46, 50, 56, 75, 32, 46, 17, 42, 41,
> 22, 36, 59, 61, 34, 63, 20, 37, 46, 45, 56, 34, 38, 52, 43, 56,
> 24, 76, 40, 26, 75, 27, 26, 94, 45, 39, 75, 44, 64, 29, 30, 61,
> 61, 66, 39, 25, 32, 23, 73, 85, 33, 37, 27, 28, 60, 41, 18, 57,
> 43, 23, 66, 35, 73, 30, 25, 35, 37, 54, 45, 73, 66, 57, 26, 36,
> 27, 31, 51, 42, 30, 44), age = c(4, 2, 1, 1, 2, 2, 2, 4, 2, 1,
> 2, 1, 3, 1, 3, 2, 1, 2, 4, 2, 2, 1, 4, 4, 2, 1, 4, 2, 1, 1, 3,
> 3, 3, 1, 56, 57, 20, 46, 46, 53, 39, 34, 56, 29, 46, 46, 26,
> 30, 25, 51, 33, 39, 57, 29, 57, 21, 52, 56, 56, 58, 52, 34, 32,
> 23, 32, 44, 58, 50, 50, 39, 24, 58, 45, 23, 35, 6, 26, 59, 51,
> 22, 42, 30, 54, 38, 34, 54, 46, 59, 26, 54, 50, 46, 59, 42, 42,
> 52, 41, 29, 17, 59, 48, 51, 56, 32, 46, 53, 33, 52, 37, 38, 53,
> 58, 58, 21, 55, 55, 53, 51, 51, 36, 57, 59, 44, 36, 46, 47, 54,
> 28, 29, 28, 41, 59, 36, 11, 37, 54, 55, 57, 27, 51, 35, 44, 5,
> 59, 49, 41, 56, 49, 33, 38, 53, 38, 49, 54, 65, 63, 62, 67, 61,
> 68, 63, 61, 70, 62, 61, 69, 78, 66, 73, 62, 67, 68, 69, 61, 70,
> 64, 62, 66, 69, 67, 60, 65, 71, 64, 73, 71, 63, 69, 74, 69, 60,
> 68, 67, 70, 82, 76, 68, 63, 68, 65, 64, 68, 63, 71, 71, 62, 71,
> 72, 61, 78, 67, 70, 62, 73, 81, 67, 73, 73, 64, 60, 62, 66, 73,
> 73, 72, 62, 67, 62, 68, 74, 64, 84, 66, 66, 69, 67, 60, 62, 69,
> 67, 66, 61, 62, 80, 66, 65, 68, 70, 66, 78, 78, 80, 65, 68, 81,
> 77, 72, 61, 67, 85, 70, 71, 71, 67, 78, 65, 72, 61, 63, 64, 66,
> 61, 77, 65, 67, 66, 72, 69, 76, 77, 65, 68, 60, 66, 60, 63, 71,
> 68, 65, 65, 68, 65, 68, 70, 70)), .Names = c("incu", "infe",
> "age"), row.names = c("1", "2", "3", "4", "5", "6", "7", "8",
> "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
> "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41",
> "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52",
> "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63",
> "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74",
> "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85",
> "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96",
> "97", "98", "99", "100", "101", "102", "103", "104", "105", "106",
> "107", "108", "109", "110", "111", "112", "113", "114", "115",
> "116", "117", "118", "119", "120", "121", "122", "123", "124",
> "125", "126", "127", "128", "129", "130", "131", "132", "133",
> "134", "135", "136", "137", "138", "139", "140", "141", "142",
> "143", "144", "145", "146", "147", "148", "149", "150", "151",
> "152", "153", "154", "155", "156", "157", "158", "159", "160",
> "161", "162", "163", "164", "165", "166", "167", "168", "169",
> "170", "171", "172", "173", "174", "175", "176", "177", "178",
> "179", "180", "181", "182", "183", "184", "185", "186", "187",
> "188", "189", "190", "191", "192", "193", "194", "195", "196",
> "197", "198", "199", "200", "201", "202", "203", "204", "205",
> "206", "207", "208", "209", "210", "211", "212", "213", "214",
> "215", "216", "217", "218", "219", "220", "221", "222", "223",
> "224", "225", "226", "227", "228", "229", "230", "231", "232",
> "233", "234", "235", "236", "237", "238", "239", "240", "241",
> "242", "243", "244", "245", "246", "247", "248", "249", "250",
> "251", "252", "253", "254", "255", "256", "257", "258", "259",
> "260", "261", "262", "263", "264", "265", "266", "267", "268",
> "269", "270", "271", "272", "273", "274", "275", "276", "277",
> "278", "279", "280", "281", "282", "283", "284", "285", "286",
> "287", "288", "289", "290", "291", "292", "293", "294", "295"
> ), class = "data.frame")
>
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list