After research, Network3D is R package. You want to create R visual using the sample given. There are two methods.
1. You should create a resource table in Power BI desktop as follows。
Then you add a R visual, select src and target columns as values, it will generates the dataframe automatically, and you can not change it. Type the R script in the zone highlighted in green line, and click run. You will get expected result.
2. You can run r scrip in R visual, and get the data from R scrip, more details in this blog. Then create the desired visual.