{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# day1aR - #more functions min(fib#returns the minimum value...

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

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"
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern