Fork your TA’s GitHub repo to get started. Submit your solutions via a pull request on GitHub by the beginning of tutorial on Friday.
- Write R code that replicates the functionality of the head function we used in Unix. Your code should define a variable with the file to return lines from and a variable representing the number of lines to be returned from the top of the indicated file. The selected file content should be printed to the terminal in R.
- use the 'iris.csv' file to complete this
- Load the data contained in the provided ‘iris.csv’ file and write R code to do the following things
- print the last 2 rows in the last 2 columns to the R terminal
- get the number of observations for each species included in the data set
- get rows with Sepal.Width > 3.5
- write the data for the species setosa to a comma-delimited file names ‘setosa.csv’
- calculate the mean, minimum, and maximum of Petal.Length for observations of virginica
Once you have committed all changes to your local Git repos and pushed all of those commits to the forked repo on GitHub, you can “turn in” your assignment using a pull request. This can be done from the GitHub repo website. When viewing the forked repo, select “Pull requests” in the upper middle of the screen, then click the green “New pull request” button in the upper right. You’ll then see a screen with a history of commits for you and your collaborator, select the green “Create pull request button”. In the text box next to your user icon near the top of the page, remove whatever text is there and add your last name. Then click the green “Create pull request” button.