r - 如何防止林地被砍伐?
问题描述
我正在创建几个森林地块,但它们都被切断了 RMD。可重现的例子:
author = c("aaaaaaaaaa", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "t", "u", "v", "w", "x")
Ne = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
Me = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
SDe = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
Nc = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
Mc = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
SDc = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
df = data.frame(author, Ne, Me, SDe, Nc, Mc, SDc)
m.cont <- meta::metacont(n.e = Ne,
mean.e = Me,
sd.e = SDe,
n.c = Nc,
mean.c = Mc,
sd.c = SDc,
studlab = author,
data = df,
sm = "SMD",
method.smd = "Hedges",
fixed = FALSE,
random = TRUE,
method.tau = "REML",
hakn = TRUE,
title = "Example")
meta::forest.meta(m.cont,
sortvar = TE,
predict = TRUE,
print.tau2 = FALSE,
leftlabs = c("Author", "g", "SE"),
xlim = "symmetric")
我知道我可以通过运行块获得完整的图形,而无需编织然后扩展图形,但我希望这些图可以在 knit html doc 中呈现。
解决方案
只需在块标题中指定图形的宽度和高度。
---
title: "Testing"
output: html_document
---
```{r,fig.width = 10,fig.height=10}
#above this is where you can add dimensions
author = c("aaaaaaaaaa", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "t", "u", "v", "w", "x")
Ne = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
Me = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
SDe = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
Nc = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
Mc = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
SDc = c(1, 2, 3, 4, 5, 6, 7, 8, 8, 34, 5, 6, 7, 8, 4, 3, 2, 7, 3, 6, 7, 8, 5)
df = data.frame(author, Ne, Me, SDe, Nc, Mc, SDc)
m.cont <- meta::metacont(n.e = Ne,
mean.e = Me,
sd.e = SDe,
n.c = Nc,
mean.c = Mc,
sd.c = SDc,
studlab = author,
data = df,
sm = "SMD",
method.smd = "Hedges",
fixed = FALSE,
random = TRUE,
method.tau = "REML",
hakn = TRUE,
title = "Example")
meta::forest.meta(m.cont,
sortvar = TE,
predict = TRUE,
print.tau2 = FALSE,
leftlabs = c("Author", "g", "SE"),
xlim = "symmetric",)
```
推荐阅读
- python - `groupby` 列未传递给 `apply` 函数。Pandas 中可能存在的错误?
- windows - 如何编写批处理文件以查找文件并复制名称然后显示?
- python - 出现错误:发生意外异常:django 电子邮件中的模板/电子邮件.txt
- javascript - JS函数声明后调用
- node.js - 'TypeError: fs.existsSync 不是函数' ReactJS 和 Electron
- opencv - 裁剪图像如何影响相机校准内在函数?
- ruby - 警告:锁定文件正在更新到 Bundler 2,之后您将无法返回到 Bundler 1
- python - 您如何提交对需要使用 Python 登录 google 帐户的 google 表单的响应?
- javascript - 使用书签访问网页的源代码?
- excel - 如何使宏适用于多个工作表?