Mapping Real Estate Sales in New York City

[This article was first published on R – NYC Data Science Academy Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The most recent version of this app is accessible online here, while its source code may be found here.

This app is a visualization tool for examining real estate sales in New York City, drawing on data published by the City of New York, available here. The data, which cover the years 2003-2015, include a range of variables, including price, size, category of building, location, and date of sale.

The app plots sales from this data on a map to facilitate exploring the connections, in particular, between time, location and price. The following screenshot displays a number of its features:

A screenshot displaying some of the features of this app (click for a larger image)

As can be seen, the main panel of the app consists of a street map of New York City (sourced from the Open Street Map project), with dots plotted on it in varying sizes. Each of these dots represents a single property sale, with blue dots corresponding to residential properties and red ones to non-residential properties. (Note that “property” here is not synonymous with “building”: many property sales are of single condominium units in large apartment buildings.)

The relative size of these dots is set by the second drop-down menu on the left-hand sidebar, labeled Weight by. By default, they are set to a constant size (relative to each other), which is a good format to give an overview of the overall volume and concentrations of sales. Alternatively, however, their sizes can be set to vary in proportion with some property of the sale. In the illustration above, for instance, they are scaled by price, with larger dots corresponding to greater prices. They can be scaled instead by square footage, or by price per square foot*. In each case, the scaling is linear with respect to the dots’ diameters: for instance, if the scaling is to price, then if property A sells for three times as much as property B, its dot will have a diameter three times the size of B‘s. (It follows that its area will be 9 times the size of B’s. Arguably, this may foster a distorted perspective of the underlying price ratio, and for that reason, a later version of this app may well alter this. On the other hand, the substantial difference in relative sizes makes it easy to pick out variations at a glance, whereas smaller variations in size would be harder to see without zooming in on smaller areas of the map.)

Clicking on a particular dot brings up a pop-up bubble displaying salient data points about the sale it represents: address, date, price, and square footage. (Note that all of these data points are displayed when one clicks on a dot, regardless of whether they are reflected in the dots’ scaling.) Clicking again will banish this bubble.

The map may be zoomed in or out via the + and – buttons in its top left corner. The area shown can be changed by clicking the map and dragging it as desired. The adjustable ‘slider’ beneath the map displays the range dates for which sales are plotted. By default, this range is set to thirty days, beginning with the date of the first sale in the loaded dataset, but it can be adjusted by moving the sliding buttons to the endpoints of the date range one is interested in. Alternatively, one may click on the slider to the right or left of the selected range, which keeps the range at the existing size, while ‘jumping’ it to the point clicked. Finally, clicking the play button at the bottom right of the slider causes the selected range to automatically progress from left to right until it has reached the end of the dates available. While this is progressing, the button may be clicked again to pause it.

At present, this app displays only a small fraction of the data available; specifically, it displays sales that took place in the Bronx in 2015. (For this reason, the top drop-down menu in the left sidebar, labeled Year, offers only Hobson’s choice.) However, as I update this app, I intend to make the rest of the data accessible the same way, as well as adding ways to further explore the data. This blog post, too, shall be updated, so check back soon!

*All references to “square footage” here denote gross square footage, meaning total floor space of a property.

To leave a comment for the author, please follow the link and comment on their blog: R – NYC Data Science Academy Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)