Rstudio opens multiple tabs, inconsistent behavior

Similar to this topic (Possible bug? RStudio opens multiple tabs).

Rstudio open multiple tabs (calling View(), without the script calling View()) with inconsistent behavior.
How I can best describe the behavior:

  1. Usually does not happen with "Restart R and Run all Chunks". If this does happen it spams with so many tabs it can freeze windows for a couple min.
  2. Most often happens when I highlight a few lines then use Ctrl+Enter
  3. Once the behavior starts it is very consistent until I close/restart R or Rstudio
  4. One line of script can open multiple tabs
  5. I have only seen this behavior from running code in the script, not from the console.

I have used the link's suggested debugonce(View), this is displayed in the screen shots below:

  1. entered debugonce(View)
  2. highlighted and Ctrl+Enter the following:
    thisplot$Question = factor(thisplot$Question, levels = c('Office hours/meetings with my instructor',
    'Group activities',
    'Peer teachers/tutors',
    'Hands-on engagement with content',
    'Audio',
    'Discussions',
    'Recorded lectures',
    'Class handouts',
    'Collaborative/shared documents',
    'E-textbooks or required readings',
    'Video',
    'Quizzes',
    'Presentation slides',
    'Study guides',
    'Exams',
    'Class/lecture notes',
    'Homework assignments'))

3)Debug opened this:

  1. if I click Continue I get 8 new tabs of thisplot:

I am using:
"Cherry Blossom" Release (3c53477a, 2023-03-09) for Windows
R version 4.2.3 (2023-03-15 ucrt) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

Packages loaded:
library(plyr)
library(dplyr)
library(ggplot2)
library(knitr)
library(kableExtra)
library(tidyr)
library(nlme)
library(tidyverse)
library(psych)
library(RColorBrewer)
library(pracma)
library(formattable)
library(data.table)
library(readxl)
library(PerformanceAnalytics)
library(stringr)
library(forcats)

One more note, I have found that during a session, if I never use View() or call it through clicking on the data.table name in the environment window, it does not spam open tabs. However, there have been occasions when I start a fresh session (first of the day) and it spam opens View(). This is rare.
Also, is there a possible work around to rename the View() function to try prohibit it being called?

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