How to write list of communities to csv file?

I used the cluster_louvain function to finding communities in the YouTube-channel network (“lvn” is list):
lvn<-cluster_louvain(undn)
How can I write to a file the found communities and the vertices that are included in these communities? If I use this:
write.csv2(datalvn, file=“cmnt.csv”)
I get an error:

Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class ‘“communities”’ to a data.frame