Day1aR - #more functions min(fib#returns the minimum value of the"fib" vector max(fib#returns the maximum value of the"fib"

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 ###mathematics### 2+2 2^4 sqrt(2) pi log(10) ###variable assignment### x=2 #assigns the value 2 to the variable "x" x #returns the value of "x" 3x #returns error, see below 3*x #returns three times the value of "x" y=3*x+4 #assigns "y" to be three times "x" plus 4 y #returns the value of "y" ###data entry### fib=c(1,1,2,3,5,8) #this creates a vector called "fib" with values 1,1,2,3,5,8 fib #returns the values of "fib" fib[3] #returns the third value of "fib" fib[-2] #returns all values of "fib" except the 2nd fib[c(1,3,5)] #returns the 1st, 3rd and 5th value of "fib" fib==1 #checks each value of "fib" for a value of 1 ###some functions### sum(fib) #sums the values of "fib" length(fib) #returns the length, or number of values of "fib" mean(fib) #returns the mean of "fib" median(fib) #returns the median of "fib" var(fib) #returns the variance of "fib"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ###more functions### min(fib) #returns the minimum value of the "fib" vector max(fib) #returns the maximum value of the "fib" vector cumsum(fib) #returns a running total of the values of "fib" summary(fib) #returns the MIN, Q1, M, Q3, and MAX of "fib" fib=c(fib, 13, 21) #adds new values to the end of "fib" fib #returns the values of "fib" length(fib) #returns the length, or number of values of "fib" fib[9]=34 #adds the value 34 to the 9th place of the "fib" vector fib #returns the values of "fib" data.entry(fib) #opens a spreadsheet for easy data entry hist(fib) #creates a histogram of the values of "fib" boxplot(fib) #creates a boxplot of the values of "fib" help() #opens the help menu help(mean) #opens the help entry for the mean function ?mean #opens the help entry for the mean function...
View Full Document

This note was uploaded on 09/11/2011 for the course STAT 200 taught by Professor Agniel during the Spring '09 term at University of Illinois at Urbana–Champaign.

Ask a homework question - tutors are online