0

I want to view data while running code because I seeing what is in the data table will affect inputs to my R code. Is this possible to view data in a different pane or better yet, as a floating window?

I can view in the console which could work, but if the data table has too many columns, I can't see them and there's no option to scroll....i think.

Phil
  • 7,287
  • 3
  • 36
  • 66
manavjn
  • 15
  • 4
  • In RStudio you can open up a new tab and then click the "Show in new window" icon (next to Filter at the top of the tab) to pop it out as a floating window that will update with the object. – Jon Spring Mar 13 '23 at 18:50
  • @JonSpring Is there a way to have it automatically Show in new window each time I run view(data) in that R Script specifically? Or is there a way to see the data viewer in the side pane, maybe under the "Viewer" tab (next to Plots and Packages, etc.)? Ultimately, my goal is to have a script to import files from Excel to SQL. I want to view the data in this viewer before it finishes import so i can change the variable types.....do you know if there is an easy way to alter the data types? It would be great if I could do it in the window viewer or similar. Not sure if that is possible though. – manavjn Mar 13 '23 at 19:09
  • Did you try `View(myData)` ? – G5W Mar 13 '23 at 19:09
  • @G5W yes, that opens in a new tab. I'd like to open that same window as a floating window OR in the "Viewer" pane immediately after executing the statement (preferably no clicks/manual intervention). – manavjn Mar 13 '23 at 19:16
  • 1
    Does this similar prior answer help? https://stackoverflow.com/questions/49062761/make-rs-view-open-in-a-new-window-automatically – Jon Spring Mar 13 '23 at 19:35
  • Maybe, but I think Im missing something. I tried this bit of code that the person in that link mentions, but it doesn't work for me (lines 45-59): Am i doing the wrong thing? It still opens view(data) in a new tab https://github.com/rstudio/rstudio/blob/779baf9ceb99b6d2455345bcbae3c4e57e164425/src/cpp/r/R/Options.R#L45 – manavjn Mar 13 '23 at 20:09
  • Are you saying to do this: utils::View(iris) or alterting the viewer options? The utils line kind of works but isnt ideal. It would be great if I could just preview the data in the viewer pane. Or just normal view(iris) and automatically open that window in a floating window. – manavjn Mar 15 '23 at 16:40

0 Answers0