2

I realize that this isn't really a "coding" question per se, but I'm unsure where to direct this question otherwise. If it violates StackOverflow's rules, I'm happy to move it elsewhere.

Recently, when I View(df), the dataframe pops up as a separate window that looks like this:

Popup data frame

As opposed to displaying in the Viewer portal in the top panel of RStudio. Does anyone have any idea why this might be? I have a vague suspicion that it may be associated with the data.table package, though if so, I am unsure how to avoid this issue.

Thanks

elduderino260
  • 223
  • 3
  • 12
  • 1
    It's nothing to do with the `data.table` package and I suspect you actually used `View(df)`. Correct caps are important. – IRTFM Feb 15 '18 at 18:48
  • 1
    `utils::View(df)` versus rstudio `View` or something, probably. Rstudio writes its own `View` on top of the normal one. – Frank Feb 15 '18 at 19:10
  • 2
    What version of Rstudio are you using? What version of R? Show the exact code you are running or provide some sort of minimal [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) that you can run in a new R session that results in the undesired behavior. – MrFlick Feb 15 '18 at 19:44
  • @Frank, is there any way to have the RStudio View be the preferred function? – elduderino260 Feb 15 '18 at 20:37
  • Hm, actually RStudio View already *is* the default. Without a reproducible example, I guess we'll have trouble figuring it out. You could also try https://community.rstudio.com/faq – Frank Feb 15 '18 at 20:53
  • Thanks for the tip. I am having trouble figuring out how to even make a reproducible example. I tried it out on a separate machine and it worked fine, suggesting that it's something due to the options in this particular Markdown file or my computer... – elduderino260 Feb 15 '18 at 20:59

2 Answers2

3

I am not sure if you are aware, but there is a small button that can pop dataframes into and out of the normal panel. This button pops them out of the normal panel.

Pop DataFrame out of picture

This button pops them back to the normal panel

Pop DataFame back into normal panel

What may have happened is you popped the dataframe out of the normal panel, and you have the toolbar not visable. Check your View -> show/hide options to see if there is a toolbar hidden that contains this button.

Aaron left Stack Overflow
  • 36,704
  • 7
  • 77
  • 142
Ben Collier
  • 51
  • 1
  • 6
  • Unfortunately, that just pops it in/out of a separate RStudio window. This seems to be a different issue where the dataframe is not even necessarily displayed in Rstudio. I'm not sure I'm describing it properly, but your solution does not fix this particular issue. Thanks though. – elduderino260 Feb 15 '18 at 19:03
0

First of all, thanks for the question @elduderino260. I had the same problem for weeks and it was driving me crazy.

I was able to fix this based on Frank's comment above. It appears I had imported the utils package into my namespace, and the View() function in that package overrode the RStudio View() function. The utils package apparently has it's own viewer, which is that red and white thing in your screen shot.

So to fix this I removed the reference to utils (which I didn't need anyway), regenerated the documentation (which cleared it from the namespace), and restarted the project. Then everything worked properly.

David J. Bosak
  • 1,386
  • 12
  • 22