So I guess you want the nominal version of assortativity. Eg.
V(g1)$foo <- sample(1:3, replace=TRUE, vcount(g1))
assortativity.nominal(g1, types=V(g1)$foo)
# [1] -0.2270916
Types must be integers starting from 1. See details in the documentation.