Is there a limit on a single line subset in a script

#Using RStudio on a M1 Mac running Sonoma 14.3.1

from a large df, I extract a subset when I type into my script this line and execute it:

dfsubset <- df[c("row1", "row2", ... "row435"), ]
#But adding one more row fails
dfsubset <- df[c("row1", "row2", ... "row435", "row436"), ]
#Even though I can create a second subset with the rows I wanted to add
dfsubset <- df[c("row436", "row437", ...), ]
#Is there some sort of strange limit on the length of a single line

Yes there are limits to the text that the console can consume at any give time

Thanks for the reply. I had the script window soft wrapping and the line that worked was 4094 characters. I did not get any error, it just acted like it could not find the rest of the line. As you implied simply adding a return did allow it to work. I am just surprised at the size of limit without an error warning. I can simply hit return in my scripts periodically.

Can this limit be adjusted? Or how about a warning as you are entering a single line in the script editor that the line length is getting too long?

This topic was automatically closed 42 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.