Need help on Igraph

I am new to SNA and the use of igraph has made me so frustrated that I wish to give up this project.

Despite my gymnastics, I and constantly getting the following error

Error in graph_from_data_frame(dedge, directed = “TRUE”, vertices = dnode) : Duplicate vertex names

There are at least 20 nodes which are isolated ones. How to code them ? There is some problem there ( I guess)

PLEASE , PLEASE help

As the error message says, you provided duplicate vertices. A small example showing this is as follows.

This works:

graph_from_data_frame(
  data.frame(from=c(1,2),to=c(2,3)), 
  vertices = c(1,2,3))

This fails because vertex 3 is provided twice:

graph_from_data_frame(
  data.frame(from=c(1,2),to=c(2,3)), 
  vertices = c(1,2,3,3))

If you are not sure how this happens with your data, construct a minimal example.

You are an angel ! It worked smoothly. Many thanks. Wish to stay connected with you on LINKED IN
Alternatively my email ID is I reside in India Regards SHRINIVAS