Using a MacBook Pro M3 Pro laptop with 36 GB of RAM, I tried to open a text file in the RStudio editor that consisted of one line of 1,000,000 characters. The application became completely unresponsive. After a Force Quit, I restarted the application but it returned to its previous unresponsive state. I was forced to delete the .Rdata and .Rproj files in the project folder to get RStudio to work.
I don't think this should happen. This text file opened without problems in Sublime Text.
Does the data look like this
123456
or like this
1, 2, 3, 4, 5, 6
1415926535, etc., the first one million digits of the decimal approximation of pi.
It's been years since I've been reading on this but if memory serves you may be exceeding the capacity of a single variable, though I would have thought it would simply give you an indeterminate result after about 15 numbers. That's about the accuracy we get in numeric storage in most computers today.
The data is numeric I assume?
Of course, it is possible it may just be your machine.
Can you post the data here or if it exceeds size limits post it somewhere where we can download it?
I was not reading in a variable. I was attempting to view a text file that consists of one million digits of pi in a single string. Other text editors have no difficulty with this task, but the RStudio editor crashed without an error message.
My machine has plenty of RAM, as I indicated in my original post. You can duplicate my data by generating one million digits of pi in your favorite program (I used Mathematica) and saving it as a text file. I can give you the Mathematica code if you want.
Were you trying to read the data in your example, for example something like this
XX <- read.csv("myfile.csv")
or just trying to use the *view" function ?
Other text editors have no difficulty with this task, but the RStudio editor crashed without an error message.
I think we need to see your numbers not something we generate. Computer setups are just different enough that there is no guarantee we can exactly duplicate the data exactly.
Technically RStudio is an IDE not a plain text editor. I do not think you can expect it to work in the same way.
I was working in the script editor, not the console. I attempted to open the file by double-clicking on its name in the Files window. The application stopped responding. The script editor is a text editor. This is a bug in the application, not an error on my part. The actual content of the file is irrelevant. What matters is that it is a single string of one million digits with no other characters. Other text editors can handle this. It may be a memory allocation issue in the application.
It is NOT a text editor.
Without seeing your data it is hard to even guess what is happening.
Okay, try this.
install.packages("data.table")
library(data.table)
fread("mydata.csv)
You don’t understand the issue with the script editor in RStudio. I can load the text file into R memory just fine using scan in the console. But when I tried to view the text file directly in the script editor, which is essentially a text editor, the program crashed. There is no R code involved. If I use R directly, not involving RStudio, and open the text file in a document window there is no issue. I don’t know how to make this clearer.
I just tried opening this file in a Positron window. No problems.
This actually does make things clearer.
Possibly you have found a bug.
Problem Reporting
You could file this as an issue on RStudio's GitHub repository Sign in to GitHub · GitHub
https://support.posit.co/hc/en-us/articles/360004788294-How-do-I-submit-a-Support-ticket