In this assignment, you will use R language to:
We will cover the commands used here, along with file paths, during class
This assignment will be completed using RStudio working within an “RProject” in your “Data_Course_LASTNAME” directory.
All file paths should be relative, starting from the main Data_Course directory
Copy and paste the full code used to accomplish tasks 4-10 into a txt file and upload to Canvas
Make sure you include comment lines so it’s easy to see which code sections do which tasks
File > New Project > Existing Directory > Navigate to the new “Data_Course_LASTNAME” directory > Click “Open”
You will now be working in an RProject, meaning that all file paths will be relative and self-contained (we will talk about this)
In RStudio, look at the lower right window and click on the “Files” tab. You should be looking at all the files associated with this RProject. You can navigate through them just like any file explorer. Look in the “Data” directory to see a bunch of data files (You copied these over from my repository).
Open a new Rscript (will appear in the top left window) || File > New File > R script
Write a command that lists all of the .csv files found in the Data/ directory and stores that list in an object called “csv_files”
Find how many files match that description using the length() function
Open the wingspan_vs_mass.csv file and store the contents as an R object named “df” using the read.csv() function
Inspect the first 5 lines of this data set using the head() function
Find any files (recursively) in the Data/ directory that begin with the letter “b” (lowercase)
Write a command that displays the first line of each of those “b” files (this is tricky… use a for-loop)
Do the same thing for all files that end in “.csv”