Showing posts with label R. Show all posts
Showing posts with label R. Show all posts

Monday, May 28, 2018

Introduction to R and wide variety of things it can do

Definition: R is both a Programming Language and Software environment for Statistical analysis, graphics representation and and reporting.

It is an Open source and is freely available under GNU general public licence. It has all the capabilities of a intergated computer language like loops, branches and also has capabilities of Modular programming language and suppot functions.

Integration with other Platforms
R supports integration with procedures written other platforms including but not limited to(as it is growing everuday) C, C++, .Net, Python and Fortron.

Capabilities of R

R is big ecosystem now. The standard R distributed can do pretty much all you need in data manipulation, Reporting and analysis. Apart from there are thousands of packages on CRAN  and other open repositories.
So, it is not possible to list everything R can do. The features of R could further be divided as per the  different services lines. Below is list of some features which i could find:

General Programming

  • Object Oriented Programming
  • IO
  • Distributed Computing


Visualizations and Reporting

  • Static Visualization
  • Dynamic Visualization


Analytics

  • Statistics
  • Mathamatics
  • Probability
  • Machine Learning
  • Signal Processing
  • Simulation
  • Statistical Modeling and Test
  • and Big Data Analytics

I would try to post more details on the individual features in my future posts.

Monday, May 21, 2018

POWER BI and R

We are all aware of the revolutionary reporting tool of Microsoft Power BI. It has lots of inbuilt capabilities and could be further enhanced with the help of another powerful analytics language R

I tried to find out some information on this and some basic tutorials but no luck. Everything was very difficult to understand for people who are new to Power BI or R. So i thought of share my my understanding in a simplistic way. Below is how R could be used in Power BI.

Installation of R
Power Bi service know how to use R Powered visuals but when you create the Power Bi desktop requires a local R installation on your machine. R installation information is available on this URL
After installation, enable the R in the power BI desktop. the steps for the same are available to the URL mentioned above.

Using R in Power BI
R can be used in Power BI in 2 different ways.

  • Using R Script as a Data source: We could use R to load data into Power Bi like any other data source.
    To use R as data source, Click "Get Data" from menu and select R Script. It will open a dialog box where we could paste our R script. Paste your R script and click Load.
    If you are not familiar with R, you could use below sample data set. This just static  data set for learning purpose 
fruits <- data.frame(name = c("Apple", "Banana", "Grapes", "Grapes"), Id=c(1,2,3,4))
    fruit_sales <- data.frame(Id=c(1,2,3,4,3,2,1), qty= c(10,12,13,34,43,12,10))
    This code would create 2 data sets for Fruits and Fruit Sales. The power Bi is intelligent enough to create a relationship between the 2 data sets.
    • Using R Script to create a visualization
      To create a visualization using R, Select the R visual from the visualization pane. This will open an R script editor where we could add our code. Select the fields on which we need to visualize. I have selected Id and qty from the Toy_Sales.
      You would notice some comments(starting with #) in the editor which would suggest id and qty fields are loaded in the variable named dataset. Now we will use the plot function of R to plot a graph between ID and quantity sold. Write plot(dataset) in the editor.
      You would see a graph. This is just very basic and could be enhanced to any level as R has one of the most powerful visualizations.





    If you liked the post, please share it.
    Subscribe to your email and receive new articles on your email