Forum Discussion

dean's avatar
dean
Regular Visitor
9 years ago
Solved

cannot use custom visual with R.

I already install R 3-2.0 and Rstudio and setting my R Scripting at powerBI but when i use custom visual which need R i get this error, how to solve this problem?

i want to try using custom visual Clustering K means

 

Feedback Type:
Frown (Error)

Timestamp:
2017-07-28T04:02:54.8672061Z

Local Time:
2017-07-28T11:02:54.8672061+07:00

Product Version:
2.48.4792.721 (PBIDesktop) (x64)

Release:
July 2017

IE Version:
11.483.15063.0

OS Version:
Microsoft Windows NT 10.0.15063.0 (x64 en-US)

CLR Version:
4.6.2. or later [Release Number = 460798]

Workbook Package Info:
1* - id-ID, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.

Peak Working Set:
449 MB

Private Memory:
324 MB

Peak Virtual Memory:
33.9 GB

Error Message:
R script error.
Loading required package: XML
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'XML'
2: In libraryRequireInstall("XML") :
*** The package: 'XML' was not installed ***
Loading required package: htmlwidgets
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'htmlwidgets'
2: In libraryRequireInstall("htmlwidgets") :
*** The package: 'htmlwidgets' was not installed ***
Loading required package: nloptr
Loading required package: seriation
Loading required package: NbClust
Loading required package: cluster
Loading required package: car
Loading required package: scales
Loading required package: fpc
Loading required package: mclust
Loading required package: apcluster
Loading required package: vegan
Loading required package: Redmonder
Loading required package: ggplot2
Loading required package: plotly
Loading required package: ggplot2
Error: could not find function "ggplot"
Execution halted


User ID:
69cc8715-c05c-40f0-a6c7-2dcc30e3b6df

Session ID:
28a151aa-7f6c-4296-bf40-89ccc9361122

Telemetry Enabled:
True

Model Default Mode:
Import

Snapshot Trace Logs:
C:\Users\User\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot500869229.zip

Performance Trace Logs:
C:\Users\User\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip

Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_EnableReportTheme
PBI_numericSlicerEnabled
PBI_SpanishLinguisticsEnabled
PBI_PbiServiceLiveConnect
PBI_daxTemplatesEnabled
CustomConnectors

Disabled DirectQuery Options:
PBI_DirectQuery_Unrestricted

Cloud:
GlobalCloud

Activity ID:
null

Time:
Fri Jul 28 2017 11:02:48 GMT+0700 (SE Asia Standard Time)

Client Error Code:
ServiceErrorToClientError

Error Details:
R script error.
Loading required package: XML
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'XML'
2: In libraryRequireInstall("XML") :
*** The package: 'XML' was not installed ***
Loading required package: htmlwidgets
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'htmlwidgets'
2: In libraryRequireInstall("htmlwidgets") :
*** The package: 'htmlwidgets' was not installed ***
Loading required package: nloptr
Loading required package: seriation
Loading required package: NbClust
Loading required package: cluster
Loading required package: car
Loading required package: scales
Loading required package: fpc
Loading required package: mclust
Loading required package: apcluster
Loading required package: vegan
Loading required package: Redmonder
Loading required package: ggplot2
Loading required package: plotly
Loading required package: ggplot2
Error: could not find function "ggplot"
Execution halted


Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: R script error.
Loading required package: XML
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'XML'
2: In libraryRequireInstall("XML") :
*** The package: 'XML' was not installed ***
Loading required package: htmlwidgets
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'htmlwidgets'
2: In libraryRequireInstall("htmlwidgets") :
*** The package: 'htmlwidgets' was not installed ***
Loading required package: nloptr
Loading required package: seriation
Loading required package: NbClust
Loading required package: cluster
Loading required package: car
Loading required package: scales
Loading required package: fpc
Loading required package: mclust
Loading required package: apcluster
Loading required package: vegan
Loading required package: Redmonder
Loading required package: ggplot2
Loading required package: plotly
Loading required package: ggplot2
Error: could not find function "ggplot"
Execution halted
---> Microsoft.PowerBI.Radio.RScriptRuntimeException: R script error.
Loading required package: XML
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'XML'
2: In libraryRequireInstall("XML") :
*** The package: 'XML' was not installed ***
Loading required package: htmlwidgets
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'htmlwidgets'
2: In libraryRequireInstall("htmlwidgets") :
*** The package: 'htmlwidgets' was not installed ***
Loading required package: nloptr
Loading required package: seriation
Loading required package: NbClust
Loading required package: cluster
Loading required package: car
Loading required package: scales
Loading required package: fpc
Loading required package: mclust
Loading required package: apcluster
Loading required package: vegan
Loading required package: Redmonder
Loading required package: ggplot2
Loading required package: plotly
Loading required package: ggplot2
Error: could not find function "ggplot"
Execution halted

at Microsoft.PowerBI.Radio.RScriptWrapper.RunScript(String originalScript, Int32 timeoutMs)
at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
--- End of inner exception stack trace ---
at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, String dataShapeId, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteDataQuery(IQueryResultDataWriter queryResultDataWriter, DataShapeGenerationContext dsqGenContext, EntityDataModel model, DataQuery query, ServiceErrorStatusCode& serviceErrorStatusCode)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, ExecuteSemanticQueryRequest request, IConceptualSchema conceptualSchema, EntityDataModel model)

DPI Scale:
100%

Supported Services:
Power BI

Formulas:


section Section1;

shared #"2014-2016" = let
Source = Excel.Workbook(File.Contents("D:\Skripsi\TMC Polda Metro Jaya 2014-2016\----DATA FIX CLEAR 2014-2016\DATA KECELAKAAN TWITTER 2014 -2016 FIX -2.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"date", type datetime}, {"retweets", Int64.Type}, {"favorites", Int64.Type}, {"text", type text}, {"waktu", type datetime}, {"Place", type text}, {"City", type text}, {"Jenis Kendaraan", type text}}),
#"Removed Duplicates" = Table.Distinct(#"Changed Type", {"text"})
in
#"Removed Duplicates";

shared #"2014" = let
Source = Excel.Workbook(File.Contents("D:\Skripsi\TMC Polda Metro Jaya 2014-2016\----DATA FIX CLEAR 2014-2016\DATA KECELAKAAN TWITTER 2014 FIX -2.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"date", type datetime}, {"retweets", Int64.Type}, {"favorites", Int64.Type}, {"text", type text}, {"waktu", type datetime}, {"Place", type text}, {"City", type text}, {"Jenis Kendaraan", type text}}),
#"Removed Duplicates" = Table.Distinct(#"Changed Type", {"text"})
in
#"Removed Duplicates";

shared #"2015" = let
Source = Excel.Workbook(File.Contents("D:\Skripsi\TMC Polda Metro Jaya 2014-2016\----DATA FIX CLEAR 2014-2016\DATA KECELAKAAN TWITTER 2015 FIX - 2.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"date", type datetime}, {"retweets", Int64.Type}, {"favorites", Int64.Type}, {"text", type text}, {"waktu", type datetime}, {"Place", type text}, {"City", type text}, {"Jenis Kendaraan", type text}}),
#"Removed Duplicates" = Table.Distinct(#"Changed Type", {"text"})
in
#"Removed Duplicates";

shared #"2016" = let
Source = Excel.Workbook(File.Contents("D:\Skripsi\TMC Polda Metro Jaya 2014-2016\----DATA FIX CLEAR 2014-2016\DATA KECELAKAAN TWITTER 2016 FIX -2.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"date", type datetime}, {"retweets", Int64.Type}, {"favorites", Int64.Type}, {"text", type text}, {"waktu", type datetime}, {"Place", type text}, {"City", type text}, {"Jenis Kendaraan", type text}}),
#"Removed Duplicates" = Table.Distinct(#"Changed Type", {"text"})
in
#"Removed Duplicates"

 

This is the eror screenshot :

  • Hi dean,

     

    Please update the R version to supported version R 3.3.1, R 3.3.0, MRO 3.3.1, MRO 3.3.0, MRO 3.2.2 then test again.

     

    If issue persists, please enable desktop trace log, repeat steps until error occurs, share trace log files with us.

     

    Best Regards,

    Qiuyun Yu 

16 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Community Support

    Hi dean,

     

    From this article, Clustering custom visual supports R versions:  R 3.3.1, R 3.3.0, MRO 3.3.1, MRO 3.3.0, MRO 3.2.2. Please try to update the R version to supported version. Also to enable this R powered visual, we need to install R packages: nloptr, seriation, pbkrtest,NbClust, cluster, car, scales, fpc, mclust, apcluster, vegan.

     

    Based on my test, download the sample from here can work fine. You can try to run the same R version as ours as well to test it.

     

     

    Best Regards,
    QiuyunYu

     

     

    • dean's avatar
      dean
      Regular Visitor

      thanks v-qiuyu-msft i already try to install package in R:

      nloptr, seriation, pbkrtest,NbClust, cluster, car, scales, fpc, mclust, apcluster, vegan

       

      but i still get this error? do i still need install some package or change r version?

      i think this is the main/only error i attached the picture:

       

       

       this is the full eror details :

       

       

       

      Feedback Type:
      Frown (Error)

      Timestamp:
      2017-08-02T09:06:33.7194602Z

      Local Time:
      2017-08-02T16:06:33.7194602+07:00

      Product Version:
      2.48.4792.721 (PBIDesktop) (x64)

      Release:
      July 2017

      IE Version:
      11.483.15063.0

      OS Version:
      Microsoft Windows NT 10.0.15063.0 (x64 en-US)

      CLR Version:
      4.6.2. or later [Release Number = 460798]

      Workbook Package Info:
      1* - id-ID, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.

      Peak Working Set:
      378 MB

      Private Memory:
      270 MB

      Peak Virtual Memory:
      33.9 GB

      Error Message:
      R script error.
      Loading required package: XML
      Loading required package: methods
      Loading required package: htmlwidgets
      Loading required package: nloptr
      Loading required package: seriation
      Loading required package: NbClust
      Loading required package: cluster
      Loading required package: car
      Loading required package: scales
      Loading required package: fpc
      Loading required package: mclust
      Package 'mclust' version 5.3
      Type 'citation("mclust")' for citing this R package in publications.
      Loading required package: apcluster

      Attaching package: 'apcluster'

      The following object is masked from 'package:stats':

      heatmap

      Loading required package: vegan
      Loading required package: permute

      Attaching package: 'permute'

      The following object is masked from 'package:seriation':

      permute

      Loading required package: lattice

      Attaching package: 'lattice'

      The following object is masked from 'package:seriation':

      panel.lines

      This is vegan 2.4-3
      Loading required package: Redmonder
      Loading required package: ggplot2
      Loading required package: plotly
      Error in redmonder.pal(n, "qPBI") :
      could not find function "redmonder.pal"
      Calls: myPallete
      Execution halted


      User ID:
      69cc8715-c05c-40f0-a6c7-2dcc30e3b6df

      Session ID:
      07f2eebe-eb12-4db9-b9e2-e93700315866

      Telemetry Enabled:
      True

      Model Default Mode:
      Import

      Snapshot Trace Logs:
      C:\Users\User\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot585989286.zip

      Performance Trace Logs:
      C:\Users\User\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip

      Disabled Preview Features:
      PBI_shapeMapVisualEnabled
      PBI_EnableReportTheme
      PBI_numericSlicerEnabled
      PBI_SpanishLinguisticsEnabled
      PBI_PbiServiceLiveConnect
      PBI_daxTemplatesEnabled
      CustomConnectors

      Disabled DirectQuery Options:
      PBI_DirectQuery_Unrestricted

      Cloud:
      GlobalCloud

      Activity ID:
      null

      Time:
      Wed Aug 02 2017 16:06:31 GMT+0700 (SE Asia Standard Time)

      Client Error Code:
      ServiceErrorToClientError

      Error Details:
      R script error.
      Loading required package: XML
      Loading required package: methods
      Loading required package: htmlwidgets
      Loading required package: nloptr
      Loading required package: seriation
      Loading required package: NbClust
      Loading required package: cluster
      Loading required package: car
      Loading required package: scales
      Loading required package: fpc
      Loading required package: mclust
      Package 'mclust' version 5.3
      Type 'citation("mclust")' for citing this R package in publications.
      Loading required package: apcluster

      Attaching package: 'apcluster'

      The following object is masked from 'package:stats':

      heatmap

      Loading required package: vegan
      Loading required package: permute

      Attaching package: 'permute'

      The following object is masked from 'package:seriation':

      permute

      Loading required package: lattice

      Attaching package: 'lattice'

      The following object is masked from 'package:seriation':

      panel.lines

      This is vegan 2.4-3
      Loading required package: Redmonder
      Loading required package: ggplot2
      Loading required package: plotly
      Error in redmonder.pal(n, "qPBI") :
      could not find function "redmonder.pal"
      Calls: myPallete
      Execution halted


      Stack Trace:
      Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: R script error.
      Loading required package: XML
      Loading required package: methods
      Loading required package: htmlwidgets
      Loading required package: nloptr
      Loading required package: seriation
      Loading required package: NbClust
      Loading required package: cluster
      Loading required package: car
      Loading required package: scales
      Loading required package: fpc
      Loading required package: mclust
      Package 'mclust' version 5.3
      Type 'citation("mclust")' for citing this R package in publications.
      Loading required package: apcluster

      Attaching package: 'apcluster'

      The following object is masked from 'package:stats':

      heatmap

      Loading required package: vegan
      Loading required package: permute

      Attaching package: 'permute'

      The following object is masked from 'package:seriation':

      permute

      Loading required package: lattice

      Attaching package: 'lattice'

      The following object is masked from 'package:seriation':

      panel.lines

      This is vegan 2.4-3
      Loading required package: Redmonder
      Loading required package: ggplot2
      Loading required package: plotly
      Error in redmonder.pal(n, "qPBI") :
      could not find function "redmonder.pal"
      Calls: myPallete
      Execution halted
      ---> Microsoft.PowerBI.Radio.RScriptRuntimeException: R script error.
      Loading required package: XML
      Loading required package: methods
      Loading required package: htmlwidgets
      Loading required package: nloptr
      Loading required package: seriation
      Loading required package: NbClust
      Loading required package: cluster
      Loading required package: car
      Loading required package: scales
      Loading required package: fpc
      Loading required package: mclust
      Package 'mclust' version 5.3
      Type 'citation("mclust")' for citing this R package in publications.
      Loading required package: apcluster

      Attaching package: 'apcluster'

      The following object is masked from 'package:stats':

      heatmap

      Loading required package: vegan
      Loading required package: permute

      Attaching package: 'permute'

      The following object is masked from 'package:seriation':

      permute

      Loading required package: lattice

      Attaching package: 'lattice'

      The following object is masked from 'package:seriation':

      panel.lines

      This is vegan 2.4-3
      Loading required package: Redmonder
      Loading required package: ggplot2
      Loading required package: plotly
      Error in redmonder.pal(n, "qPBI") :
      could not find function "redmonder.pal"
      Calls: myPallete
      Execution halted

      at Microsoft.PowerBI.Radio.RScriptWrapper.RunScript(String originalScript, Int32 timeoutMs)
      at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
      --- End of inner exception stack trace ---
      at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
      at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
      at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
      at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, String dataShapeId, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
      at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteDataQuery(IQueryResultDataWriter queryResultDataWriter, DataShapeGenerationContext dsqGenContext, EntityDataModel model, DataQuery query, ServiceErrorStatusCode& serviceErrorStatusCode)
      at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, ExecuteSemanticQueryRequest request, IConceptualSchema conceptualSchema, EntityDataModel model)

      DPI Scale:
      100%

      Supported Services:
      Power BI

      Formulas:


      section Section1;

      shared Sheet1 = let
      Source = Excel.Workbook(File.Contents("D:\Skripsi\TMC Polda Metro Jaya 2014-2016\----DATA FIX CLEAR 2014-2016\DATA KECELAKAAN TWITTER 2014 -2016 FIX -2(untuk k-means).xlsx"), null, true),
      Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
      #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
      #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"date", type datetime}, {"text", type text}, {"waktu", type datetime}, {"Waktu", type text}, {"City", type text}, {"Jenis Kendaraan", type text}, {"Vektor JK", Int64.Type}, {"Vektor Waktu", Int64.Type}, {"Vektor JBDTBK", Int64.Type}}),
      #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Waktu", "Waktu.1"}}),
      #"Removed Duplicates" = Table.Distinct(#"Renamed Columns", {"text"})
      in
      #"Removed Duplicates";

       

      • v-qiuyu-msft's avatar
        v-qiuyu-msft
        Community Support

        Hi dean,

         

        Please update the R version to supported version R 3.3.1, R 3.3.0, MRO 3.3.1, MRO 3.3.0, MRO 3.2.2 then test again.

         

        If issue persists, please enable desktop trace log, repeat steps until error occurs, share trace log files with us.

         

        Best Regards,

        Qiuyun Yu 

  • hi, I tried installing the packages shown in the error. However, I am continuously getting the error for the package "htmlwidgets". Is there any special instructions to install this package? I am stuck with this package only. All other packages got installed. Kindly help. 

    Thank you,

    Bharath

  • Hi All,

     

     

    I too got this error when trying to run a number of imported Analytical Visualisations in Power BI. It turned out to be a permissions issue. As soon as I began to run Power BI desktop in "Windows Administrator Mode" my visualisation began to work as normal.

     

    I hope this helps....

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Error Message:
    R script error.
    Loading required package: XML
    Loading required package: methods
    Warning message:
    package 'XML' was built under R version 3.3.3
    Loading required package: htmlwidgets
    Warning message:
    package 'htmlwidgets' was built under R version 3.3.3
    Loading required package: ggplot2
    Error in inDL(x, as.logical(local), as.logical(now), ...) :
      unable to load shared object 'C:/Users/Atulp/Library/rlang/libs/x64/rlang.dll':
      LoadLibrary failure:  The specified procedure could not be found.