1. Use the summary function to gain an overview of the data set. Then display the mean and median # for at least two attributes.

comp <- read.csv(“http://vincentarelbundock.github.io/Rdatasets/csv/Ecdat/Computers.csv” , TRUE,“,”) class(comp)

summary(comp)

result.mean <- mean(comp$price) print(result.mean)

median.result <- median(comp$price) print(median.result)

2. Create a new data frame with a subset of the columns and rows. Make sure to rename it.

comp1795 <- comp[comp$price == 1795, ] View(comp1795)

3. Create new column names for the new data frame.

price_speed <- data.frame(comp\(price,comp\)speed) View(price_speed)

colnames(price_speed)<-c(“price”,“speed”) View(price_speed)

write.csv(price_speed,“pricespeed.csv”,row.names=FALSE) getwd()

4. Use the summary function to create an overview of your new data frame. The print the mean

and median for the same two attributes. Please compare.

price_speed <- data.frame(comp\(price,comp\)speed)

summary(price_speed)

result.mean <- mean(price_speed$comp.price) print(result.mean)

median.result <- median(price_speed$comp.speed) print(median.result)

5. For at least 3 values in a column please rename so that every value in that column is renamed.

For example, suppose I have 20 values of the letter “e” in one column. Rename those values so

that all 20 would show as “excellent”.

compbrand <- read.csv(“/Users/Raghu/compquality.csv” , TRUE,“,”) class(compbrand)

compbrandr <- as.data.frame(sapply(compbrand,gsub,pattern=“High”,replacement=“Excellent”)) compbrandr

View(compbrandr)