1) Explore the rad variable. What kind of variable is rad? What information do you get about this variable with the summary() function? Does the unique() function give you additional information? Use the sum() function to determine how many neighborhoods have rad equal to 24. Use R code to determine what percentage this is of the neighborhoods.

I think I got everything but the sum() function can you please tell me how do I do it?

Here is what I have so far.

typeof(Boston$rad) summary(Boston$rad) unique(Boston$rad)

2) Create a new variable called “far” using the ifelse() function that is TRUE if rad is 24 and false otherwise. Make the variable a factor. Plot far and medv. What does the graph tell?

far<- as.factor(far) far <- ifelse(Boston$rad <-24,1,0)

I know this is not right. Error: Error in is.factor(x) : object 'far' not found

3) 10. Create a summary of Boston just for columns 1, 6, 13 and 14 (crim, rm, lstat, medv). Use the which() function to find the neighborhood with the highest median value. Display that row from the data set, but only colums 1, 6, 13 and 14. Write a few sentences comparing this neighborhood and the city as a whole in terms of: crime, number of rooms, lower economic percent, median value.

This is what I have so far:

summary(Boston$crim) summary(Boston$rm) summary(Boston$lstat) summary(Boston$medv) which(Boston$)

Thank you!