Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AlexDantin
Helper I
Helper I

Error when Refreshing R Script Data

loading an SPSS .sav file using the following script found elsewhere in this community - loading spss data with R

 

let
Source = R.Execute("library (RevoScaleR)#(lf)spssFile <- file.path(""\\file path\\.sav"");
#(lf)tempFile <- ""\\file path\\temp.xdf"";
#(lf)tempData <- rxImport(inData = spssFile, outFile = tempFile, overwrite=TRUE);
#(lf)spssData <- rxFactors(inData=tempData, sortLevels=TRUE,factorInfo=c(""rwkrsonea""));"),
spssData1 = Source{[Name="spssData"]}[Value]
in
spssData1

 

the initial load is fine and i am able to manipulate the data in power query. however, if I close and re-open the file, I am no longer able to refresh or edit the powerquery script (to eliminate uneeded columns, alter data-types etc)

 

I get the following error - nothing about the source file or any other data has changed.

 

DataSource.Error: ADO.NET: R script error.
Error in doTryCatch(return(expr), name, parentenv, handler) :
Error: Call to 'uncompress' failed. Input data was corrupted or incomplete.
Calls: rxFactors ... tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> .Call
Execution halted

Details:
DataSourceKind=R
DataSourcePath=R
Message=R script error.
Error in doTryCatch(return(expr), name, parentenv, handler) :
Error: Call to &#39;uncompress&#39; failed. Input data was corrupted or incomplete.
Calls: rxFactors ... tryCatch -&gt; tryCatchList -&gt; tryCatchOne -&gt; doTryCatch -&gt; .Call
Execution halted

ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Radio.RScriptRuntimeException

 

if I start a fresh powerBI file, with just the R script as the source (and not a copy of the power query/M code) then it works fine, 

 

I feel like there's a parameter/cache issue, but I don't know what to change. Please help

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors