Module # 8 Input/Output, string manipulation and plyr package
VaShay Carpenter
Please following steps 1-3
Step # 1 Import assignment 6 Data-set to R . Then, Run the commend "mean" using Sex as the category (use plyr package for this operation). Last commend in this step: write the resulting output to a file.
> <- read.table("<FileName>.txt", header = TRUE)
>install.packages("pryr")
require(pryr)
require(ISLR)
require(boot)
install.packages("plyr")
library(data.table)
library(plyr)
etc
#----Read file from computer via prompt
Student-assignment-6 <- read.table("<FileName>.txt", header = TRUE)StudentAverage = ddply(Student,"Sex",transform,Grade.Average=mean(Grade))
Student-assignment-6
sex = Student$Sex
mean(Sex)
Original Dataset
Step # 2 Convert the data set to a dataframe for names whos' name contains the letter i, then create a new data set with those names, Write those names to a file separated by comma’s (CSV)
The commends
>write.table(students_gendered_mean, "Students_Gendered_Mean")
# Filter the original data set to include only data for which the student name
# contained the letter i.
>i_students <- subset(students, grepl("i", students$Name, ignore.case=T))
Step # 3
Write the filtered data set and convert it to CSV file
Hint(file.choose() and subset())
Enclosed is the step by step solution for the assignment.
Post your findings on your blog.
Students Filtered by I
GitHub:
Disclaimer:
Generative AI is integrated into my professional workflow for drafting, structural organization, and code optimization. To avoid redundancy, this statement serves as a standing disclaimer for all entries. Generative AI has been utilized to ensure technical accuracy and to facilitate the very documentation requirements mandated by the curriculum available within the course syllabus.

Comments
Post a Comment