## 1 Home prices A realtor kept track of the asking orices of 37 homes for sale in West Lafayette, Indiana, in a particular year. Unfortunately for us, the data are as shown...


## 1 Home prices


A realtor kept track of the asking orices of 37 homes for sale in West Lafayette, Indiana, in a particular year. Unfortunately for us, the data are as shown inhttp://ritsokiguess.site/datafiles/homes.txt. The small numbers, 3 and 4, on lines by themselves, are the number of bedrooms of the homes whose asking prices follow that number. The actual asking prices, in dollars, are aligned in columns, up to six of them in a line.






We need to get these data into a tidy format, with one column being the number of bedrooms and the other being the asking price of the home.






The question has three parts, but you will spend most of your time and thinking on part (b). Part (c) is straightforward once you have done part (b).


## 1a. Read in the (untidy) data from the file, in a way that you get all the data values. To make sure that R reads all six columns, set up a vector of six column names (it does not matter what they are) and tell the appropriate read_ function to use these as the column names. (You will have to look this last thing up. Say where you found the answer.)


## 1b. Obtain a tidy dataframe, according to the specifications in the question. Describe your process clearly enough that anyone reading your answer would be able to do it themselves and see why it works. Hints: you might find it useful to find out about the following, if you don't already know about them: - drop_na, ifelse, fill. Also think about how you know whether a number in the data file is a selling price or a number of bedrooms.






## 1c. Use your tidy dataframe to make a boxplot of these data.



Nov 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here