<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic R script error on a base function in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/R-script-error-on-a-base-function/m-p/580452#M17840</link>
    <description>&lt;P&gt;I use a very simple code to bring the surface plot to Power BI:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;library(tidyr)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;z &amp;lt;- spread(data=dataset[,c("C3", "TPR", "SalesMargin")], key="TPR", value="SalesMargin")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;z &amp;lt;- as.matrix(z[,-1] )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;persp( z=z )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;persp() function works well in R. Actually, the only parameter required is the matrix of values, while x and y are automatically calculated in the function call.&lt;/P&gt;&lt;P&gt;Despite any attempts (adding x and y in various variants, and without them as in the example), function call returns the error when executed in Power BI (see details below). Any thoughts? What's wrong in function? I even was unable to find this error message in a source code of base R on my PC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Feedback Type:&lt;BR /&gt;Frown (Error)&lt;/P&gt;&lt;P&gt;Timestamp:&lt;BR /&gt;2018-12-06T08:57:44.3308789Z&lt;/P&gt;&lt;P&gt;Local Time:&lt;BR /&gt;2018-12-06T09:57:44.3308789+01:00&lt;/P&gt;&lt;P&gt;Session ID:&lt;BR /&gt;ac2b720a-ae95-4cca-a8f2-17aab6092ddc&lt;/P&gt;&lt;P&gt;Release:&lt;BR /&gt;November 2018&lt;/P&gt;&lt;P&gt;Product Version:&lt;BR /&gt;2.64.5285.741 (18.11) (x64)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error Message:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;R script error.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Error in persp.default(z = z) : invalid 'x' argument&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Calls: persp -&amp;gt; persp.default&lt;/STRONG&gt;&lt;BR /&gt;Execution halted&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OS Version:&lt;BR /&gt;Microsoft Windows NT 10.0.16299.0 (x64 en-US)&lt;/P&gt;&lt;P&gt;CLR Version:&lt;BR /&gt;4.7 or later [Release Number = 461308]&lt;/P&gt;&lt;P&gt;Peak Virtual Memory:&lt;BR /&gt;34 GB&lt;/P&gt;&lt;P&gt;Private Memory:&lt;BR /&gt;303 MB&lt;/P&gt;&lt;P&gt;Peak Working Set:&lt;BR /&gt;433 MB&lt;/P&gt;&lt;P&gt;IE Version:&lt;BR /&gt;11.665.16299.0&lt;/P&gt;&lt;P&gt;User ID:&lt;BR /&gt;e91c8a7c-18af-4f62-bb2c-74192dfc0bd8&lt;/P&gt;&lt;P&gt;Workbook Package Info:&lt;BR /&gt;1* - en-US, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.&lt;/P&gt;&lt;P&gt;Telemetry Enabled:&lt;BR /&gt;False&lt;/P&gt;&lt;P&gt;Model Default Mode:&lt;BR /&gt;Import&lt;/P&gt;&lt;P&gt;Snapshot Trace Logs:&lt;BR /&gt;C:\Users\&amp;nbsp; &amp;nbsp; &amp;nbsp;\Microsoft\Power BI Desktop Store App\FrownSnapShot1338113713.zip&lt;/P&gt;&lt;P&gt;Performance Trace Logs:&lt;BR /&gt;C:\Users\&amp;nbsp; &amp;nbsp; &amp;nbsp;\Microsoft\Power BI Desktop Store App\PerformanceTraces.zip&lt;/P&gt;&lt;P&gt;Disabled Preview Features:&lt;BR /&gt;PBI_shapeMapVisualEnabled&lt;BR /&gt;MIntellisense&lt;BR /&gt;PBI_SpanishLinguisticsEnabled&lt;BR /&gt;PBI_PdfImport&lt;BR /&gt;PBI_ColumnProfiling&lt;BR /&gt;PBI_variationUIChange&lt;BR /&gt;PBI_PythonSupportEnabled&lt;BR /&gt;PBI_showIncrementalRefreshPolicy&lt;BR /&gt;PBI_showManageAggregations&lt;BR /&gt;PBI_FuzzyMatching&lt;BR /&gt;PBI_EnableWebDiagramView&lt;BR /&gt;PBI_improvedFilterExperience&lt;/P&gt;&lt;P&gt;Disabled DirectQuery Options:&lt;BR /&gt;PBI_DirectQuery_Unrestricted&lt;BR /&gt;TreatHanaAsRelationalSource&lt;/P&gt;&lt;P&gt;Cloud:&lt;BR /&gt;GlobalCloud&lt;/P&gt;&lt;P&gt;DPI Scale:&lt;BR /&gt;125%&lt;/P&gt;&lt;P&gt;Supported Services:&lt;BR /&gt;Power BI&lt;/P&gt;&lt;P&gt;Formulas:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;section Section1;&lt;/P&gt;&lt;P&gt;shared Demo1 = let&lt;BR /&gt;Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NdBLb8IwEATg/+IzQhvH9nqPFGhpSx+UdyNOVThVSETpof+eZCYcv+xm7HFVud+6bevGjdy5qa9/9eXn351GlZt0X8aSi6TgA1gE8+AU9JrJGRh8LMF5z8KrcPrIZZ8z+ERKEcEFmMQC+ExaSuAL2O0y+ZVUZfKS54pn1BuTg/Dfd0ZpMPAD1Chs9MlG5jldMVmMUV9gtMzlNaNKT25Ak8iDtsNrRBbcMcqU3HNaJgEP90bkcbiGsv73cI2epxs=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),&lt;BR /&gt;#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),&lt;BR /&gt;#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"letter", type text}, {"frequency", type number}})&lt;BR /&gt;in&lt;BR /&gt;#"Changed Type1";&lt;/P&gt;&lt;P&gt;shared #"test surface" = let&lt;BR /&gt;Source = Csv.Document(File.Contents("C:\Users\310299630\Documents\Projects\DI Pricing\test surface.csv"),[Delimiter=",", Columns=8, Encoding=1252, QuoteStyle=QuoteStyle.None]),&lt;BR /&gt;#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"TPR", type number}, {"C1", type number}, {"C2", type number}, {"C3", type number}, {"SalesVolume", type number}, {"SalesMargin", type number}, {"WinRate", type number}})&lt;BR /&gt;in&lt;BR /&gt;#"Changed Type";&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 12:46:30 GMT</pubDate>
    <dc:creator>Alexei</dc:creator>
    <dc:date>2018-12-06T12:46:30Z</dc:date>
    <item>
      <title>R script error on a base function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/R-script-error-on-a-base-function/m-p/580452#M17840</link>
      <description>&lt;P&gt;I use a very simple code to bring the surface plot to Power BI:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;library(tidyr)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;z &amp;lt;- spread(data=dataset[,c("C3", "TPR", "SalesMargin")], key="TPR", value="SalesMargin")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;z &amp;lt;- as.matrix(z[,-1] )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;persp( z=z )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;persp() function works well in R. Actually, the only parameter required is the matrix of values, while x and y are automatically calculated in the function call.&lt;/P&gt;&lt;P&gt;Despite any attempts (adding x and y in various variants, and without them as in the example), function call returns the error when executed in Power BI (see details below). Any thoughts? What's wrong in function? I even was unable to find this error message in a source code of base R on my PC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Feedback Type:&lt;BR /&gt;Frown (Error)&lt;/P&gt;&lt;P&gt;Timestamp:&lt;BR /&gt;2018-12-06T08:57:44.3308789Z&lt;/P&gt;&lt;P&gt;Local Time:&lt;BR /&gt;2018-12-06T09:57:44.3308789+01:00&lt;/P&gt;&lt;P&gt;Session ID:&lt;BR /&gt;ac2b720a-ae95-4cca-a8f2-17aab6092ddc&lt;/P&gt;&lt;P&gt;Release:&lt;BR /&gt;November 2018&lt;/P&gt;&lt;P&gt;Product Version:&lt;BR /&gt;2.64.5285.741 (18.11) (x64)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error Message:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;R script error.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Error in persp.default(z = z) : invalid 'x' argument&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Calls: persp -&amp;gt; persp.default&lt;/STRONG&gt;&lt;BR /&gt;Execution halted&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OS Version:&lt;BR /&gt;Microsoft Windows NT 10.0.16299.0 (x64 en-US)&lt;/P&gt;&lt;P&gt;CLR Version:&lt;BR /&gt;4.7 or later [Release Number = 461308]&lt;/P&gt;&lt;P&gt;Peak Virtual Memory:&lt;BR /&gt;34 GB&lt;/P&gt;&lt;P&gt;Private Memory:&lt;BR /&gt;303 MB&lt;/P&gt;&lt;P&gt;Peak Working Set:&lt;BR /&gt;433 MB&lt;/P&gt;&lt;P&gt;IE Version:&lt;BR /&gt;11.665.16299.0&lt;/P&gt;&lt;P&gt;User ID:&lt;BR /&gt;e91c8a7c-18af-4f62-bb2c-74192dfc0bd8&lt;/P&gt;&lt;P&gt;Workbook Package Info:&lt;BR /&gt;1* - en-US, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.&lt;/P&gt;&lt;P&gt;Telemetry Enabled:&lt;BR /&gt;False&lt;/P&gt;&lt;P&gt;Model Default Mode:&lt;BR /&gt;Import&lt;/P&gt;&lt;P&gt;Snapshot Trace Logs:&lt;BR /&gt;C:\Users\&amp;nbsp; &amp;nbsp; &amp;nbsp;\Microsoft\Power BI Desktop Store App\FrownSnapShot1338113713.zip&lt;/P&gt;&lt;P&gt;Performance Trace Logs:&lt;BR /&gt;C:\Users\&amp;nbsp; &amp;nbsp; &amp;nbsp;\Microsoft\Power BI Desktop Store App\PerformanceTraces.zip&lt;/P&gt;&lt;P&gt;Disabled Preview Features:&lt;BR /&gt;PBI_shapeMapVisualEnabled&lt;BR /&gt;MIntellisense&lt;BR /&gt;PBI_SpanishLinguisticsEnabled&lt;BR /&gt;PBI_PdfImport&lt;BR /&gt;PBI_ColumnProfiling&lt;BR /&gt;PBI_variationUIChange&lt;BR /&gt;PBI_PythonSupportEnabled&lt;BR /&gt;PBI_showIncrementalRefreshPolicy&lt;BR /&gt;PBI_showManageAggregations&lt;BR /&gt;PBI_FuzzyMatching&lt;BR /&gt;PBI_EnableWebDiagramView&lt;BR /&gt;PBI_improvedFilterExperience&lt;/P&gt;&lt;P&gt;Disabled DirectQuery Options:&lt;BR /&gt;PBI_DirectQuery_Unrestricted&lt;BR /&gt;TreatHanaAsRelationalSource&lt;/P&gt;&lt;P&gt;Cloud:&lt;BR /&gt;GlobalCloud&lt;/P&gt;&lt;P&gt;DPI Scale:&lt;BR /&gt;125%&lt;/P&gt;&lt;P&gt;Supported Services:&lt;BR /&gt;Power BI&lt;/P&gt;&lt;P&gt;Formulas:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;section Section1;&lt;/P&gt;&lt;P&gt;shared Demo1 = let&lt;BR /&gt;Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NdBLb8IwEATg/+IzQhvH9nqPFGhpSx+UdyNOVThVSETpof+eZCYcv+xm7HFVud+6bevGjdy5qa9/9eXn351GlZt0X8aSi6TgA1gE8+AU9JrJGRh8LMF5z8KrcPrIZZ8z+ERKEcEFmMQC+ExaSuAL2O0y+ZVUZfKS54pn1BuTg/Dfd0ZpMPAD1Chs9MlG5jldMVmMUV9gtMzlNaNKT25Ak8iDtsNrRBbcMcqU3HNaJgEP90bkcbiGsv73cI2epxs=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),&lt;BR /&gt;#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),&lt;BR /&gt;#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"letter", type text}, {"frequency", type number}})&lt;BR /&gt;in&lt;BR /&gt;#"Changed Type1";&lt;/P&gt;&lt;P&gt;shared #"test surface" = let&lt;BR /&gt;Source = Csv.Document(File.Contents("C:\Users\310299630\Documents\Projects\DI Pricing\test surface.csv"),[Delimiter=",", Columns=8, Encoding=1252, QuoteStyle=QuoteStyle.None]),&lt;BR /&gt;#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"TPR", type number}, {"C1", type number}, {"C2", type number}, {"C3", type number}, {"SalesVolume", type number}, {"SalesMargin", type number}, {"WinRate", type number}})&lt;BR /&gt;in&lt;BR /&gt;#"Changed Type";&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 12:46:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/R-script-error-on-a-base-function/m-p/580452#M17840</guid>
      <dc:creator>Alexei</dc:creator>
      <dc:date>2018-12-06T12:46:30Z</dc:date>
    </item>
  </channel>
</rss>

