df1 <- tbl(sc ,"databricks.tablename")
g <- graph_from_data_frame(df1, directed = TRUE, vertices = NULL) # Directed Igraph creation
is_weighted(g) #Check for Weight
pagerank <- page.rank(g ,algo="power")$vector # Page Rank Algorithm
Error message:
Error in page.rank(g, algo = "power") :
At core/centrality/centrality_other.c:1321 : Unknown PageRank algorithm, Invalid value
Some(<code> Error in page.rank(g, algo = "power"): At core/centrality/centrality_other.c:1321 : Unknown PageRank algorithm, Invalid value </code>)
Error in page.rank(g, algo = "power"): At core/centrality/centrality_other.c:1321 : Unknown PageRank algorithm, Invalid value
我正在使用igraph V 1.3.0(更新于2022年4月1日(
我正在databricks笔记本中运行此代码。我已经安装了所需的库。这段代码一直工作到上个月(3月31日(。
install.packages(c("igraph","magrittr","miniCRAN","doSNOW"))
library(miniCRAN)
library(igraph)
library(magrittr)
install.packages(c("RPostgreSQL","DescTools","xgboost","caTools","e1071"))
library(RPostgreSQL)
library(SparkR)
library(sparklyr)
library(dplyr)
library(dbplyr)
library(magrittr)
library(readxl)
library(data.table)
library(RPostgreSQL)
library(DescTools)
library(parallel)
library(readr)
library(tidyr)
sc <- spark_connect(method = "databricks")
我知道2022年4月1日发布的新版本https://cran.r-project.org/web/packages/igraph/index.html
"power"
方法已被弃用,并已在igraph 1.3.0中删除,如变更日志中所示:https://cran.r-project.org/web/packages/igraph/news/news.html请使用其他两种方法中的一种,因为它们更优越。或者,不要指定方法,而是使用默认方法。所有方法都应该给出相同的结果——如果不是,那就是一个错误。
更新:现在我看到文档中仍然提到1.3.0中的"power"
方法。这将在1.3.1中进行更正。