The Incanter macro $
also pulls rows out of a dataset.
In this recipe, we'll see this in action.
For this recipe, we'll use the same dependencies, imports, and data that we did in the Selecting columns with $ recipe.
Like using $
to select columns, there are several ways we can use it to select rows. Refer to the following steps:
We can create a sequence of the values of one row by using
$
and passing it the index of the row we want and:all
for the columns.user=> ($ 0 :all race-data) (100100 160 1 "" "" "" "" "" "Abanda CDP" 192 79 "" "" 192 "" 129 "" 58 "" 0 "" 0 "" 0 "" 2 "" 3 "")
We can also pull out a dataset containing multiple rows by passing more than one index into
$
with a vector.user=> ($ [0 1 2 3 4] :all race-data) [:GEOID :SUMLEV :STATE :COUNTY :CBSA :CSA :NECTA :CNECTA :NAME :POP100 :HU100 :POP100.2000 :HU100.2000 :P003001 :P003001.2000 :P003002 :P003002.2000 :P003003 :P003003.2000 :P003004 :P003004.2000 :P003005 :P003005...