cancel
Showing results for 
Search instead for 
Did you mean: 

R script error when forecasting data. Could anyone let me know how to solve it?

Feedback Type:
Frown (Error)

Timestamp:
2022-08-05T11:28:39.1411266Z

Local Time:
2022-08-05T19:28:39.1411266+08:00

Session ID:
b39e5d60-708b-48ec-934e-2d7165e16364

Release:
July 2022

Product Version:
2.107.841.0 (22.07) (x64)

Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: R script error.
Loading required package: scales
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'scales'
2: In libraryRequireInstall("scales") :
*** The package: 'scales' was not installed ***
Loading required package: forecast
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'forecast'
2: In libraryRequireInstall("forecast") :
*** The package: 'forecast' was not installed ***
Loading required package: zoo
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'zoo'
2: In libraryRequireInstall("zoo") :
*** The package: 'zoo' was not installed ***
Loading required package: ggplot2
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'ggplot2'
2: In libraryRequireInstall("ggplot2") :
*** The package: 'ggplot2' was not installed ***
Loading required package: lubridate
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'lubridate'
2: In libraryRequireInstall("lubridate") :
*** The package: 'lubridate' was not installed ***
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: caTools
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'caTools'
2: In libraryRequireInstall("caTools") :
*** The package: 'caTools' was not installed ***
Loading required package: plotly
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'plotly'
2: In libraryRequireInstall("plotly") :
*** The package: 'plotly' was not installed ***
Loading required package: caTools
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'caTools'
2: In libraryRequireInstall("caTools") :
*** The package: 'caTools' was not installed ***
Error in ggplot() : could not find function "ggplot"
Execution halted
---> Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException: R script error.
Loading required package: scales
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'scales'
2: In libraryRequireInstall("scales") :
*** The package: 'scales' was not installed ***
Loading required package: forecast
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'forecast'
2: In libraryRequireInstall("forecast") :
*** The package: 'forecast' was not installed ***
Loading required package: zoo
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'zoo'
2: In libraryRequireInstall("zoo") :
*** The package: 'zoo' was not installed ***
Loading required package: ggplot2
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'ggplot2'
2: In libraryRequireInstall("ggplot2") :
*** The package: 'ggplot2' was not installed ***
Loading required package: lubridate
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'lubridate'
2: In libraryRequireInstall("lubridate") :
*** The package: 'lubridate' was not installed ***
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: caTools
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'caTools'
2: In libraryRequireInstall("caTools") :
*** The package: 'caTools' was not installed ***
Loading required package: plotly
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'plotly'
2: In libraryRequireInstall("plotly") :
*** The package: 'plotly' was not installed ***
Loading required package: caTools
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'caTools'
2: In libraryRequireInstall("caTools") :
*** The package: 'caTools' was not installed ***
Error in ggplot() : could not find function "ggplot"
Execution halted

at Microsoft.PowerBI.Scripting.R.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.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ExecuteDataQuery(IQueryResultDataWriter queryResultDataWriter, EngineDataModel engineDataModel, DataQuery query, Int32 queryId, ServiceErrorStatusCode& serviceErrorStatusCode, CancellationToken cancelToken)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, IList`1 queries, HashSet`1 pendingQueriesToCancel, EngineDataModel engineDataModel)

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

CLR Version:
4.8 or later [Release Number = 528449]

Peak Virtual Memory:
54.6 GB

Private Memory:
727 MB

Peak Working Set:
798 MB

IE Version:
11.1.22000.0

User ID:
05b14eeb-3b24-46fc-b76f-1f2043d2a565

Workbook Package Info:
1* - en-US, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: False.

Telemetry Enabled:
True

Model Default Mode:
Import

Model Version:
PowerBI_V3

Enabled Preview Features:
PBI_enableWebView2
PBI_mobileAuthoringFormattingUI
PBI_sparklines

Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_azureMapVisual
PBI_compositeModelsOverAS
PBI_enhancedTooltips
PQ_WebView2Connector
PBI_scorecardVisual
PBI_fieldParametersSuperSwitch

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
125%

Supported Services:
Power BI

Status: Investigating

Hi @Ryan_n,

 

According to the error message, it seems that you didn’t installed the package mentioned. Thus, you couldn’t use the function in the package.

*** The package: 'caTools' was not installed ***
Error in ggplot() : could not find function "ggplot"

 

Best Regards,                                                       

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Investigating

Hi @Ryan_n,

 

According to the error message, it seems that you didn’t installed the package mentioned. Thus, you couldn’t use the function in the package.

*** The package: 'caTools' was not installed ***
Error in ggplot() : could not find function "ggplot"

 

Best Regards,                                                       

Community Support Team _ Caiyun