Creating Graph object in Tidygraph

Greetings from India

I am practicing and studying Networks using your book

NETWORK ANALYSIS AND VISUALIZATION IN R : QUICK START GUIDE

I am stuck as follows

CREATE EDGE LIST

Join node IDs for destination column

edges<-edges %>%
left_join(nodes,by=c("destination"="label")) %>%
rename(to=id)
edges

Error in rename_impl(): ! Names must be unique. x These names are duplicated: * “to” at locations 5 and 6. Backtrace: 1. … %>% rename(to = id) 3. dplyr:::rename.data.frame(., to = id) 4. tidyselect::eval_rename(expr(c(…)), .data) 5. tidyselect:::rename_impl(…)

Show Traceback

Error in rename_impl(data, names(data), as_quosure(expr, env), strict = strict, :

#Select/keep only columns from and to

edges<-edges %>%
select(edges,from,to, weight)
edges

Error in `select()`: ! Must subset columns with a valid subscript vector. x Subscript has the wrong type `tbl_df< source : character destination: character weight : double from : integer to : integer >`. ℹ It must be numeric or character. Backtrace: 1. edges %>% select(edges, from, to, weight) 24. rlang::cnd_signal(x)

![|18x18](imap://dharma%40metricuk%2Ecom@imap.gmail.com:993/fetch%3EUID%3E%5E%5BGmail%5D%5E%5ESent%2520Mail%3E19463?part=1.1.2.2&filename=mfgjmkeggeimfapm.png) Show Traceback

Error in select(., edges, from, to, weight) :

Please guide

Could you please add an example to show what you are trying to achieve?