--- author: "Write your name here" number: STUDENT_NUMBER title: "Homework 2" subtitle: "Computing in Molecular Biology 1 – Molecular Biology and Genetics Department" description: "First rehearsal for Midterm Exam" date: "October 9, 2019" output: html_document: number_sections: yes self_contained: no --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Using R ## Write the R command to make a vector with 30 even numbers starting from 6 ```{r q1a} # write your answer here ``` ## Write the R command to make a vector with 20 copies of the number 9 ```{r q1b} # write your answer here ``` ## Write the R command to produce this vector ```{r q1c} # write your answer here ``` ## Write the R command to produce this vector ```{r q1d} # write your answer here ``` ## Write the R command to create a logic vector, which is `TRUE` for the elements of `state.area` that are greater than 5E4 ```{r q1e} # write your answer here ``` # Using indices ## Show the first 4 elements of the vector `state.abb` ```{r q2a} # write your answer here ``` ## Show all the elements of the vector `state.abb`, except the first 40 ```{r q2b} # write your answer here ``` ## Show the elements of the vector `state.name` corresponding to states whose area is greater than 2E5 ```{r q2c} # write your answer here ``` ## Create a vector with the values 1, 2, 3, and 4, and with names "one", "two", "three", and "four". Assign this vector to the variable `x`. Then show the content of `x` ```{r q2d} # write your answer here ``` ## Using the name as index, show the value of `two` in the vextor `x` ```{r q2e} # write your answer here ``` # About Computing Please provide an original answer the following questions, using your own words. All answers should be personal and original. ## What is a *computer*? what are computers useful for? > REPLACE THIS WITH YOUR ANSWER ## What are the parts of a computer? > REPLACE THIS WITH YOUR ANSWER ## How do computers represent information? > REPLACE THIS WITH YOUR ANSWER ## What is a *prompt*? What is the interpretation? > REPLACE THIS WITH YOUR ANSWER ## Can you use *Microsoft Word* for scientific computing? > REPLACE THIS WITH YOUR ANSWER ## What are the advantages of *Markdown* as a way to represent documents? > REPLACE THIS WITH YOUR ANSWER # About R Please answer the following questions: ## Which are the basic *data types in R*? > REPLACE THIS WITH YOUR ANSWER ## What is the meaning of `NA`? Why it is useful? > REPLACE THIS WITH YOUR ANSWER ## What types of data can be used as indices of vectors in R? What are the advantages of each one? > REPLACE THIS WITH YOUR ANSWER