我无法弄清楚为什么degree.distribution不适合我.我试过R i386 3.0.0和R x64 3.0.0.以下是生成图形并显示其分布的简单脚本:
library(igraph)
testG = graph.empty(n=10, directed=TRUE)
for(row in 1 : 5) {
src = row
dest = row + 1
testG = add.edges(testG, rbind(src, as.numeric(dest)))
if(row %% 2 == 0) {
dest = row + 2
testG = add.edges(testG, rbind(src, as.numeric(dest)))
}
}
testG
testD = degree.distribution(testG, v=V(testG), cumulative=FALSE)
testD
plot(1 : length(testD), testD, "h", main="Website Graph Degree Distribution", xlab="Degree", ylab="Probability of Degree")
degree(testG)
Run Code Online (Sandbox Code Playgroud)
testG显示:( IGRAPH D--- 10 7 --有道理).testD显示:( NULL为什么?).该图只有一个值(1,1).但是图表包含具有其他度数的节点,如度数(testG)的输出所证明的那样[1,3,2,4,2,2,0,0,0,0] …
我不小心在Windows中删除了我的Path变量.但我有一份保存在文本文件中的副本.我无法从开始 - >计算机 - >属性 - >高级系统设置 - >环境变量等修改路径变量,因为Windows无法找到systempropertiesadvanced.exe(因为路径为空).所以我想使用cmd.exe中的setx命令设置路径.但我得到的错误是setx不是一个公认的命令(可能是因为路径是空的).那么通常情况下,Windows 7中的setx命令在哪里?此外,如果我在推理中遗漏了一些内容,请告诉我.
我有一个双打向量的向量。我正在尝试初始化它。下面的代码段错误。包括注释代码也无济于事(不编译)。
vector<vector<vector<double> > > Q(MAX_GRID);
for(int row = 0; row < MAX_GRID; row++) {
//vector<vector<double> > inQ(MAX_GRID);
//Q[row].push_back(inQ);
for(int col = 0; col < MAX_GRID; col++)
for(int action = 0; action <= 3; action++)
Q[row][col].push_back(0);
}
Run Code Online (Sandbox Code Playgroud)