DataFrames not loading in RStudio Viewer - r

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:
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

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.
This button pops them back to the 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.

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.

Related

R styler addin: how to setup?

I am using the R styler addin (https://github.com/r-lib/styler) to correct the coding style.
The illustration shown in the githib page shows a straighforward way to apply the style to the code.
Though, when I click the 'style active file" nothing happens.
I though that we would have to setup the styling function, but I am not able to do so.
Has anyone correctly use this addin before, that could hint on how to set it up correclty?

JavaFX - Nodes Whiting Out

Hi I have quite an unusual query. I have made a small JavaFX program and am very proud of the results. However I recently noticed a bug I can't seem to rap my head around. I can't recreate it either and do not have a screen shot of it unfortunately. However you can see a screenshot of the general program below in the state that triggered the problems.
I was running my program like normal and gave it quite a large load to handle (a lot of gradients as seen below). Then what happened was that in any TextField I typed in all edited text became a completely white rectangle and if I tried to update the image preview to the right it also turned white. If I let the program be in this white state for about ten seconds everything would load back in and behave like normal until I went to edit anything again.
It happened with any StyleSheet I loaded and as mentioned I cannot seem to recreate it. So my question is this. Is this a known error that can occur if you configure your scene in the wrong way (or something similar) or have I just managed to screw things up in general? The source code is quite long and I have absolutely no Idea where the problem may lie so I won't post any if you don't feel like a specific part may be interesting.
I am also aware that this type of general question is not really liked here so sorry about that. If you can suggest another more suitable forum I would be more than happy to move my question there.
//Thanks for any help.
EDIT: I finally managed to get a screen shot of the bug. I am not having high hopes that anyone is going to answer this though...

Efficiently get rid of all or some objects in RStudio Script pane

I open dataframes all the time in RStudio using View(df) or View(list) which pops open a window in my RStudio script pane as with MASTERstat1 MASTERextract and MASTERbackout1 in the image below:
Is there a way to close all the windows that are NOT SCRIPTS? I inevitably forget to close them and get a ton of them, and stuff gets cluttered.
It looks like it's not currently possible in RStudio, at least as of a month ago.
One sub-optimal workaround mentioned in this answer is to make sure your script tabs are saved and then to close all tabs using Ctrl+Shift+W.
My personal preferred method for closing a lot of unwanted tabs quickly is to use Ctrl+Tab/Ctrl+Shift+Tab for navigating between tabs and Ctrl+W for closing the current tab.
Edit: also potentially useful is Shift+Ctrl+Alt+W, which closes all but the current tab.

Adobe Extendscript Photoshop Guides Visibility

Is there a way via extendscript (jsx) to get the visibility status of Photoshop' guides?
The code to show and hide the guides is the same code as it 'toggles' the guides on or off so it must know the status when this code is executed, but how do I get at it?
I appreciate this could be done via a preference switch but that seems an awkward hack for something this simple, especially as something somewhere must be accessing this 'property' during execution of the 'toggle' code.
What would be great is to have activeDocument.guides.visible property, returning either true or false. Is there anything like that?
EDIT:
OK. Further investigation reveals that creating a guide using guides.add does not automatically toggle guides ON, however, using the code generated via the scriptListener does.
I would rather use guides.add as its only one line of code compared to fourteen so in order to toggle the guides to ON I thought I could run a function that created and then deleted a guide using the scriptListener code during the onLoad of the HTML.
This works great, except getting this function to run only when a document is opened is now the new problem.
documentAfterActivate is supposed to be the code to do this except it doesn't work unless a flash panel such as kuler is opened first.
So the question now is really what part of the flash code is allowing documentAfterActivate to work properly and how can I use it in my code instead of opening a flash panel I don't need?
It doesn't look like you've got a direct toggle option. You'd need to record the position of the guides somewhere and use script listener code to clear them when you wanted to toggle them off and use the add method on the Guides object to re-add them.
Keep in mind that even getting to the guide position via the photoshop DOM wasn't avail before CS4 I think? maybe CS5.
And i realised I just mis-read your question quite a bit. Anyway, this way you'd also know if the guides were visible based on whether or not they are there :) But yes, it isn't as nice as it could be.
The solution:
As stated, the workaround is to create and delete a guide with the fourteen lines of code from the scriptListener.
This toggles the guide visibility to ON regardless of its current state.
I can then save this status as a preference using putCustomOptions.
A function to do this is fired during the onLoad of the HTML but only when a document is opened otherwise guide creation fails.
documentAfterActivate does not work as expected unless a further flash panel (such as Kuler) is also opened beforehand.
An alternative to documentAfterActivate is to register the open event using CSevent instead.
The code can be found HERE.

How to dynamically load rows in enyo when using the Repeater kind?

I was able to add a load more section on the bottom row and successfully have a load more working using setCount. Except it reloads everything (as its suppose to) with no way of maintaining the state of where you were before load more was clicked. So I tried using renderRow, but that does not work because it only refreshes rows that already exists (in my case the rows to be loaded have not been loaded into memory yet). I don't see anything immediately useful in the docs. Anyone encountered this problem or have an idea of how to solve it. Thanks.
I'll try to update this answer with something more complete but what you need to do is find the index of the topmost row before you add your new content and then scroll that row back into view after you update. Something like that should do what you want. I think there were some discussions back on the old developer.palm.com forums from Enyo 1 days that discuss the technique. Should still be applicable to Enyo 2.

Resources