Create graph from data frame - rows as vertices and common column as edges?

I’m having a bit of trouble using graph_from_data_frame properly - ERROR: ... the data frame should contain at least two columns when it already does.

I have a data frame, lets use a cohort of students as an example.

Each row is a student name, and there are multiple columns of metadata. For example, I would like to use a column labelled “Class”, denoting which class they’re in (lets say it’s ABCDEFG). I would like to make a graph such that every student is a vertice, and students with the same value in the “Class” column get an undirected edge.

How would this command look like?