STAT R Overview. R Intro. R Data Structures. Subsetting. Graphics. January 11, 2018

Size: px
Start display at page:

Download "STAT R Overview. R Intro. R Data Structures. Subsetting. Graphics. January 11, 2018"

Transcription

1 January 11, 2018

2

3 Why use R? R is: a free public domain implementation of S, the standard among (academic) professional statisticians, available for Windows, Mac, and Linux, an object-oriented and functional programming structure, and designed to connect to high-performance programming languages like C and Fortran.

4 Why use R? R has: an open-software environment with a large community that makes getting help easy, a massive set of packages for statistical modeling, data science, visualization, and importing and manipulating data, powerful tools for replicating and communicating your results, an interactive development environment (R Studio) tailored for interactive data analysis and statistical programmming, available for Windows, Mac, and Linux, and an object-oriented and functional programming structure.

5 Reading Data files The ability to datasets into R is an essential skill. For this class, most of the files will be on the course webpage and can be directly downloaded using read.csv. Consider a dataset available at: stat408/datasets/seattlehousing.csv Seattle <- read.csv( ' stringsasfactors = F)

6 Viewing Data files A common function that we will use is head, which shows the first few rows of a data frame. head(seattle) ## price bedrooms bathrooms sqft_living sqft_lot floors waterfront ## ## ## ## ## ## ## sqft_above sqft_basement zipcode lat long yr_sold mn_sold ## ## ## ## ## ##

7

8 Data structure Overview R has four common types of data structures: Vectors Matrices (and Arrays) Lists Data Frames

9 Data structure Overview The base data structures in R can be organized by dimensionality and whether they are homogenous. Dimension Homogenous Heterogenous 1d Vector List 2d Matrix Data Frame no d Array

10 Vector Types There are four common types of vectors: logical, integer, double (or numeric), and character. The c() function is used for combining elements into a vector dbl <- c(1,2.5,pi) int <- c(1l,4l,10l) log <- c(true,false,f,t) char <- c('this is','a character string')

11 Vector Types They type of vector can be identified using the typeof() function. Note that only a single data type is allowed. typeof(dbl) ## [1] "double" comb <- c(char,dbl) typeof(comb) ## [1] "character" comb ## [1] "this is" "a character string" "1" ## [4] "2.5" " "

12 Exercise: Vectors Create a vector with your first, middle, and last names.

13 Solution: Vectors 1 Create a vector with your first, middle, and last names. andy.names <- c("andrew","blake","hoegh") andy.names ## [1] "Andrew" "Blake" "Hoegh"

14 Data Frame Overview A data frame: is the most common way of storing data in R is like a matrix with rows-and-column structure; however, unlike a matrix each column may have a different mode in a technical sense, a data frame is a list of equal-length vectors. df <- data.frame(x = 1:3, y = c('a','b','c')) kable(df) x y 1 a 2 b 3 c

15

16 ## [1] Vector : I allows you to extract certain elements from a data frame or vector (or matrix, array, list). num.vec <- seq(from = 1, to = 9, by = 1); num.vec ## [1] num.vec[1:3] ## [1] num.vec[c(1,5,8)] ## [1] num.vec[-5]

17 Vector : II also works with logical values or expressions. num.vec[num.vec > 5] ## [1] num.vec[num.vec!= 6] ## [1] num.vec[rep(c(true,false,true),each=3)] ## [1]

18 Data Frame : I The same ideas apply to data frames, but the indices now constitute rows and columns of the data frame. df <- data.frame(x=1:3, y=3:1, z=c('a','b','c')) df[,1] ## [1] df[-1,c(2:3)] ## y z ## 2 2 b ## 3 1 c

19 Data Frame : II There are also a couple built in functions in R for subsetting data frames. df$x ## [1] new.df <- subset(df, x >1); new.df ## x y z ## b ## c

20 Exercise: 1 Create a new data frame that only includes houses worth more than $1,000, (bonus) From this new data frame what is the average living square footage of houses. Hint columns in a data.frame can be indexed by Seattle$sqft_living

21 Exercise: - Solutions 1 Create a new data frame that only includes houses worth more than $1,000,000. expensive.houses <- subset(seattle, price > ) 2 (bonus) From this new data frame what is the average living square footage of houses. Hint columns in a data.frame can be indexed by Seattle$sqft_living mean(expensive.houses$sqft_living) ## [1]

22

23 Basic Plotting in R: Scatterplot Later in the course, we will spend considerable time on graphics. For now, let s consider some of the basic functionality in R. plot(seattle$price~seattle$sqft_living) Seattle$price 0e+00 6e Seattle$sqft_living

24 Living Sqft Basic Plotting in R: labels plot(seattle$price~seattle$sqft_living, ylab='price',xlab='living Sqft') Price 0e+00 4e+06 8e

25 Basic Plotting in R: pch plot(seattle$price~seattle$sqft_living, ylab='price',xlab='living Sqft', pch=16) Price 0e+00 4e+06 8e Living Sqft

26 Basic Plotting in R: color plot(seattle$price~seattle$sqft_living, pch=16, col=rgb(0,0,.3,.3),ylab='price',xlab='living Sqft') Price 0e+00 4e+06 8e Living Sqft

27 Basic Plotting in R: title plot(seattle$price~seattle$sqft_living, pch=16, ylab='price', xlab='living Sqft',main='Price vs. Living Sqft') Price 0e+00 4e+06 8e+06 Price vs. Living Sqft

28 Price Basic Plotting in R: histogram hist(seattle$price,xlab='price', breaks='fd') Histogram of Seattle$price Frequency e+00 2e+06 4e+06 6e+06 8e+06

29 Basic Plotting in R: histogram boxplot(seattle$price~seattle$bedrooms,ylab='price', col='red', xlab='bedrooms',main='price by Bedrooms for Seattle') Price 0e+00 4e+06 8e+06 Price by Bedrooms for Seattle

30 Exercise: Basic Plot Using only the subset of homes worth more than a million dollars, create a graphic.

31 Solution: Basic Plot Price by Bedrooms for Seattle Price 1e+06 5e bedrooms For homes worth more than $1,000,000

32 Solution: Basic Plot - with Code boxplot(expensive.houses$price ~ expensive.houses$bedrooms, ylab='price', col='red', xlab='bedrooms', main='price by Bedrooms for Seattle', sub='for homes worth more than $1,000,000')

Predicting housing price

Predicting housing price Predicting housing price Shu Niu Introduction The goal of this project is to produce a model for predicting housing prices given detailed information. The model can be useful for many purpose. From estimating

More information

ARTIFICIAL INTELLIGENCE AND PYTHON

ARTIFICIAL INTELLIGENCE AND PYTHON ARTIFICIAL INTELLIGENCE AND PYTHON DAY 1 STANLEY LIANG, LASSONDE SCHOOL OF ENGINEERING, YORK UNIVERSITY WHAT IS PYTHON An interpreted high-level programming language for general-purpose programming. Python

More information

Lab Session # 5 Arrays. ALQUDS University Department of Computer Engineering

Lab Session # 5 Arrays. ALQUDS University Department of Computer Engineering 2013/2014 Programming Fundamentals for Engineers Lab Lab Session # 5 Arrays ALQUDS University Department of Computer Engineering Objective: After completing this session, the students should be able to:

More information

CSC 4510 Machine Learning

CSC 4510 Machine Learning 4: Regression (con.nued) CSC 4510 Machine Learning Dr. Mary Angela Papalaskari Department of CompuBng Sciences Villanova University Course website: www.csc.villanova.edu/~map/4510/ The slides in this presentabon

More information

Laboratory 1 Introduction to MATLAB for Signals and Systems

Laboratory 1 Introduction to MATLAB for Signals and Systems Laboratory 1 Introduction to MATLAB for Signals and Systems INTRODUCTION to MATLAB MATLAB is a powerful computing environment for numeric computation and visualization. MATLAB is designed for ease of use

More information

STAT Statistical Learning. Predictive Modeling. Statistical Learning. Overview. Predictive Modeling. Classification Methods.

STAT Statistical Learning. Predictive Modeling. Statistical Learning. Overview. Predictive Modeling. Classification Methods. STAT 48 - STAT 48 - December 5, 27 STAT 48 - STAT 48 - Here are a few questions to consider: What does statistical learning mean to you? Is statistical learning different from statistics as a whole? What

More information

An Introduction to R- Programming

An Introduction to R- Programming An Introduction to R- Programming Hadeel Alkofide, Msc, PhD NOT a biostatistician or R expert just simply an R user Some slides were adapted from lectures by Angie Mae Rodday MSc, PhD at Tufts University

More information

Data types and structures

Data types and structures An introduc+on to Data types and structures Noémie Becker & Benedikt Holtmann Winter Semester 16/17 Course outline Day 3 Review GeFng started with R Crea+ng Objects Data types in R Data structures in R

More information

Mails : ; Document version: 14/09/12

Mails : ; Document version: 14/09/12 Mails : leslie.regad@univ-paris-diderot.fr ; gaelle.lelandais@univ-paris-diderot.fr Document version: 14/09/12 A freely available language and environment Statistical computing Graphics Supplementary

More information

A brief introduction to R

A brief introduction to R A brief introduction to R Cavan Reilly September 29, 2017 Table of contents Background R objects Operations on objects Factors Input and Output Figures Missing Data Random Numbers Control structures Background

More information

Lab #10 Multi-dimensional Arrays

Lab #10 Multi-dimensional Arrays Multi-dimensional Arrays Sheet s Owner Student ID Name Signature Group partner 1. Two-Dimensional Arrays Arrays that we have seen and used so far are one dimensional arrays, where each element is indexed

More information

Logical operators: R provides an extensive list of logical operators. These include

Logical operators: R provides an extensive list of logical operators. These include meat.r: Explanation of code Goals of code: Analyzing a subset of data Creating data frames with specified X values Calculating confidence and prediction intervals Lists and matrices Only printing a few

More information

Ch.5. Loops. (a.k.a. repetition or iteration)

Ch.5. Loops. (a.k.a. repetition or iteration) Ch.5 Loops (a.k.a. repetition or iteration) 5.1 The FOR loop End of for loop End of function 5.1 The FOR loop What is the answer for 100? QUIZ Modify the code to calculate the factorial of N: N! Modify

More information

Introduction to R Commander

Introduction to R Commander Introduction to R Commander 1. Get R and Rcmdr to run 2. Familiarize yourself with Rcmdr 3. Look over Rcmdr metadata (Fox, 2005) 4. Start doing stats / plots with Rcmdr Tasks 1. Clear Workspace and History.

More information

Command Line and Python Introduction. Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016

Command Line and Python Introduction. Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016 Command Line and Python Introduction Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016 Today Assignment #1! Computer architecture Basic command line skills Python fundamentals

More information

LAB #1: DESCRIPTIVE STATISTICS WITH R

LAB #1: DESCRIPTIVE STATISTICS WITH R NAVAL POSTGRADUATE SCHOOL LAB #1: DESCRIPTIVE STATISTICS WITH R Statistics (OA3102) Lab #1: Descriptive Statistics with R Goal: Introduce students to various R commands for descriptive statistics. Lab

More information

file:///users/williams03/a/workshops/2015.march/final/intro_to_r.html

file:///users/williams03/a/workshops/2015.march/final/intro_to_r.html Intro to R R is a functional programming language, which means that most of what one does is apply functions to objects. We will begin with a brief introduction to R objects and how functions work, and

More information

Ch.1 Introduction. Why Machine Learning (ML)?

Ch.1 Introduction. Why Machine Learning (ML)? Syllabus, prerequisites Ch.1 Introduction Notation: Means pencil-and-paper QUIZ Means coding QUIZ Why Machine Learning (ML)? Two problems with conventional if - else decision systems: brittleness: The

More information

Data Structures STAT 133. Gaston Sanchez. Department of Statistics, UC Berkeley

Data Structures STAT 133. Gaston Sanchez. Department of Statistics, UC Berkeley Data Structures STAT 133 Gaston Sanchez Department of Statistics, UC Berkeley gastonsanchez.com github.com/gastonstat/stat133 Course web: gastonsanchez.com/stat133 Data Types and Structures To make the

More information

Ch.1 Introduction. Why Machine Learning (ML)? manual designing of rules requires knowing how humans do it.

Ch.1 Introduction. Why Machine Learning (ML)? manual designing of rules requires knowing how humans do it. Ch.1 Introduction Syllabus, prerequisites Notation: Means pencil-and-paper QUIZ Means coding QUIZ Code respository for our text: https://github.com/amueller/introduction_to_ml_with_python Why Machine Learning

More information

Introduction to R. Nishant Gopalakrishnan, Martin Morgan January, Fred Hutchinson Cancer Research Center

Introduction to R. Nishant Gopalakrishnan, Martin Morgan January, Fred Hutchinson Cancer Research Center Introduction to R Nishant Gopalakrishnan, Martin Morgan Fred Hutchinson Cancer Research Center 19-21 January, 2011 Getting Started Atomic Data structures Creating vectors Subsetting vectors Factors Matrices

More information

Exploring and Understanding Data Using R.

Exploring and Understanding Data Using R. Exploring and Understanding Data Using R. Loading the data into an R data frame: variable

More information

Data Import and Formatting

Data Import and Formatting Data Import and Formatting http://datascience.tntlab.org Module 4 Today s Agenda Importing text data Basic data visualization tidyverse vs data.table Data reshaping and type conversion Basic Text Data

More information

LAB #2: SAMPLING, SAMPLING DISTRIBUTIONS, AND THE CLT

LAB #2: SAMPLING, SAMPLING DISTRIBUTIONS, AND THE CLT NAVAL POSTGRADUATE SCHOOL LAB #2: SAMPLING, SAMPLING DISTRIBUTIONS, AND THE CLT Statistics (OA3102) Lab #2: Sampling, Sampling Distributions, and the Central Limit Theorem Goal: Use R to demonstrate sampling

More information

A system for statistical analysis. Instructions for installing software. R, R-studio and the R-commander

A system for statistical analysis. Instructions for installing software. R, R-studio and the R-commander Instructions for installing software R, R-studio and the R-commander Graeme.Hutcheson@manchester.ac.uk Manchester Institute of Education, University of Manchester This course uses the following software...

More information

Introduction to R Programming

Introduction to R Programming Course Overview Over the past few years, R has been steadily gaining popularity with business analysts, statisticians and data scientists as a tool of choice for conducting statistical analysis of data

More information

Evaluating Performance Via Profiling

Evaluating Performance Via Profiling Performance Engineering of Software Systems September 21, 2010 Massachusetts Institute of Technology 6.172 Professors Saman Amarasinghe and Charles E. Leiserson Handout 6 Profiling Project 2-1 Evaluating

More information

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type.

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Data Structures Introduction An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Representation of a large number of homogeneous

More information

Python for Data Analysis. Prof.Sushila Aghav-Palwe Assistant Professor MIT

Python for Data Analysis. Prof.Sushila Aghav-Palwe Assistant Professor MIT Python for Data Analysis Prof.Sushila Aghav-Palwe Assistant Professor MIT Four steps to apply data analytics: 1. Define your Objective What are you trying to achieve? What could the result look like? 2.

More information

Lasso Regression: Regularization for feature selection

Lasso Regression: Regularization for feature selection Lasso Regression: Regularization for feature selection CSE 416: Machine Learning Emily Fox University of Washington April 12, 2018 Symptom of overfitting 2 Often, overfitting associated with very large

More information

ITS Introduction to R course

ITS Introduction to R course ITS Introduction to R course Nov. 29, 2018 Using this document Code blocks and R code have a grey background (note, code nested in the text is not highlighted in the pdf version of this document but is

More information

Introduction to R. Adrienn Szabó. DMS Group, MTA SZTAKI. Aug 30, /62

Introduction to R. Adrienn Szabó. DMS Group, MTA SZTAKI. Aug 30, /62 Introduction to R Adrienn Szabó DMS Group, MTA SZTAKI Aug 30, 2014 1/62 1 What is R? What is R for? Who is R for? 2 Basics Data Structures Control Structures 3 ExtRa stuff R packages Unit testing in R

More information

Column and row space of a matrix

Column and row space of a matrix Column and row space of a matrix Recall that we can consider matrices as concatenation of rows or columns. c c 2 c 3 A = r r 2 r 3 a a 2 a 3 a 2 a 22 a 23 a 3 a 32 a 33 The space spanned by columns of

More information

Simple Introduction to R. Rob McCulloch

Simple Introduction to R. Rob McCulloch Simple Introduction to R Rob McCulloch 1. Installing R 2. First R 3. Getting Your Data Into R 4. Simple Statistics in R 5. Using Files of Commands 6. Factors and Tables 7. Getting Help in R 8. Simple Linear

More information

Statistics for Biologists: Practicals

Statistics for Biologists: Practicals Statistics for Biologists: Practicals Peter Stoll University of Basel HS 2012 Peter Stoll (University of Basel) Statistics for Biologists: Practicals HS 2012 1 / 22 Outline Getting started Essentials of

More information

PS 6: Regularization. PART A: (Source: HTF page 95) The Ridge regression problem is:

PS 6: Regularization. PART A: (Source: HTF page 95) The Ridge regression problem is: Economics 1660: Big Data PS 6: Regularization Prof. Daniel Björkegren PART A: (Source: HTF page 95) The Ridge regression problem is: : β "#$%& = argmin (y # β 2 x #4 β 4 ) 6 6 + λ β 4 #89 Consider the

More information

Matrix Multiplication

Matrix Multiplication Matrix Multiplication CPS343 Parallel and High Performance Computing Spring 2018 CPS343 (Parallel and HPC) Matrix Multiplication Spring 2018 1 / 32 Outline 1 Matrix operations Importance Dense and sparse

More information

Applied Regression Modeling: A Business Approach

Applied Regression Modeling: A Business Approach i Applied Regression Modeling: A Business Approach Computer software help: SAS SAS (originally Statistical Analysis Software ) is a commercial statistical software package based on a powerful programming

More information

R (and S, and S-Plus, another program based on S) is an interactive, interpretive, function language.

R (and S, and S-Plus, another program based on S) is an interactive, interpretive, function language. R R (and S, and S-Plus, another program based on S) is an interactive, interpretive, function language. Available on Linux, Unix, Mac, and MS Windows systems. Documentation exists in several volumes, and

More information

MATH3880 Introduction to Statistics and DNA MATH5880 Statistics and DNA Practical Session Monday, 16 November pm BRAGG Cluster

MATH3880 Introduction to Statistics and DNA MATH5880 Statistics and DNA Practical Session Monday, 16 November pm BRAGG Cluster MATH3880 Introduction to Statistics and DNA MATH5880 Statistics and DNA Practical Session Monday, 6 November 2009 3.00 pm BRAGG Cluster This document contains the tasks need to be done and completed by

More information

Here is Kellogg s custom menu for their core statistics class, which can be loaded by typing the do statement shown in the command window at the very

Here is Kellogg s custom menu for their core statistics class, which can be loaded by typing the do statement shown in the command window at the very Here is Kellogg s custom menu for their core statistics class, which can be loaded by typing the do statement shown in the command window at the very bottom of the screen: 4 The univariate statistics command

More information

Subsetting, dplyr, magrittr Author: Lloyd Low; add:

Subsetting, dplyr, magrittr Author: Lloyd Low;  add: Subsetting, dplyr, magrittr Author: Lloyd Low; Email add: wai.low@adelaide.edu.au Introduction So you have got a table with data that might be a mixed of categorical, integer, numeric, etc variables? And

More information

Tabular data management. Jennifer Bryan RStudio, University of British Columbia

Tabular data management. Jennifer Bryan RStudio, University of British Columbia Tabular data management Jennifer Bryan RStudio, University of British Columbia @JennyBryan @jennybc data cleaning data wrangling descriptive stats inferential stats reporting data cleaning data wrangling

More information

R Workshop (16/06/2017 Durham University)

R Workshop (16/06/2017 Durham University) R Workshop (16/06/2017 Durham University) Preliminaries Aim: The aim is to familiarise yourself with some of the basic concepts and tools of the statistical computing environment R and the IDE R Studio.

More information

Getting To Know The Multiform Bivariate Matrix

Getting To Know The Multiform Bivariate Matrix Getting To Know The Multiform Bivariate Matrix 1: Introduction A manipulable matrix is a generic component that can accept a variety of representation forms as elements. Some example elements include bivariate

More information

ECO375 Tutorial 1 Introduction to Stata

ECO375 Tutorial 1 Introduction to Stata ECO375 Tutorial 1 Introduction to Stata Matt Tudball University of Toronto Mississauga September 14, 2017 Matt Tudball (University of Toronto) ECO375H5 September 14, 2017 1 / 25 What Is Stata? Stata is

More information

An Introduction to R. Ed D. J. Berry 9th January 2017

An Introduction to R. Ed D. J. Berry 9th January 2017 An Introduction to R Ed D. J. Berry 9th January 2017 Overview Why now? Why R? General tips Recommended packages Recommended resources 2/48 Why now? Efficiency Pointandclick software just isn't time efficient

More information

Stat 579: More Preliminaries, Reading from Files

Stat 579: More Preliminaries, Reading from Files Stat 579: More Preliminaries, Reading from Files Ranjan Maitra 2220 Snedecor Hall Department of Statistics Iowa State University. Phone: 515-294-7757 maitra@iastate.edu September 1, 2011, 1/10 Some more

More information

2D Object Definition (1/3)

2D Object Definition (1/3) 2D Object Definition (1/3) Lines and Polylines Lines drawn between ordered points to create more complex forms called polylines Same first and last point make closed polyline or polygon Can intersect itself

More information

NCSS 2004/2007 Orientation

NCSS 2004/2007 Orientation NSS 2004/2007 Orientation November 2006 TO: RE: Students enrolled in UB Real Estate Division courses NSS 2004/2007 Orientation Several Real Estate Division courses require the use of statistical software.

More information

Exam 1 - (20 points)

Exam 1 - (20 points) Exam 1 - (20 points) Answer all of the following questions. READ EACH QUESTION CAREFULLY. Fill the correct bubble on your scantron sheet. Each correct answer is worth 1 point (unless otherwise stated).

More information

Practice for Learning R and Learning Latex

Practice for Learning R and Learning Latex Practice for Learning R and Learning Latex Jennifer Pan August, 2011 Latex Environments A) Try to create the following equations: 1. 5+6 α = β2 2. P r( 1.96 Z 1.96) = 0.95 ( ) ( ) sy 1 r 2 3. ˆβx = r xy

More information

plot(seq(0,10,1), seq(0,10,1), main = "the Title", xlim=c(1,20), ylim=c(1,20), col="darkblue");

plot(seq(0,10,1), seq(0,10,1), main = the Title, xlim=c(1,20), ylim=c(1,20), col=darkblue); R for Biologists Day 3 Graphing and Making Maps with Your Data Graphing is a pretty convenient use for R, especially in Rstudio. plot() is the most generalized graphing function. If you give it all numeric

More information

NEURAL NETWORKS. Cement. Blast Furnace Slag. Fly Ash. Water. Superplasticizer. Coarse Aggregate. Fine Aggregate. Age

NEURAL NETWORKS. Cement. Blast Furnace Slag. Fly Ash. Water. Superplasticizer. Coarse Aggregate. Fine Aggregate. Age NEURAL NETWORKS As an introduction, we ll tackle a prediction task with a continuous variable. We ll reproduce research from the field of cement and concrete manufacturing that seeks to model the compressive

More information

Objectives of this lesson

Objectives of this lesson FONDAMENTI DI INFORMATICA Prof. Luigi Ingrosso Luigi.Maria.Ingrosso@uniroma2.it 04/04/16 Computer Skills - Lesson 4 - L.Ingrosso 2 Objectives of this lesson We ll discuss Vector and matrix introduction

More information

Lecture 1: Getting Started and Data Basics

Lecture 1: Getting Started and Data Basics Lecture 1: Getting Started and Data Basics The first lecture is intended to provide you the basics for running R. Outline: 1. An Introductory R Session 2. R as a Calculator 3. Import, export and manipulate

More information

Introduction to R: Part I

Introduction to R: Part I Introduction to R: Part I Jeffrey C. Miecznikowski March 26, 2015 R impact R is the 13th most popular language by IEEE Spectrum (2014) Google uses R for ROI calculations Ford uses R to improve vehicle

More information

This document is designed to get you started with using R

This document is designed to get you started with using R An Introduction to R This document is designed to get you started with using R We will learn about what R is and its advantages over other statistics packages the basics of R plotting data and graphs What

More information

ENGR/CS 101 CS Session Lecture 12

ENGR/CS 101 CS Session Lecture 12 ENGR/CS 101 CS Session Lecture 12 Log into Windows/ACENET (reboot if in Linux) Use web browser to go to session webpage http://csserver.evansville.edu/~hwang/f14-courses/cs101.html Right-click on lecture12.py

More information

A brief introduction to R

A brief introduction to R A brief introduction to R Ionuţ Florescu Dept. of Mathematical Sciences Stevens Institute of Technology May 15, 2009 1 What is R? Where to obtain it? R is a software package, one of the most versatile

More information

An Introduction to R for Analyzing Acoustic Telemetry Data. Thomas Binder, Todd Hayden, and Christopher Holbrook

An Introduction to R for Analyzing Acoustic Telemetry Data. Thomas Binder, Todd Hayden, and Christopher Holbrook An Introduction to R for Analyzing Acoustic Telemetry Data Thomas Binder, Todd Hayden, and Christopher Holbrook Version 2.0: February 19, 2018 An Introduction to R for Analyzing Acoustic Telemetry Data

More information

University of the Virgin Islands, St. Thomas January 15, 2015 Algorithms and Programming for High Schoolers. Lab 6

University of the Virgin Islands, St. Thomas January 15, 2015 Algorithms and Programming for High Schoolers. Lab 6 University of the Virgin Islands, St. Thomas January 15, 2015 Algorithms and Programming for High Schoolers Lab 6 Exercise 1: memoization: Consider the recursive makechange implementation in the lecture

More information

Practical 2: Plotting

Practical 2: Plotting Practical 2: Plotting Complete this sheet as you work through it. If you run into problems, then ask for help - don t skip sections! Open Rstudio and store any files you download or create in a directory

More information

General Instructions. You can use QtSpim simulator to work on these assignments.

General Instructions. You can use QtSpim simulator to work on these assignments. General Instructions You can use QtSpim simulator to work on these assignments. Only one member of each group has to submit the assignment. Please Make sure that there is no duplicate submission from your

More information

1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in increasing order).

1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in increasing order). Exercises Exercises 1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in increasing order). a) {(1, 1), (1, 2), (1, 3)} b) {(1, 2), (2, 1), (2, 2), (3,

More information

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors. Physics 326G Winter 2008 Class 2 In this class you will learn how to define and work with arrays or vectors. Matlab is designed to work with arrays. An array is a list of numbers (or other things) arranged

More information

Information Visualization

Information Visualization Information Visualization Text: Information visualization, Robert Spence, Addison-Wesley, 2001 What Visualization? Process of making a computer image or graph for giving an insight on data/information

More information

MATLAB Part 1. Introduction

MATLAB Part 1. Introduction MATLAB Part 1 Introduction MATLAB is problem solving environment which provides engineers and scientists an easy-to-use platform for a wide range of computational problems. In general, it is useful for

More information

Course # and Section #: MTH 120: WN 110 Start Date: Feb. 2, The following CHECKED items are ALLOWED to be taken in the testing room by students;

Course # and Section #: MTH 120: WN 110 Start Date: Feb. 2, The following CHECKED items are ALLOWED to be taken in the testing room by students; DELTA COLLEGE ACADEMIC TESTING CENTER Printed Name of Student Taking Exam EXAM COVERSHEET Instructor s Name: Jim Ham Exam #: Course # and Section #: MTH 2: WN Start Date: Feb. 2, 22 Type of Exam: Out-of

More information

Landmark based Registration with the Umeyama Method

Landmark based Registration with the Umeyama Method Junior-Prof. Dr. Olaf Ronneberger, Image Analysis Lab, Institute of Computer Science, Albert-Ludwigs-University Freiburg Exercises for 3D Image Analysis Summer term 2015 Exercise 4 (Issue Date: 09.06.2015,

More information

DATA STRUCTURE AND ALGORITHM USING PYTHON

DATA STRUCTURE AND ALGORITHM USING PYTHON DATA STRUCTURE AND ALGORITHM USING PYTHON Common Use Python Module II Peter Lo Pandas Data Structures and Data Analysis tools 2 What is Pandas? Pandas is an open-source Python library providing highperformance,

More information

An Introductory Tutorial: Learning R for Quantitative Thinking in the Life Sciences. Scott C Merrill. September 5 th, 2012

An Introductory Tutorial: Learning R for Quantitative Thinking in the Life Sciences. Scott C Merrill. September 5 th, 2012 An Introductory Tutorial: Learning R for Quantitative Thinking in the Life Sciences Scott C Merrill September 5 th, 2012 Chapter 2 Additional help tools Last week you asked about getting help on packages.

More information

EE 301 Signals & Systems I MATLAB Tutorial with Questions

EE 301 Signals & Systems I MATLAB Tutorial with Questions EE 301 Signals & Systems I MATLAB Tutorial with Questions Under the content of the course EE-301, this semester, some MATLAB questions will be assigned in addition to the usual theoretical questions. This

More information

Introduction to Julia. HA Van Thao Faculty of Math & Computer Science, HCMUS

Introduction to Julia. HA Van Thao Faculty of Math & Computer Science, HCMUS Introduction to Julia HA Van Thao Faculty of Math & Computer Science, HCMUS What is Julia? a new programming language for scientic computing developed by a group mostly from MIT MIT licensed: free and

More information

Lecture 5: Arrays. A way to organize data. MIT AITI April 9th, 2005

Lecture 5: Arrays. A way to organize data. MIT AITI April 9th, 2005 Lecture 5: Arrays A way to organize data MIT AITI April 9th, 2005 1 What are Arrays? An array is a series of compartments to store data. Essentially a block of variables. In Java, arrays can only hold

More information

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties. Standard 1: Number Sense and Computation Students simplify and compare expressions. They use rational exponents and simplify square roots. IM1.1.1 Compare real number expressions. IM1.1.2 Simplify square

More information

A First Book of ANSI C Fourth Edition. Chapter 8 Arrays

A First Book of ANSI C Fourth Edition. Chapter 8 Arrays A First Book of ANSI C Fourth Edition Chapter 8 Arrays Objectives One-Dimensional Arrays Array Initialization Arrays as Function Arguments Case Study: Computing Averages and Standard Deviations Two-Dimensional

More information

int64 : 64 bits integer vectors

int64 : 64 bits integer vectors int64 : 64 bits integer vectors Romain François - romain@r-enthusiasts.com int64 version 1.1.2 Abstract The int64 package adds 64 bit integer vectors to R. The package provides the int64 and uint64 classes

More information

Introduction to scientific programming in R

Introduction to scientific programming in R Introduction to scientific programming in R John M. Drake & Pejman Rohani 1 Introduction This course will use the R language programming environment for computer modeling. The purpose of this exercise

More information

HYPERVARIATE DATA VISUALIZATION

HYPERVARIATE DATA VISUALIZATION HYPERVARIATE DATA VISUALIZATION Prof. Rahul C. Basole CS/MGT 8803-DV > January 25, 2017 Agenda Hypervariate Data Project Elevator Pitch Hypervariate Data (n > 3) Many well-known visualization techniques

More information

Figure 3.20: Visualize the Titanic Dataset

Figure 3.20: Visualize the Titanic Dataset 80 Chapter 3. Data Mining with Azure Machine Learning Studio Figure 3.20: Visualize the Titanic Dataset 3. After verifying the output, we will cast categorical values to the corresponding columns. To begin,

More information

Instructions and Result Summary

Instructions and Result Summary Instructions and Result Summary VU Biostatistics and Experimental Design PLA.216 Exercise 1 Introduction to R & Biostatistics Name and Student ID MAXIMILIANE MUSTERFRAU 01330974 Name and Student ID JOHN

More information

2 SUBSETS OF DATAFRAMES 6

2 SUBSETS OF DATAFRAMES 6 2 SUBSETS OF DATAFRAMES 6 Exercise 4 For a more challenging data input task, input the data from the file bostonc.txt. You can create this by attaching the DAAG package (enter library(daag)) and entering

More information

Advanced R Programming - Lecture 1

Advanced R Programming - Lecture 1 Advanced R Programming - Lecture 1 Krzysztof Bartoszek (slides by Leif Jonsson and Måns Magnusson) Linköping University krzysztof.bartoszek@liu.se 29 August 2017 1/ 43 Today 1 Aim of the course 2 3 4 5

More information

CS Introduction to Computational and Data Science. Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017

CS Introduction to Computational and Data Science. Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017 CS 133 - Introduction to Computational and Data Science Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017 Announcement Read book to page 44. Final project Today

More information

Programming for Engineers Arrays

Programming for Engineers Arrays Programming for Engineers Arrays ICEN 200 Spring 2018 Prof. Dola Saha 1 Array Ø Arrays are data structures consisting of related data items of the same type. Ø A group of contiguous memory locations that

More information

Introduction to R. Daniel Berglund. 9 November 2017

Introduction to R. Daniel Berglund. 9 November 2017 Introduction to R Daniel Berglund 9 November 2017 1 / 15 R R is available at the KTH computers If you want to install it yourself it is available at https://cran.r-project.org/ Rstudio an IDE for R is

More information

Computer Graphics. Coordinate Systems and Change of Frames. Based on slides by Dianna Xu, Bryn Mawr College

Computer Graphics. Coordinate Systems and Change of Frames. Based on slides by Dianna Xu, Bryn Mawr College Computer Graphics Coordinate Systems and Change of Frames Based on slides by Dianna Xu, Bryn Mawr College Linear Independence A set of vectors independent if is linearly If a set of vectors is linearly

More information

Maths for Signals and Systems Linear Algebra in Engineering. Some problems by Gilbert Strang

Maths for Signals and Systems Linear Algebra in Engineering. Some problems by Gilbert Strang Maths for Signals and Systems Linear Algebra in Engineering Some problems by Gilbert Strang Problems. Consider u, v, w to be non-zero vectors in R 7. These vectors span a vector space. What are the possible

More information

Data Abstractions. National Chiao Tung University Chun-Jen Tsai 05/23/2012

Data Abstractions. National Chiao Tung University Chun-Jen Tsai 05/23/2012 Data Abstractions National Chiao Tung University Chun-Jen Tsai 05/23/2012 Concept of Data Structures How do we store some conceptual structure in a linear memory? For example, an organization chart: 2/32

More information

CSE 230 Intermediate Programming in C and C++ Arrays and Pointers

CSE 230 Intermediate Programming in C and C++ Arrays and Pointers CSE 230 Intermediate Programming in C and C++ Arrays and Pointers Fall 2017 Stony Brook University Instructor: Shebuti Rayana http://www3.cs.stonybrook.edu/~cse230/ Definition: Arrays A collection of elements

More information

CS434 Notebook. April 19. Data Mining and Data Warehouse

CS434 Notebook. April 19. Data Mining and Data Warehouse CS434 Notebook April 19 2017 Data Mining and Data Warehouse Table of Contents The DM Process MS s view (DMX)... 3 The Basics... 3 The Three-Step Dance... 3 Few Important Concepts... 4 More on Attributes...

More information

Importing and visualizing data in R. Day 3

Importing and visualizing data in R. Day 3 Importing and visualizing data in R Day 3 R data.frames Like pandas in python, R uses data frame (data.frame) object to support tabular data. These provide: Data input Row- and column-wise manipulation

More information

Section 2.3: Simple Linear Regression: Predictions and Inference

Section 2.3: Simple Linear Regression: Predictions and Inference Section 2.3: Simple Linear Regression: Predictions and Inference Jared S. Murray The University of Texas at Austin McCombs School of Business Suggested reading: OpenIntro Statistics, Chapter 7.4 1 Simple

More information

Exercise Set Decide whether each matrix below is an elementary matrix. (a) (b) (c) (d) Answer:

Exercise Set Decide whether each matrix below is an elementary matrix. (a) (b) (c) (d) Answer: Understand the relationships between statements that are equivalent to the invertibility of a square matrix (Theorem 1.5.3). Use the inversion algorithm to find the inverse of an invertible matrix. Express

More information

GRAD6/8104; INES 8090 Spatial Statistic Spring 2017

GRAD6/8104; INES 8090 Spatial Statistic Spring 2017 Lab #1 Basics in Spatial Statistics (Due Date: 01/30/2017) PURPOSES 1. Get familiar with statistics and GIS 2. Learn to use open-source software R for statistical analysis Before starting your lab, create

More information

Lab1 Part 1: Exploratory Data Analysis & R Basics Big Data Analytics Feb5, 2018

Lab1 Part 1: Exploratory Data Analysis & R Basics Big Data Analytics Feb5, 2018 Lab1 Part 1: Exploratory Data Analysis & R Basics Big Data Analytics Feb5, 2018 Pre-requisites: R and R Studio installed. Preferred versions: R version 3.1.1 or above and R Studio 0.98.1062 or above; any

More information

Matrix Multiplication

Matrix Multiplication Matrix Multiplication CPS343 Parallel and High Performance Computing Spring 2013 CPS343 (Parallel and HPC) Matrix Multiplication Spring 2013 1 / 32 Outline 1 Matrix operations Importance Dense and sparse

More information

How to declare an array in C?

How to declare an array in C? Introduction An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Representation of a large number of homogeneous values.

More information

GWAS Exercises 3 - GWAS with a Quantiative Trait

GWAS Exercises 3 - GWAS with a Quantiative Trait GWAS Exercises 3 - GWAS with a Quantiative Trait Peter Castaldi January 28, 2013 PLINK can also test for genetic associations with a quantitative trait (i.e. a continuous variable). In this exercise, we

More information