<?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 Re: Data Smoothing with Splines in R Script Showcase</title>
    <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/486361#M306</link>
    <description>&lt;P&gt;Been looking at this visualization lately as I need to plot some datapoints and need to add regression lines. I'm plotting revenue/sales per day, and using the date as the category/legend.&amp;nbsp;However, I need one line for each of the days, instead of one for all the data points.&lt;BR /&gt;&lt;BR /&gt;How much work am I looking at doing smoething like this in R?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 12:59:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-10T12:59:31Z</dc:date>
    <item>
      <title>Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/58777#M18</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Smoothing helps you to better visualize and understand noisy data&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;Prerequisites (The sample .pbix files will not work without these prerequites completed)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1. Install R Engine&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Power BI Desktop does not include, deploy or install the R engine. To run R scripts in Power BI Desktop, you must separately install&lt;/SPAN&gt;R&lt;SPAN&gt; on your local computer. You can download and install &lt;/SPAN&gt;R&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;for free from many locations, including the &lt;/SPAN&gt;&lt;A title="" href="https://mran.revolutionanalytics.com/download/" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer noopener noreferrer"&gt;Revolution Open download page&lt;/A&gt;&lt;SPAN&gt;, and the &lt;/SPAN&gt;&lt;A title="" href="https://cran.r-project.org/bin/windows/base/" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer noopener noreferrer"&gt;CRAN Repository&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Install the required R packages.&lt;/P&gt;
&lt;P&gt;Download the R script attached to this message and run it to install all required packages on your local machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Required&amp;nbsp;R packages:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;graphins, spline, scales&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Tested on:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;CRAN 3.3.1, MRO 3.3.0&lt;SPAN&gt;, powerbi.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Legal Disclaimers:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="" href="http://aka.ms/galleryTOS" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;EM&gt;Terms of Service &lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;and &lt;/EM&gt;&lt;A title="" href="https://aka.ms/gallerythirdparty" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;EM&gt;Third Party Programs&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 09:29:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/58777#M18</guid>
      <dc:creator>Sharon</dc:creator>
      <dc:date>2016-11-16T09:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/137403#M124</link>
      <description>&lt;P&gt;We love this visual. &amp;nbsp;How should the script read if my dates are formatted as mm/dd/yyyy?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:16:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/137403#M124</guid>
      <dc:creator>jdt008</dc:creator>
      <dc:date>2017-03-06T17:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/163090#M154</link>
      <description>&lt;P&gt;Hi, sorry for the delay in reply.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The X column is of type "numeric". You can convert "date" type to "numeric" in Power Query. Next you need to take care of X-axis ticks labels, to be formatted as you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did something similar in&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/R-Script-Showcase/ARIMA-forecasting/m-p/124237" target="_blank"&gt;https://community.powerbi.com/t5/R-Script-Showcase/ARIMA-forecasting/m-p/124237&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please have a&amp;nbsp;look at the R code. If you still have trouble with it, you are welcome to send&amp;nbsp;me the&amp;nbsp;PBIX&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 06:56:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/163090#M154</guid>
      <dc:creator>boefraty</dc:creator>
      <dc:date>2017-04-23T06:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/486361#M306</link>
      <description>&lt;P&gt;Been looking at this visualization lately as I need to plot some datapoints and need to add regression lines. I'm plotting revenue/sales per day, and using the date as the category/legend.&amp;nbsp;However, I need one line for each of the days, instead of one for all the data points.&lt;BR /&gt;&lt;BR /&gt;How much work am I looking at doing smoething like this in R?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 12:59:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/486361#M306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-10T12:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/500095#M310</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is quite simple to achieve if you have basic expertise in R.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd also recommend you to look at R Custom Visual&amp;nbsp; "Spline" it has regression lines&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use it as a starting point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 10:53:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/500095#M310</guid>
      <dc:creator>boefraty</dc:creator>
      <dc:date>2018-08-27T10:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/500192#M311</link>
      <description>&lt;P&gt;I actually wrote a script that kinda fixed what I was trying to do, it's not pretty, but it works. Problem I got now is that I'm trying to make a custom visual out of it so I can get the highlighting features you used working. I assume it was plotly?&amp;nbsp;I got multiple regression lines working, but plotly isn't playing along. Tried the RADACAD tutorial a few times, but I'm guessing my code is written in a way that it isn't a simple copy paste job anymore.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;library(ggplot2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;p = qplot(1:10, (1:10)^3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;g = ggplot(dataset, aes(x=Price, y=Production, color = Date))+&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geom_point() +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;theme(axis.text.x = element_text(size=14),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;axis.text.y = element_text(size=14),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;axis.title.x = element_text(size=16),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;axis.title.y = element_text(size=16),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;panel.background = element_rect(fill = "white",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;colour = "777777",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;size = 0.4, linetype = "solid"),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;panel.grid.major = element_line(size = 0.08, linetype = 'dashed',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;colour = "777777"),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;panel.grid.minor = element_line(size = 0.08, linetype = 'dashed',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;colour = "777777")) +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;theme(legend.position="bottom") +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ylab("Production") +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xlab("Price") +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;stat_smooth(method = "lm", formula = y ~ poly(x,2), size = 1, se = FALSE)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;g$respect = TRUE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;library(grid)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;grid.draw(g)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Trying to get it working in this template.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;############### Library Declarations ###############&lt;BR /&gt;libraryRequireInstall("ggplot2");&lt;BR /&gt;libraryRequireInstall("plotly")&lt;BR /&gt;####################################################&lt;/P&gt;&lt;P&gt;################### Actual code ####################&lt;BR /&gt;g = qplot(Values$Data, data = Values, fill = Values$Type, main = Sys.time());&lt;BR /&gt;####################################################&lt;/P&gt;&lt;P&gt;############# Create and save widget ###############&lt;BR /&gt;p = ggplotly(g);&lt;BR /&gt;internalSaveWidget(p, 'out.html');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Converting-power-bi-R-script-visual-to-custom-R-visual/m-p/498110#M15275" target="_blank"&gt;https://community.powerbi.com/t5/Developer/Converting-power-bi-R-script-visual-to-custom-R-visual/m-p/498110#M15275&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 12:55:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/500192#M311</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-27T12:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/676950#M330</link>
      <description>&lt;P&gt;I have a couple of visuals I want to use from R, but when I try to load this visual (and others) I am having issues trying to install the needed libraries&amp;nbsp; I uninstalled the current version or R (3.5.1) and installed the version given in most all the visualizations in this section (3.3.1), but still I can't load most of the required libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You say the visualization you require requires&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Required&amp;nbsp;R packages:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;graphins, spline, scales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can load scales, spline is not available for 3.3.1, but I installed splines2 which was available and I assume is similar enough thet I can make it work.&amp;nbsp; However I don't know what to do with graphins.&amp;nbsp; I can't find anything similar at CRAN, CRAN2, R-Forge, or rforge.net.&amp;nbsp; Is there another repository that I should be using?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 16:24:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/676950#M330</guid>
      <dc:creator>ropebender</dc:creator>
      <dc:date>2019-04-24T16:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/771949#M332</link>
      <description>&lt;P&gt;hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a newer version of this? the script to install dependencies is no longer working.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 13:41:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/771949#M332</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-21T13:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data Smoothing with Splines</title>
      <link>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/797163#M333</link>
      <description>&lt;P&gt;I have R installed, but I am a rookie.&amp;nbsp; I was able to install all of the necessary packages so that the sample .pbix file provided here loads and works just fine for me.&amp;nbsp; When I try to add the spline visual to my own .pbix file it doesn't want to accept measures in the X and Y axis.&amp;nbsp; Message on the visual simply states "Need numeric X and Y variables".&amp;nbsp; They are numeric, the Data Type is "Decimal Number", but formatted as "Percentage".&amp;nbsp; Why wouldn't I be able to use measures?&amp;nbsp; The data I have works just fine with the built in Power BI "scatter chart".&amp;nbsp; What I really want is the line so that I can keep a National Average line on the visual and cross-highlight by districts to see the distance from a National Average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very cool visual, I hope that I can get it working.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 15:27:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/R-Script-Showcase/Data-Smoothing-with-Splines/m-p/797163#M333</guid>
      <dc:creator>andymc123</dc:creator>
      <dc:date>2019-09-19T15:27:33Z</dc:date>
    </item>
  </channel>
</rss>

