In SPSS it is fairly easy to create a summary table of categorical variables using \"Custom Tables\":
Here is a solution using the freq
function of the questionr
package (shameless autopromotion, sorry) :
R> lapply(df, freq)
$vs
n %
0 18 56.2
1 14 43.8
NA 0 0.0
$am
n %
0 19 59.4
1 13 40.6
NA 0 0.0
$gear
n %
3 15 46.9
4 12 37.5
5 5 15.6
NA 0 0.0
$carb
n %
1 7 21.9
2 10 31.2
3 3 9.4
4 10 31.2
6 1 3.1
8 1 3.1
NA 0 0.0