title: “R Homework 2” author: “Gabby Krochmal” date: “Ecology Lab - Summer 2017” output: html_document: fig_caption: yes fig_height: 5 fig_width: 5 highlight: tango theme: default toc: yes toc_float: collapsed: no smooth_scroll: no pdf_document: fig_caption: yes fig_crop: no highlight: tango number_sections: no header-includes: - - geometry: margin=1in fontsize: 11pt —

Q1: In your R Markdown file, create two objects and assign different numbers to them. Multiply the objects and assign the result to a new object. Present the results of the objects. Be sure to create a comment that describes what’s going on.

object1 <- 5 #here I assigned a number to the object

object2 <- 2 #here I assigned another number to a different object

object1 * object2 #here I mulitpied both objects

[1] 10

object3 <- object1*object2 #here I assigned the results to another object

Q2: In your R Markdown file, create two objects and assign different vectors to them (of the same length). Multiply the vectors and assign the result to a new object. Present the results. Be sure to create a comment that describes what’s going on.

cat <- c(2,4,6) #assigned a vector to cat

dog <- c(1,3,5) #assigned a vector to dog

cat * dog #multiplied cat * dog

[1] 2 12 30 #results

horse <- cat * dog #created a new object from the results

Q3: Ensure all elements of the R Markdown output file are correct. Make sure the title and name in output are correct.