r中NetGraph中点的控制大小

发布于 2025-01-18 17:25:52 字数 100 浏览 2 评论 0原文

在R中,NetGraph()函数采用CEXS。点参数,该参数控制着图中的点的外观。是否可以通过我的.excel中的变量来扩展点的大小?

谢谢你,

我不知道论点

In R, the netgraph() function takes a cex.points argument that controls the appearance of the points in the plot. Is there a way to scale the size of points through a variable in my .excel?

Thank u all

I don't know the arguments

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光与爱终年不遇 2025-01-25 17:25:52

目前尚不清楚您通过“按我的excel中的变量缩放点”的意思,如果您不确定参数,您可以查看netgraph

假设您有这样的点大小的向量:

my_point_sizes <- c(1, 1, 2, 1, 4, 1, 6, 2, 1, 1)

和这样的netmeta对象:

library(netmeta)

load(system.file("/data/Senn2013.rda", package = "netmeta"))

net1 <- netmeta(TE, seTE, treat1, treat2, studlab,
                data = Senn2013, sm = "MD", reference = "plac")

然后,您可以将大小应用到这样的点:

netgraph(net1, points = TRUE, cex.points = my_point_sizes)

“”

在2022-04-03创建的 reprex package (v2.0.1)< /sup>

It's not clear what you mean by "scaling the points by a variable in my Excel", and if you are unsure of the arguments, you could have a look at ?netgraph.

Suppose you had a vector of point sizes like this:

my_point_sizes <- c(1, 1, 2, 1, 4, 1, 6, 2, 1, 1)

And a netmeta object like this:

library(netmeta)

load(system.file("/data/Senn2013.rda", package = "netmeta"))

net1 <- netmeta(TE, seTE, treat1, treat2, studlab,
                data = Senn2013, sm = "MD", reference = "plac")

Then you can apply the sizes to the points like this:

netgraph(net1, points = TRUE, cex.points = my_point_sizes)

Created on 2022-04-03 by the reprex package (v2.0.1)

你在看孤独的风景 2025-01-25 17:25:52

这是一种绘制由数据定义大小的点的方法。函数netmeta是S3类“netmeta”的列表,并且有两个成员treat1treat2

基本 R 函数 table 可以计算频率,但由于它们是两个向量的频率,因此这两个向量必须组合成一个 1 维向量。这是通过c() 完成的。

suppressPackageStartupMessages(library(netmeta))

data(Senn2013)
net1 <- netmeta(TE, seTE, treat1, treat2, studlab,
                data = Senn2013, sm = "MD", reference = "plac")

# points size proportional to data frequencies
pts_size <- table(c(net1$treat1, net1$treat2))

netgraph(net1, points = TRUE, cex.points = pts_size)

reprex 包 (v2.0.1)

Here is a way to plot the points with sizes defined by the data. Function netmeta is a list of S3 class "netmeta" and has two members treat1 and treat2.

Base R function table can compute the frequencies but since they are the frequencies of two vectors, the two vectors must be combined to a 1-dim vector. This is done with c().

suppressPackageStartupMessages(library(netmeta))

data(Senn2013)
net1 <- netmeta(TE, seTE, treat1, treat2, studlab,
                data = Senn2013, sm = "MD", reference = "plac")

# points size proportional to data frequencies
pts_size <- table(c(net1$treat1, net1$treat2))

netgraph(net1, points = TRUE, cex.points = pts_size)

Created on 2022-04-03 by the reprex package (v2.0.1)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文