Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long strings work in R, but not R Studio #4768

Closed
ghost opened this issue May 7, 2019 · 4 comments
Closed

Long strings work in R, but not R Studio #4768

ghost opened this issue May 7, 2019 · 4 comments

Comments

@ghost
Copy link

@ghost ghost commented May 7, 2019

RStudio Edition : Preview
RStudio Version : 1.2.1335
OS Version      : Windows 7 Pro
R Version       : 3.5.3

I can paste the following string into R 3.5.3 (the vanilla version in my Start menu) and I get the expected output. If I paste the same thing into my R Studio console the console drops to a + expecting more. I've entered ) thinking I may have copy/pasted wrong but it keeps dropping me to +, no matter what I enter.

c("Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Yellow Pear", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Tropical Banana", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Farm Fresh Strawberries", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Melon Mango", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Dragonfruit", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Peaches", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Blueberry", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Orange Tangerine", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Red Delicious Apples", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Grapes", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Cherry", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Green Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Yellow Apples", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Perfect Punchy Pineapple", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Watermelon", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Red Raspberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Blackberry", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Avocado", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Cherimoya Custard Apple", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Nectarine", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Plum Prune Pineapple", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Pomegranate", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry", "Surinam Cherry")
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices
[4] utils     datasets  methods  
[7] base     

other attached packages:
[1] forcats_0.4.0   stringr_1.4.0  
[3] dplyr_0.8.0.1   purrr_0.3.2    
[5] readr_1.3.1     tidyr_0.8.3    
[7] tibble_2.1.1    ggplot2_3.1.1  
[9] tidyverse_1.2.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1       cellranger_1.1.0
 [3] pillar_1.3.1     compiler_3.5.3  
 [5] plyr_1.8.4       tools_3.5.3     
 [7] packrat_0.5.0    jsonlite_1.6    
 [9] lubridate_1.7.4  gtable_0.3.0    
[11] nlme_3.1-137     lattice_0.20-38 
[13] pkgconfig_2.0.2  rlang_0.3.4     
[15] cli_1.1.0        rstudioapi_0.10 
[17] haven_2.1.0      withr_2.1.2     
[19] xml2_1.2.0       httr_1.4.0      
[21] generics_0.0.2   hms_0.4.2       
[23] grid_3.5.3       tidyselect_0.2.5
[25] glue_1.3.1       R6_2.4.0        
[27] readxl_1.3.1     modelr_0.1.4    
[29] magrittr_1.5     backports_1.1.4 
[31] scales_1.0.0     rvest_0.3.3     
[33] assertthat_0.2.1 colorspace_1.4-1
[35] stringi_1.4.3    lazyeval_0.2.2  
[37] munsell_0.5.0    broom_0.5.2     
[39] crayon_1.3.4   
@ronblum
Copy link
Contributor

@ronblum ronblum commented May 7, 2019

@jhuntergit Thanks for reporting this! I was able to reproduce this on MacOS 10.14, as well, on both RStudio Desktop 1.1.463 and 1.2.1335. We'll check it out as we work on future development of RStudio.

Also, confirmed that it's not the number of records by using the same number of records but with single-character strings:

c("1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "3", "4", "4", "4", "4", "4", "4", "4", "4", "4", "4", "4", "4", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "5", "6", "6", "6", "6", "6", "6", "6", "6", "6", "6", "6", "6", "7", "7", "7", "7", "7", "7", "7", "7", "7", "7", "7", "7", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "8", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "9", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c", "d", "d", "d", "d", "d", "d", "d", "d", "d", "d", "d", "d", "e", "e", "e", "e", "e", "e", "e", "e", "e", "e", "e", "e", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "g", "g", "g", "g", "g", "g", "g", "g", "g", "g", "g", "g", "h", "h", "h", "h", "h", "h", "h", "h", "h", "h", "h", "h", "i", "i", "i", "i", "i", "i", "i", "i", "i", "i", "i", "i", "j", "j", "j", "j", "j", "j", "j", "j", "j", "j", "j", "j", "k", "k", "k", "k", "k", "k", "k", "k", "k", "k", "k", "k", "l", "l", "l", "l", "l", "l", "l", "l", "l", "l", "l", "l", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "n", "n", "n", "n", "n", "n", "n", "n", "n", "n", "n", "n")

@calpan
Copy link

@calpan calpan commented May 7, 2019

On my system (RStudio Desktop 1.2.1511 x64, Windows 10), this is reproducible with any expression of 4095 or more characters.

@Farbfetzen
Copy link

@Farbfetzen Farbfetzen commented May 9, 2019

To expand on calpans comment: I have a function definition which spans 150 lines. If I place the cursor in the first line where the word "function" is and then ctrl + enter, this bug happens. And yes, I know I should break the function into smaller units, but that's hard to do in my specific case.

RStudio desktop 1.2.1335
R 3.5.3
Windows 10

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Jul 22, 2019

This is as documented: in R, the maximum length of any line that can be submitted to the console is 4095 bytes.

https://cran.r-project.org/doc/manuals/R-intro.html#R-commands_003b-case-sensitivity-etc

@ronblum ronblum added external and removed bug labels Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants