BINF634 - Perl and R1 BINF634 Perl and R. BINF634 - Perl and R2 Some R References The R Book by Michael J. Crawley The R Book Statistics An Introduction.

Slides:



Advertisements
Similar presentations
Summary Statistics/Simple Graphs in SAS/EXCEL/JMP.
Advertisements

Windows Basics An Introduction to the Windows Operating System.
SW388R7 Data Analysis & Computers II Slide 1 Copying SPSS Output Into Microsoft Word Copying syntax commands from SPSS output to Word Copying a statistics.
sample text 14pt Helvetica Instructions 1.Use mouse to select an object (icon, arrow or sample text box) 2.Copy the object (Edit > Copy) then paste.
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Microsoft Office 2007-Illustrated Introductory, Windows Vista Edition Windows XP Unit A.
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
How to Program the Bypass Tray on most Sharp Models.
Next Generation MMI Requirements May 4, MMI - High Level Requirements run under UNIX and Windows NT (WNT) use a well defined ASCII definition for.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
E.1 Eclipse. e.2 Installing Eclipse Download the eclipse.installation.exe from the course web site to your computer and execute it. Keep the destination.
Introduction to MATLAB 3 November Instructor: Andy Newman Office Hours: Stop by room 306 (main building) whenever
General Computer Science for Engineers CISC 106 Lecture 08 Dr. John Cavazos Computer and Information Sciences 2/27/2009.
A Simple Guide to Using SPSS© for Windows
Introduction to Perl Software Tools. Slide 2 Introduction to Perl l Perl is a scripting language that makes manipulation of text, files, and processes.
MCT260-Operating Systems I Operating Systems I Interfaces to Operating Systems.
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
Introduction to SPSS Short Courses Last created (Feb, 2008) Kentaka Aruga.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
Chapter 1 – Introduction to Computer Systems & QBasic
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Modifying Syntax PowerPoint Prepared by Alfred.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
The introduction to SPSS Ⅱ.Tables and Graphs for one variable ---Descriptive Statistics & Graphs.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Developed By Information Technology Services University Of Saskatchewan.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB is a powerful program for numerical computations, plotting and programming.
Introduction to MATLAB ENGR 1181 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
Using the ‘R’ Language for Bioinformatics
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
An Introduction to R graphics Cody Chiuzan Division of Biostatistics and Epidemiology Computing for Research I, 2012.
1 System Administration Introduction to Scripting, Perl Session 3 – Sat 10 Nov 2007 References:  chapter 1, The Unix Programming Environment, Kernighan.
1 MatLab Basics Jae Hoon Kim Department of Physics Kangwon National University It contains hundreds of commands to do mathematics. Graph functions, solve.
CMPS 1371 Introduction to Computing for Engineers MatLab.
Getting Started with TI-Interactive. TI-Interactive TI-Interactive can be used to create a variety of graphs. Scatter Plots, Line Plots, Histograms, Modified.
Developed By Information Technology Services University Of Saskatchewan.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Angela Des Jardins
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
STAT 251 Lab 1. Outline Lab Accounts Introduction to R.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
Shell Programming Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn the.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
ENG 1181 First-Year Engineering Program College of Engineering Engineering Education Innovation Center First-Year Engineering Program MAT - Introduction.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
1.Introduction to SPSS By: MHM. Nafas At HARDY ATI For HNDT Agriculture.
PROGRAMMING IN R Introduction to R. In this session I will: Introduce you to the R program and windows Show how to install R Write basic programs in R.
Introductory Data Analysis F73DA2. Contact Times (Spring Term 2008) Monday 4: : Lecture in LT3 Tuesday 2: : Lecture in LT3 Wednesday
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Chapter 5: Enhancing Your Output with ODS
Introduction to Graphics
Lecture 25.
DEPARTMENT OF COMPUTER SCIENCE
Social Science Research Design and Statistics, 2/e Alfred P
MATLAB DENC 2533 ECADD LAB 9.
HEADLINE GOES HERE. Directions to save header as JPEG:
Chapter 2 MATLAB Environment
Presentation transcript:

BINF634 - Perl and R1 BINF634 Perl and R

BINF634 - Perl and R2 Some R References The R Book by Michael J. Crawley The R Book Statistics An Introduction using R by Michael J. Crawley Introductory Statistics with R (Statistics and Computing) by Peter Dalgaard Introductory Statistics with R (Statistics and Computing) R Graphics, Paul Murrell Data Analysis and Graphics Using R, John Maindonald et al. Using R for Introductory Statistics by John Verzani Using R for Introductory Statistics

BINF634 - Perl and R3 Making it Go Under Unix/LINUX Type R (or the appropriate path on your machine) Under Windows Double click on the R icon

BINF634 - Perl and R4 Making it Stop Type > q() q() is a function execution Everything in R is a function q merely returns a listing of the function

> log2(32) [1] 5 > sqrt(2) [1] > seq(0, 5, length=6) [1] > plot(sin(seq(0, 2*pi, length=100))) R as a Calculator 5BINF634 - Perl and R

6 Syntax Everything that we type in R is an expression We may have multiple expressions on each line separated by ; 2+3;4*5;6-9 We use <- or = for making assignments b<-5+9 or b = 5+9 R commands are case sensitive The result of any expression is an object

BINF634 - Perl and R7 In WINDOWS/UNIX one may use the arrow up key or the history command under the menus Given the history window then one can copy certain commands or else past them into the console window Recalling Previous Commands

In both environments we may use help(command name) ?command name > help("ls") > ? ls We may also use methods(command name) html-based help help.start() For commands with multiple methods based on different object types Getting Help 8BINF634 - Perl and R

9 Assignments in R Some Examples > cat<-45 > dog=66 > cat [1] 45 > dog [1] 66 > 77 -> rat > rat [1] 77 Note = is used for specifying values in function calls

BINF634 - Perl and R10 A vector example > a<-c(1,2,3,4) > length(a) [1] 4 > a [1] An example with character strings > name<-c("Jeff","Solka") > name [1] "Jeff" "Solka“ > name[1] [1] "Jeff" Vectors

BINF634 - Perl and R11 win.graph() or in UNIX we say x11 () dev.list() - list currently opened graphics devices dev.cur() - list identifier for the current graphics device dev.off() - close the current graphics window A simple plotting example > x<-rnorm(100) > y<-rnorm(100) > plot(x,y) Graphics in R

BINF634 - Perl and R12 owin.graph(), x11() All Examples of Calls to Launch Graphics Window oA simple example > x = rnorm(100) > win.graph() > hist(x) High-level Graphics Functions

BINF634 - Perl and R13 obarplot - Creates a Bar Plot oboxplot - Creates Side-by-Side Boxplots ohist - Creates a Histogram odotchart - Creates a Dot Chart opie - Creates a Pie Chart oNote - These commands along with the commands on the next several slides are all high-level graphics calls. Plotting Functions That Are Useful for One-dimensional Data

A Simple Pie Chart > data = c(10,20,30) > labels = c("a", "b", "c") > pie(data,labels=labels) BINF634 - Perl and R14

BINF634 - Perl and R15 File-Print Menu oStarting Printing Graphics Device oPostscript - Postscript oPdf oPictex - Latex oWindows - Metafile opng - PNG bitmap device oJpeg - JPEG bitmap device oBmp - BMP bitmap device oXfig - Device for XFIG graphics file format Printing Graphics

BINF634 - Perl and R16 jpeg(file=“junk.jpg”) plot(x,y,pch=“*”) dev.off() Capturing Graphics to a jpeg File

BINF634 - Perl and R17 #plot in an x11 or wingraph window and then write the output to a file > dev.print(bmp, file="myplot.bmp", width=1024, height=768) Alternative Screen Printing Approach

Call R from Perl use Statistics::R; # Create a communication bridge with R and start R my $R = Statistics::R->new(); # Run simple R commands my $output_file = "file.ps"; $R->run(qq`postscript("$output_file", horizontal=FALSE, width=500, heig ht=500, pointsize=1)`); $R->run(q`plot(c(1, 5, 10), type = "l")`); $R->run(q`dev.off()`); BINF634 - Perl and R18

q and qq q acts the same as single quotes so we do not have variable interpolation and it ignores single quotes qq used to interpolate variables but to ignore double quotes BINF634 - Perl and R19

Communicating With R use Statistics::R; # Create a communication bridge with R and start R my $R = Statistics::R->new(); # Pass and retrieve data (scalars or arrays) my $input_value = 1; $R->set('x', $input_value); $R->run(q`y <- x^2`); my $output_value = $R->get('y'); print "y = $output_value\n"; $R->stop(); BINF634 - Perl and R20