A Gentle Introduction to R from a SAS Programmer’s Perspective

Slides:



Advertisements
Similar presentations
Data Mining with R/ORE Minming Duan. 2 iTech Solution Profile Agenda R/ORE Overview 1 XML output generation using SQL 4 Integration with IBP and BIEE.
Advertisements

Java Packages CSci 1130 Intro to Computer Programming with Java Instructor Tatyana Volk.
In Review JAVA C++ GUIs - Windows Webopedia.com.
BUILDING INTERACTIVE, R-POWERED WEB APPLICATIONS WITH SHINY Jeff Allen, Dallas R Users Group 2/9/2013.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
T HE S HINY A PP Presented by: Lance Cundy Great Plains R Users Group November 15, 2013.
Web-based Truth Table Program S07 EE296 Project. Introduction Team IDK: Jason Axelson, Bryant Komo Roles: Designers, testers, programmers.
Introduction to SAS Math 3200 Jan Jimin Ding.
Introduction of Some Useful Free Software Cheng-Han Du.
What is R By: Wase Siddiqui. Introduction R is a programming language which is used for statistical computing and graphics. “R is a language and environment.
V Avon High School Tech Club Agenda Old Business –Delete Files New Business –Week 16 Topics: Intro to HTML/CSS –Questions? Tech Club Forums.
Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Calling R Functions from SAS… PhUSE 2011 – ….with PROC IML.
SHINING WITH SHINY: INTRODUCING A WEB APPLICATION FRAMEWORK FOR R Gokul Bhandari.
The Original and Current Basic R “Console” command line interface….
Python: An Introduction
Computer Science 111 Fundamentals of Programming I Overview of Programming.
1 Chapter 2 First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Creating a lively R Community BaselR meeting Reinhold Koch.
Khoros Yongqun He Dept. of Computer Science, Virginia Tech.
C# AND ASP.NET What will I do in this course?. MAJOR TOPICS Learn to program in the C# language with the Visual Studio IDE (Interactive Development Environment)
Microsoft Visual Studio 2010 Teacher: Ms. Olifer.
Getting started with Programming using IDE. JAVA JAVA IS A PROGRAMMING LANGUAGE AND A PLATFORM. IT CAN BE USED TO DELIVER AND RUN HIGHLY INTERACTIVE DYNAMIC.
Applets Yong Choi School of Business CSU, Bakersfield.
JavaScript Defined JavaScript Basics Definitions JavaScript is an object-oriented programming language designed for the world wide web. JavaScript code.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 1: Introduction.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Windows Programming, C.-S. Shieh, KUAS EC, Chapter 0 Overview.
Lecy ∙ Data-Driven Management Lecture 12 Building Shiny Apps.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Chris Knight Beginners’ workshop.
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
Scripting Just Enough SSIS to be Dangerous. 6/13/2015 Visit the Sponsor tables to enter their end of day raffles. Turn in your completed Event Evaluation.
Copyright © 2006, SAS Institute Inc. All rights reserved. Company confidential - for internal use only SAS/IML Studio Ian Sedgwick.
Introduction to R and Data Science Tools in the Microsoft Stack Jamey Johnston.
16BIT IITR Data Collection Module If you have not already done so, download and install R from download.
U.S. Department of the Interior U.S. Geological Survey July 2014 OPeNDAP Services – Present and Future at LP DAAC Brian Davis 1, Rob Quenzer 1, Jason Werpy.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing.
Introduction to R and Data Science Tools in the Microsoft Stack Jamey Johnston.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Java Online Training Techverze. Introduction to Java Java is a dynamic programming language expressly designed and use concurrent, class-based, object-oriented.
Introduction to R and Data Science Tools in the Microsoft Stack
Block 1: Introduction to R
Fundamentals of Programming I Overview of Programming
Dashboards – Part One “I think, aesthetically, car design is so interesting - the dashboards, the steering wheels, and the beauty of the mechanics. I don't.
CST 1101 Problem Solving Using Computers
Shiny for RStudio Exploring Web Mapping Technology
Lecture 2: Introduction to R
Big Data A Quick Review on Analytical Tools
Intro to Shiny Workshop (No, really, you can learn this)
Getting Started with R.
Introduction to R.
Introduction to R Programming with AzureML
Dashboards – Part Two “I think, aesthetically, car design is so interesting - the dashboards, the steering wheels, and the beauty of the mechanics. I don't.
Dashboards I think, aesthetically, car design is so interesting - the dashboards, the steering wheels, and the beauty of the mechanics. I don't know how.
Lab 1 Introductions to R Sean Potter.
Introduction to R.
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
.NET and .NET Core Foot View of .NET Pan Wuming 2017.
Today’s Beginner Workshop
R Shiny EPID 799C Fall 2017.
Brief Intro to Python for Statistics
Siva R Venna (sxv6878) Satya Katragadda (sxk6389)
A Programming Language for
Bob Friedman, Xybion; Anthony Fata, SNBL
CS 1111 Introduction to Programming Spring 2019
R course 6th lecture.
Top 10 reasons to Learn R.
Just Enough SSIS Scripting to be Dangerous.
Spark with R Martijn Tennekes
Presentation transcript:

A Gentle Introduction to R from a SAS Programmer’s Perspective Nate Mockler & Saranya Duraisamy – Phuse 2018

Agenda Part 1: Quick Review of R (5 min) Part 2: Introduction to ggplot2 (10 min) Part 3: Introduction to Shiny (5 min) Questions/Discussion (10 min)

Smörgåsbord

Review of R Base R is great, but limited so we extend with packages. Packages are collections of R functions, data, and compiled code in a well-defined format. We call them in using the library (<package>) statement Examples: ggplot2, tidyverse, shiny…. Etc. Rstudio is a free Graphical User Interface for R. Similar to Enhanced Editor for SAS… can type scripts, see objects, etc.

Basic R Interface

A GUI for R – Also free!

The Grammar of Graphics

The Sandwich of Graphics

Stacking a Plot ggplot(data=iris)

Stacking a Plot ggplot(data=iris) + aes(x=Sepal.Width, y=Sepal.Length)

ggplot(data=iris) + aes(x=Sepal.Width, y=Sepal.Length) + geom_point()

ggplot(data=iris) + aes(x=Sepal. Width, y=Sepal ggplot(data=iris) + aes(x=Sepal.Width, y=Sepal.Length, color=Species) + geom_point()

ggplot(data=iris) + aes(x=Sepal. Width, y=Sepal ggplot(data=iris) + aes(x=Sepal.Width, y=Sepal.Length, color=Species) + geom_point() + facet_wrap(~ Species)

Shiny Shiny is a web application framework for R, developed by RStudio Allows you to combine the interactive functionality of the web with the statistical power of R without having to learn another language. Right now, Shiny will use your personal computer as a server, but you can set this up on your company’s Intranet, or online (shinyapps.io) Who has time to learn another language?

Example of Shiny Dashboard

Building the app from Scratch library(shiny) ui <- fluidPage( ) server <- function(input, output) { } # Run the application shinyApp(ui = ui, server = server)

Creating a table library(shiny) library(haven) dm <- read_sas("J:/drug/study/R_training/dm.sas7bdat") ui <- fluidPage( selectInput("variable", "Variable:", c("Arm" = "ARM", "Country" = "COUNTRY", "Race" = "RACE")) ) server <- function(input, output) { output$data <- renderTable({ dm[, c("USUBJID", input$variable), drop = FALSE] }, rownames = TRUE) } # Run the application shinyApp(ui = ui, server = server)

Changing to Plot library(shiny) library(haven) dm <- read_sas("J:/drug/study/R_training/dm.sas7bdat") ui <- fluidPage( radioButtons("variable", "Variable:", c("Arm" = "ARM", "Country" = "COUNTRY", "Race" = "RACE")), plotOutput("plot") ) server <- function(input, output) { output$plot <- renderPlot({ ggplot(dm, aes_string(input$variable)) + geom_bar() }) } # Run the application shinyApp(ui = ui, server = server)

Shinydashboard Package

Examples of Shiny Apps

What You Can Do With R Interactive Dashboards! Machine Learning! Big Data Analytics! Accessible through SAS (Using PROC IML)* And So Much More!

Credits Name: Nate Mockler and Saranya Duraisamy Organization: Biogen Web: Nate.Mockler@biogen.com & Saranya.Duraisamy@biogen.com