I need help to resolve Fata error: unexpected exception: string too long

Whenever I open my R Project, it is keep on popping the statement"Fata error: unexpected exception: string too long" and I can't go beyond that.
I need an easy solution to this issue as I am still learning the basics of R.
I am using R studio version 4.3.0 (2023-04-21 ucrt) -- "Already Tomorrow"
R Program: version 4.3.0
Here is the script (its related to temperature and precipitation from 1991 to 2020:
install.packages("readr")
library("readr")
TP1 <- read_csv("E:/HUC/20-08/TP-1991_2020_PAK.csv")
View(TP1)
str(TP1)
dim(TP1)
head(TP1)
tail(TP1)
head(TP1$Temperature)
TP1$Rainfall - (MM)
Rainfall<-Rainfall - (MM)`

Thank you in advance for your help.

My advice:
Execute each line separately.
Then you can pinpoint where the error is.
After executing the install statement prefix the statement with a # to make it a comment: an install takes time and it needs to be done only once.
Be exact when you describe an error: are you sure you encounter a Fata error each time you open the project? Or is it when you try to run the script?

Thank you for your response. I encounter this issue whenever I open the project.

So then the script you mention is not relevant?

When you open a project, the code in the file .Rprofile in your project folder is executed.
Is there is no such file, the .Rprofilein your R home folder (~/.Rprofile) is used.
More than you would like to know can be found a.o. in startup-intro .

So check if these files do exist and if so check their contents.
Given the error "string to long" it could be that a string is not properly closed: an ending quote is omitted (?)

As a last remark: also in your last script statement " Rainfall<-Rainfall - (MM)` " I see a backtick that is not matched. However because you say that just opening the project causes the "string to long" message, this will not be the cause of the error.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.