简体   繁体   English

错误:`summarise()` 输入`wt` 的问题:geom_net 函数与新的 dplyr 版本不兼容

[英]Error: Problem with `summarise()` input `wt`: geom_net function incompatible with new dplyr version

I'm using geom_net function from geom_net R package.我正在使用geom_net R 包中的geom_net函数。

Until few months ago I could use the geom_net function with non problems, but now I get the following error:直到几个月前,我还可以geom_net地使用geom_net函数,但现在出现以下错误:

Error: Problem with `summarise()` input `wt`.
x could not find function "n"
ℹ Input `wt` is `n()`.
ℹ The error occured in group 1: 

My understanding of the error is that the summarise() function of dplyr package no longer uses the argument wt=n() as also specified in the dlyr R package recent update.我对错误的理解是dplyr包的summarise()函数不再使用参数wt=n() ,这也在dlyr R 包最近更新中指定。

The problem is that geom_net uses a (now) old version of summarise() which is now incompatible with the new dplyr version.问题是geom_net使用(现在)旧版本的summarise()现在与新的dplyr版本不兼容。

Do you have any suggestion on how to solve the problem?你对如何解决这个问题有什么建议吗?

It looks like there's exactly one line in the geom_net source code that uses dplyr::summarise() with the wt argument:看起来geom_net源代码中只有一行使用dplyr::summarise()wt参数:

edges <- dplyr::summarise(edges, wt = n())  

And the dplyr change log notes that wt is not replaced by anything, you can just omit it.并且dplyr 更改日志指出wt没有被任何东西替换,您可以省略它。

Use of wt = n() is now deprecated;现在不推荐使用 wt = n(); now just omit the wt argument.现在只需省略 wt 参数。

You should be able to just modify your local version of the geom_net package.您应该能够修改geom_net包的本地版本。 Remove the wt argument from that single line.从那一行中删除wt参数。

(Note that this won't necessarily guarantee that geom_net runs without error, just that it resolves the specific issue you're asking about here.) (请注意,这不一定保证geom_net运行没有错误,只是它解决了您在此处询问的特定问题。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM