June 2017
Beginner to intermediate
576 pages
15h 22m
English
Begin by running the first cell (also referred to as a code chunk), which simply will get a count of the number of records by year. You can access the code in this chapter by downloading it from the book's site. Alternatively, you can copy each section of the following code into a new cell and create your own notebook that way.
Since stop frisk has been imported and has already been registered as a table, we can begin to use SQL to read it some of the counts in order to see how large the file is:
#embed all SQL within the sql() functionyr <- sql("SELECT year,frisked,count(*) as year_cnt FROM stopfrisk group by year,frisked") display(yr)
After a few seconds, the output will appear as a simple formatted table. A simple ...