R Data Structures.

Slides:



Advertisements
Similar presentations
The Important Thing About By. The Important Thing About ******** The important thing about ***** is *****. It is true s/he can *****, *****, and *****.
Advertisements

Introduction to R Brody Sandel. Topics Approaching your analysis Basic structure of R Basic programming Plotting Spatial data.
5/11/2015IT 3271 Types in ML (Ch 11) datatype bool = true | false; datatype 'element list = nil | :: of 'element * 'element list n Predefined, but not.
Topic-Sensitive PageRank Taher H. Haveliwala Stanford University Presentation by Na Dai.
A) 80 b) 53 c) 13 d) x 2 = : 10 = 3, x 3 = 309.
True/False. False True Subject May Go Here True / False ? Type correct answer here. Type incorrect answer here.
Subspaces, Basis, Dimension, Rank
EGR 106 – Week 3 – More on Arrays Brief review of last week Additional ideas: – Special arrays – Changing an array – Some array operators – Character arrays.
Using Types Slides thanks to Mark Jones. 2 Expressions Have Types: The type of an expression tells you what kind of value you might expect to see if you.
Data, graphics, and programming in R 28.1, 30.1, Daily:10:00-12:45 & 13:45-16:30 EXCEPT WED 4 th 9:00-11:45 & 12:45-15:30 Teacher: Anna Kuparinen.
Basic Lisp CIS 479/579 Bruce R. Maxim UM-Dearborn.
Introduction to R and Statistics Thomas INGICCO G. Courbet, Le désespéré (Autoportrait) G. Courbet, The desperate man (Self-portrait)
Vectors. Find the scalar product of the vectors and.
Unit 2-2: Conditional Statements Mr. Schaab’s Geometry Class Our Lady of Providence Jr.-Sr. High School
$200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200.
Enumeration Types Managing Ordered Sets. Enumeration types are designed to increase the readability of programs Used to define a set of named constants.
Review > x ?log # Old Faithful geyser > lengths seq(from=1, to=10, by=2) > rep(3,times=10) Assign 7 to the variable x Get.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
5 Day Forecast Mon Tues Wed Thu Fri.
Gantt Chart Slingshot Cannon days Mon 7/27/15 Tue 8/11/15
Data Structures [1] CP1 Computing CP1 Data Structures 1.
PowerPointmaths.com © 2004 all rights reserved
How often ……? once a week twice a week every day three times a week
Don't leave yourself short of medication this Christmas!!
GANTT CHARTS Example Example Example Example text Tasks Example 1
Within-Subjects Design
Online Gifts Buy for wishes happy mother's day to yours choice and with happy gifts find here:
Mon – 2Tue – 3Wed – 4Thu - 5Fri - 6Sat - 7Sun - 8 Mon – 9Tue – 10Wed – 11Thu - 12Fri – 13Sat – 14Sun -15 Mon – 16Tue – 17Wed – 18Thu - 19Fri – 20Sat –

Multiplying Matrices.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Hi all! Welcome Back!!!!.
به نام خداوند خورشید و ماه
The final zeroes are not significant, they don’t have an impact on the size of the number. So these numbers are equal. They have the same value – 4/10.
MON TUE WED THU
January MON TUE WED THU FRI SAT SUN
January MON TUE WED THU FRI SAT SUN

How much revision will you do today?
Photographer’s Name Here
January Sun Mon Tue Wed Thu Fri Sat
CS 363 – Chapter 7 Chapter 7 – type systems Types that are supported
2008 Calendar.
Group #? member name Artist’s Name Here.
Multiplying Matrices.
Sun Mon Tue Wed Thu Fri Sat
No written homework this week due to testing
Introduction to R v
Mary’s Story Attendance Matters.
Sun Mon Tue Wed Thu Fri Sat
Lesson What is a variable? - Combining like terms
Lesson What is a variable? - Combining like terms
Continuous Improvement for Writing
Creating a dataset in R Instructor: Li, Han
1/○~1/○ weekly schedule MON TUE WED THU FRI SAT SUN MEMO
2016 | 10 OCT SUN MON TUE WED THU FRI SAT
Multiplying Matrices.
Sun Mon Tue Wed Thu Fri Sat
What is the slope of the line below? 7/2 2/7 -7/2 -2/7 [Default] [MC Any] [MC All]
WEB PAGES: Tables Welcome Back !.
Multiplying Matrices.
1 January 2018 Sun Mon Tue Wed Thu Fri Sat

Types of Errors And Error Analysis.
Mary’s Story Attendance Matters.
Multiplying Matrices.
Instructor: Mike Panitz
2008 Calendar.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
YEAR 1 Place Value Block 1 – Week 2 Count forwards Count backwards
Presentation transcript:

R Data Structures

Vector 1D Data Structure of fixed type scores[2] scores[c(2,4,3)] 0.8 1.2 3.3 1.8 2.7 1 2 3 4 5 “bob” “dave” “mary” “sue” “alan” scores scores[2] scores[c(2,4,3)] scores[3:5] scores[“mary”] scores[c(“mary”,”sue”)]

List Collection of vectors results[[1]] results[[“days”]] results$days 2 1 0.8 1.2 3.3 1.8 2.7 3 4 5 “bob” “dave” “mary” “sue” “alan” 100 300 200 “mon” “tue” “wed” “names” “days” results results[[1]] results[[“days”]] results$days results$days[2:3] results[[1]][“sue”]

Data Frame Collection of vectors with same lengths 1 0.8 0.6 0.2 2 3 4 5 “bob” “dave” “mary” “sue” “alan” “mon” all.results 0.9 0.7 0.3 1.0 0.5 T F “tue” “wed” “pass” all.results[[1]] all.results[[“tue”]] all.results$wed all.results[5,2] all.results[1:3,c(2,4)] all.results[c(“bob”,“dave”),] all.results[,2:3]

Creating lists / data frames list(vector1,vector2,vector3) data.frame(vector1,vector2,vector3) list(names=vector1,values=vector2) data.frame(names=vector1,values=vector2) names(my.list) <- c(“age”,“height”,“score”) colnames(my.df) <- c(“age”,“height”,“score”) rownames(my.df) <- c(“bob”,“dave”,“mary”,“sue”)

Spot the mistakes vec1 <- c(31,47,15 52,13) vec2 <- c("Alfie","Bob","Chris",Dave,"Ed") vec3 <- (TRUE,TRUE,FALSE, TRUE ,FALSE) vec4 <- c[41, 67] vec5 <- c("Alfie","Bob,"Chris","Dave") Error: unexpected numeric constant in "vec1 <- c(31,47,15 52“ Error: object 'Dave' not found Error: unexpected ',' in "vec3 <- (TRUE," Error in c[41, 67] : object of type 'builtin' is not subsettable``` Error: unexpected symbol in "vec5 <- c("Alfie","Bob,"Chris"

Spot the mistakes my.vector(1:5) my.list[2] my.data.frame[2:4] nrow(my.data.frame) [1] 10 my.data.frame[300,] Error: could not find function "my.vector" Error in my.vector[2, 3, 4] : incorrect number of dimensions [No error! Works – but don’t do this] Error in `[.data.frame`(my.data.frame, 2:4) : undefined columns selected a b c NA NA NA NA