You forgot to use the which function in the second case; i.e. instead of
s2mestizo <- subgraph(g6,V(g6)$ethnic=="mestizo")
you should write
s2mestizo <- subgraph(g6, which(V(g6)$ethnic=="mestizo"))
Also note that if you use igraph 0.5.x or earlier, you must subtract 1 from the result of which due to indexing of igraph based on 0. This has been fixed in igraph 0.6, so you do not need to subtract 1 if you use igraph 0.6 or newer.
Edit : based on your recent comment, it looks like you are using igraph 0.5.x or earlier (because the output format of summary differs by 0.6). In this case, you must subtract 1 from the result of which , because igraph 0.5.x and earlier versions use zero vertex indices. Therefore, the correct line should be:
s2mestizo <- subgraph(g6, which(V(g6)$ethnic=="mestizo")-1)
Tamás source share