For this week's assignment in R Programming, we are to do the following:
Step 1: Import txt file in R. This file is called Assignment 6 Dataset.txt
Step 2: Use ddply from the plyr package to generate mean of Age and Grade variables split by Sex variable, this will be saved to new variable, Grade.Average
Step 3: Create a new txt file containing new variable Grade.Average. This new txt file will be called Sorted.Average
Step 4: Separate values in Sorted.Average by comma using sep argument, and save it back to Sorted.Average
Step 5: Using the original txt file, filter the names in the list that contain the letter (i). Then, save the result to a new file called DataSubset with the values separated by comma.
Let's take a look at our new files:
Sorted.Average:
DataSubset:
As you can see by the resulting output, the values are separated by commas and the variables are differentiated as they are surrounded by double quotes.
See the code on GitHub: Module 8 Code
~ Katie







No comments:
Post a Comment