R styler addin: how to setup? - r

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?

Related

Switch from terminal style output to clickable output in Rmarkdown

I don't know the names for these things so I will attatche an image. Bassically I am used to being able to click through a dataframe inline on Rmarkdown. I just installed a freash version of R and Rstudio on my machine and the output looks like console output and it is not clickable. How do I change this?
This is what I would like
Note the ability to "thumb-through" the data by clicking "Previous" and "Next".
Thanks to #camille explanation, I tracked down the issue. It's a known bug in R v3.5 and an issue has been opened on github:
https://github.com/rstudio/rmarkdown/issues/1331

DataFrames not loading in RStudio Viewer

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.

The type or namespace name 'FaceBookClient' could not be found

None of the other questions regarding this question were able to answer this. I am new to programming, and I am just trying to add a FacebookLogin option to the website.
I built all the Javascript they wanted, and there is no error there(I don't think). In the interest of saving time, and that I am working on multiple computers. I am going to post pictures of all the code. I have added excess using statements to try and get the reference.
http://imgur.com/a/2wCyf
If you need anymore information let me know. And I will edit this page.
it looks like you just have some simple issues to fix in your IDE/project. The below instructions are for Visual Studio, but can be slightly altered for other IDEs.
First, make sure you have a reference to the Facebook SDK for .NET (I'm assuming you're using Outercurve's library from the looks of it):
In Visual Studio, check in the Solution Explorer window, then expand the "References", and make sure you see it there.
If it's not there, right-click "References", then "Manage Nuget Packages". When the Packages screen pops up, ensure in the left-pane that you have "Online -> nuget.org" selected. In the top right of the Packages window, in the "Search Online" textbox, enter:
facebook sdk and press "enter". On my screen, it's the second search result. To ensure you have the correct one, ensure that the "Created by" field says "Outercurve Foundation" before you accept it. Once you know you have the right package, hit the "Install" button, and it will be added to your project.
Once you have verified you have the correct reference, if you are still having the issue, make sure you have a "using" statement in your class file, to ensure library types you are using are recognized. In this example, I believe that would be:
using Facebook;
From the images of code you provided, I didn't see that statement in there, so that may be the problem, if this is fact the library you are referencing.
I am new to this type of application but what I found that is:
Use Facebook.FacebookClient instead of FacebookClient.

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.

Github syntax highlight style scheme for Gedit?

I like the syntax highlight style scheme used for R scripts in github and I would like to get it to my gedit editor. Where could I get it?
The easiest way to get R syntax highlighting in Gedit is the RGedit add-on: http://sourceforge.net/projects/rgedit/
RGedit also allows executing R code from within Gedit, which is very handy.
Here's a screenshot of how I have my RGedit set up. I use a custom color pallet but you could alter the color scheme to look more like Github:
The lower pane is the R session (black on white) and the upper pane is the text editor (color on black).
gedit doesn't seem to have much in "syntax highlighting plugins":
Smart Highlighting gedit
QuickHighlightMode
Both doesn't support easily any language definition.
Maybe another editor (like bluefish for instance) would be more appropriate.
It seems that both existing answers are outdated, although the RGedit plugin JD Long mentioned still works. It looks like the last update was from almost a year ago, and there might be some problems with the latest version of gedit; however, I installed the plugin and it seemed to work without following the instructions in the forum (I'm running on Xubuntu 14.04).
However, for syntax highlighting (like the OP requested) - you don't have to do anything special. Today Gedit comes with syntax highlighting for many languages out-of-the-box, and one of them is R. If it doesn't detect R automatically (based on mime type or extension) then you can manually set the syntax highlighting scheme by clicking on the file type on the bottom right of the screen, where it says plain text or by choosing View -> Highlight Mode from the menu.

Resources