With Power BI Desktop, you can use your external R IDE (Integrated Development Environment) to create and refine R scripts, then use those scripts in Power BI.
Previously, you had to use the R script editor in Power BI Desktop to create and run R scripts. With this release, you can launch your external R IDE from Power BI Desktop and have your data automatically imported and displayed in the R IDE. From there, you can modify the script in that external R IDE, then paste it back into Power BI Desktop to create Power BI visuals and reports.
Beginning with the September 2016 release of Power BI Desktop (version 2.39.4526.362), you can specify which R IDE you would like to use, and have it launch automatically from within Power BI Desktop.
To use this feature, you need to install an R IDE on your local computer. Power BI Desktop does not include, deploy or install the R engine, so you must separately install R on your local computer. You can choose which R IDE to use, with the following options:
You can also install a different R IDE and have Power BI Desktop launch that R IDE by doing one of the following:
You can specify the .exe that Power BI Desktop should launch by selecting Other from the R Script Options section of the Options dialog. You can bring up the Options dialog by going to File > Options and settings > Options.
If you have multiple R IDEs installed, you can specify which will be launched by selecting it from the Detected R IDEs drop-down in the Options dialog.
By default, Power BI Desktop will launch R Studio as the external R IDE if it's installed on your local computer; if R Studio is not installed and you have Visual Studio 2015 with R Tools for Visual Studio, that will be launched instead. If neither of those R IDEs is installed, the application associated with .R files is launched.
And if no .R file association exists, it's possible to specify a path to a custom IDE in the Browse to your preferred R IDE section of the Options dialog. You can also launch a different R IDE by selecting the Settings gear icon beside the Launch R IDE arrow icon, in Power BI Desktop.
To launch an R IDE from Power BI Desktop, take the following steps.
Load data into Power BI Desktop.
Select some fields from the Fields pane that you want to work with. If you haven't enabled script visuals yet, you'll be prompted to do so.
Note: The default aggregation type for R visuals is do not summarize.
Note: Power BI Desktop adds the first three lines of the script so it can import your data from Power BI Desktop once you run the script.
Launching an R IDE directly from Power BI Desktop has a few limitations:
Automatically exporting your script from your R IDE into Power BI Desktop is not supported.
R Client editor (RGui.exe) is not supported, because the editor itself does not support opening files.
Take a look at the following additional information about R in Power BI.