You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RStudio Edition : Desktop
RStudio Version : RStudio 2023.12.1 Build 402
OS Version : Windows 10 Home (64-bit)
R Version : 4.3.1
Steps to reproduce the problem
open the R script in the attachement in R studio
observe that it cannot run line 62 (data$aaicdcode.factor..) because it it too long
try to edit line 62 by adding a newline after the comma at "2774", (near line position 2000)
observe that the line now ends with .."2774"," instead of .."2774",
Or more obviously:
move the cursor to "4019", (near line position 5000)
try to place cursor and change the text to "40x19",
observe that the x is placed in a differnt location, most likely "4019x", or "4019"x,
Describe the problem in detail
We work with REDCap for data collection and Rstudio for data analysis. When exporting the data from REDCap it results in a csv file and an accompanying R script. For various reasons the generated R script can contain very long lines, like >4000 characters. These scripts cannot be executed as-is due to the long lines and Rstudio gives an error message which, if I understand correctly, is due to the console line limit (default=1000 lines).
It might be some other R or Rstudio setting, but in any case the work-around is to manually add new-lines, so break up the line with enter/return so that the lines don't exceed 4000 characters, and then the script can be executed correctly and without errors.
However, while editing these script files in Rstudio we noticed that on long lines as the cursor position increases on the line, it slowly shifts a few pixels to left of its actual position. For example this "cursor drift" is noticable when moving the cursor to .."7300", to after the comma and then pressing enter. The result is that the line now ends in .."7300","74 instead of .."7300",.
Or for example when setting the cursor before the 5 at "345000" and then pressing the a key. The result will be "3450a00" so it's inserted 2 characters to the right instead of where the visual cursor position. This is causing our researchers trouble when trying to run and edit these generated files.
fyi the separate but related issue of "scripts won't execute very long lines properly" when running lines with >4000 characters was addressed #14428 i.e. give a proper error/warning message when truncating lines, instead of incompletely parsing a line and then "failing silently" resulting in unrelated errors in subsequent code.
System details
Steps to reproduce the problem
data$aaicdcode.factor..
) because it it too long"2774",
(near line position 2000).."2774","
instead of.."2774",
Or more obviously:
"4019",
(near line position 5000)"40x19",
x
is placed in a differnt location, most likely"4019x",
or"4019"x,
Describe the problem in detail
We work with REDCap for data collection and Rstudio for data analysis. When exporting the data from REDCap it results in a csv file and an accompanying R script. For various reasons the generated R script can contain very long lines, like >4000 characters. These scripts cannot be executed as-is due to the long lines and Rstudio gives an error message which, if I understand correctly, is due to the console line limit (default=1000 lines).
It might be some other R or Rstudio setting, but in any case the work-around is to manually add new-lines, so break up the line with enter/return so that the lines don't exceed 4000 characters, and then the script can be executed correctly and without errors.
However, while editing these script files in Rstudio we noticed that on long lines as the cursor position increases on the line, it slowly shifts a few pixels to left of its actual position. For example this "cursor drift" is noticable when moving the cursor to
.."7300",
to after the comma and then pressing enter. The result is that the line now ends in.."7300","74
instead of.."7300",
.Or for example when setting the cursor before the
5
at"345000"
and then pressing thea
key. The result will be"3450a00"
so it's inserted 2 characters to the right instead of where the visual cursor position. This is causing our researchers trouble when trying to run and edit these generated files.See screenshots below, and I've included the generated script in the attachment.
CardioStudy-AnnualReport2024_R_2024-03-21_1324.txt <- rename to
.R
scriptDescribe the behavior you expected
I expected the cursor to edit the code at place it is visible, instead of off-by-X characters.
The text was updated successfully, but these errors were encountered: