yaml.load() 中的错误:缺少参数 "error.label",没有默认值

Error in yaml.load(): argument "error.label" is missing, with no default

我目前正在尝试 运行 R 上的 MAPPER 算法,并通过此处网站上的一些基本示例进行工作:

http://bertrand.michel.perso.math.cnrs.fr/Enseignements/TDA/Mapper.html

我使用的代码如下:

library(TDAmapper)
library(networkD3)

First.Example.data = data.frame( x=2*cos(0.5*(1:100)), y=sin(1:100) )

First.Example.dist = dist(First.Example.data)

First.Example.mapper <- mapper(dist_object = First.Example.dist,
           filter_values = First.Example.data$x,
           num_intervals = 6,
           percent_overlap = 50,
           num_bins_when_clustering = 10)

MapperNodes <- mapperVertices(First.Example.mapper, 1:100 )
MapperLinks <- mapperEdges(First.Example.mapper)

forceNetwork(Nodes = MapperNodes, Links = MapperLinks, 
            Source = "Linksource", Target = "Linktarget",
            Value = "Linkvalue", NodeID = "Nodename",
            Group = "Nodegroup", opacity = 1, 
            linkDistance = 10, charge = -400)  

但是,当我 运行 这段代码时,我不断收到这个错误,我不知道如何修复:

Error in yaml.load(readLines(con), error.label = error.label, ...) : 
  argument "error.label" is missing, with no default

有人可以告诉我如何解决这个问题吗?


我已经尝试重新安装 R、TDAMapper 和 networkD3,一切似乎都或多或少地安装好了。但是,我在安装 networkD3 期间收到了这条消息,may/may 对诊断问题没有帮助。

trying URL 'https://mirrors.ebi.ac.uk/CRAN/bin/windows/contrib/3.4/BH_1.66.0-1.zip'

Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://mirrors.ebi.ac.uk/CRAN/bin/windows/contrib/3.4/BH_1.66.0-1.zip'

In addition: Warning message: In download.file(url, destfile, method, mode = "wb", ...) :
InternetOpenUrl failed: 'The operation timed out'

Warning in download.packages(pkgs, destdir = tmpd, available = available, : download of package ‘BH’ failed trying URL 'https://mirrors.ebi.ac.uk/CRAN/bin/windows/contrib/3.4/plogr_0.1-1.zip'

Content type 'application/zip' length 17919 bytes (17 KB) downloaded 17 KB

mappermapperVerticesmapperEdges功能目前仅在TDAmapper的开发版中可用。您可以使用(必须安装devtools包)安装它...

devtools::install_github("paultpearson/TDAmapper")

之后,您的示例应该可以工作了。

否决票可能是因为您的 "reproducible" 示例不是 "reproducible",但这只是一个猜测,因为它不是我的。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>forceNetwork</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdn.rawgit.com/ramnathv/htmlwidgets/master/inst/www/htmlwidgets.js"></script>
<script src="https://cdn.rawgit.com/christophergandrud/networkD3/master/inst/htmlwidgets/forceNetwork.js"></script>
</head>
<body style="background-color: white;">
<div id="htmlwidget_container">
<div id="htmlwidget-1d269226bedddd51dcd0" class="forceNetwork html-widget" style="width:960px;height:500px;">

</div>
</div>
<script type="application/json" data-for="htmlwidget-1d269226bedddd51dcd0">{"x":{"links":{"source":[1,2,3,3,4,5,6,7,7],"target":[0,0,1,2,3,4,4,5,6],"value":[2,2,2,2,2,2,2,2,2],"colour":["#666","#666","#666","#666","#666","#666","#666","#666","#666"]},"nodes":{"name":["V1: 82, 57, 32, 7, 95, 70, 20, 45, 71, 8, 96, 33, 58, 83, 69, 6, 94, 31, 56, 81, 19, 44, 17, 18, 80, 43, 55, 68, 30, 5, 93","V2: 54, 4, 55, 17, 21, 46, 96, 58, 59","V3: 29, 92, 80, 67, 42, 71, 8, 33, 34, 84","V4: 79, 54, 4, 29, 16, 41, 47, 22, 66, 3, 91, 72, 9, 97, 34, 59, 84","V5: 85, 60, 35, 73, 10, 98, 15, 40, 41, 47, 22, 66, 3, 91, 28, 53, 78","V6: 86, 11, 10, 73, 48, 15, 65, 2, 27","V7: 61, 36, 99, 98, 23, 78, 40, 90, 52, 77","V8: 25, 50, 75, 61, 36, 11, 99, 24, 49, 74, 12, 100, 37, 62, 87, 27, 52, 77, 76, 51, 26, 1, 89, 64, 14, 39, 88, 63, 13, 38"],"group":[1,2,2,3,4,5,5,6]},"options":{"NodeID":"Nodename","Group":"Nodegroup","colourScale":"d3.scaleOrdinal(d3.schemeCategory20);","fontSize":7,"fontFamily":"serif","clickTextSize":17.5,"linkDistance":10,"linkWidth":"function(d) { return Math.sqrt(d.value); }","charge":-400,"opacity":1,"zoom":false,"legend":false,"arrows":false,"nodesize":false,"radiusCalculation":" Math.sqrt(d.nodesize)+6","bounded":false,"opacityNoHover":0,"clickAction":null}},"evals":[],"jsHooks":[]}</script>
<script type="application/htmlwidget-sizing" data-for="htmlwidget-1d269226bedddd51dcd0">{"viewer":{"width":450,"height":350,"padding":10,"fill":true},"browser":{"width":960,"height":500,"padding":10,"fill":true}}</script>
</body>
</html>