我需要将代表考古遗址的地图与不同考古物体的XY ggplot图表结合起来.地图是在tiff文件中,必须尊重它的比例.
首先,这是地图,以红色突出显示参考比例(在X轴中,从-6000到-4000,例如距离为20米;在Y轴中,从900到2100有12米).
我的ggplot图表是通过运行以下代码获得的:
archaeo <- ggplot() +
geom_ellipsis(data=Unit_H,
aes(x0 = X, y0 = Y, a = Diameter_E.W/2+250, b = Diameter_N.S/2+250, angle = 0),
lwd=0, col="darkgray", fill="gray", alpha=0.15) +
geom_ellipsis(data=Unit_H,
aes(x0 = X, y0 = Y, a = Diameter_E.W/2+120, b = Diameter_N.S/2+120, angle = 0),
lwd=0, col="darkgray", fill="gray", alpha=0.25) +
geom_ellipsis(data=Unit_H,
aes(x0 = X, y0 = Y, a = Diameter_E.W/2, b = Diameter_N.S/2, angle = 0),
lwd=0.5, col="darkgray", fill="gray", alpha=0.75) +
geom_point(data=Unit_H, aes(X, Y), size = 0.5) +
geom_point(data=Refits_H_trans, aes(x,y,group=sample, …
Run Code Online (Sandbox Code Playgroud) 我知道这个问题已经被问在这个论坛(过去的1,2,3)。在您将此标记为重复之前,我尝试了所有答案,但均未成功。大多数问题是很久以前问过的,与之相关的某些更新pandoc
可能会影响当今的结果。
问题是我正在使用RMarkdown撰写科学论文,并希望将结果导出为HTML,PDF或Word文件。
更重要的是,有12位作者在论文上签名。一些作者提出了不止一个隶属关系,有些作者提出了同一隶属关系。
我的问题很清楚:如何将YAML编辑为包括所有作者以及YAML中的所有从属,以便导出为不同的格式(HTML,PDF,DOC)?
我尝试了这个YAML:
---
title: "My title"
author:
- name: Mario Modesto-Mata^1,2^
email: paleomariomm@gmail.com
- name: Christopher^1^
- name: Seaghán Mhartain^2^
- name: Rita Yuri Ynoue^1^
address:
- code: 1
address: Instituto de Astronomía, Geofísica e Ciências Atmosféricas, Universidade de São Paulo
- code: 2
address: Faculdade de Medicina, Universidade de São Paulo
date: "1 October 2018"
output:
pdf_document:
number_sections: yes
toc: yes
toc_depth: …
Run Code Online (Sandbox Code Playgroud) 我需要\"
从矢量中删除.这是我的数据:
data <- c("\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1803224&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Flinux-linux-security-masterclass-3-in-1%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1848638&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Fmastering-kali-linux%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1426684&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Finformation-gathering-with-kali-linux%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1628300&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Flinux-switchblade%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1615700&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Fadministrador-de-sistemas-junior-en-windows-server-y-linux%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.809770&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Flearn-bash-shell-in-linux-for-beginners-lite%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.574388&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Fhow-to-install-linux-ubuntu-server%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1436610&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Fcentos-and-ubuntu-managing-packages%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1771266&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Flinux-foundation-certified-system-administrator-exam%2F",
"\"https://click.linksynergy.com/link?id=RUxZriH*PWc&offerid=323058.1734052&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Flinux-server-security%2F"
)
Run Code Online (Sandbox Code Playgroud)
如您所见,每个对象都以\"
.我怎样才能专门删除这些字符并留下链接?
我正在通过Blogdown
包使用 RStudio 和 HUGO 创建一个网络。
在 RStudio 中本地提供站点时,它似乎正确呈现。所有文件都在文件夹中创建/public
。
但是,当我index.html
从/public
文件夹中打开文件时,我得到了这种外观。
我正在使用Mainroad
这个基本 URL的主题:
baseurl = "/"
知道为什么打开 HTML 文件时它没有正确呈现吗?
为了便于重现,您可以在此处下载数据。它的结构是:
> str(data)
'data.frame': 30 obs. of 4 variables:
$ Count: num -15.26 NaN NaN -7.17 -49.37 ...
$ X1 : Factor w/ 1 level "Mean": 1 1 1 1 1 1 1 1 1 1 ...
$ X2 : Factor w/ 10 levels "DC1","DC10","DC2",..: 1 1 1 3 3 3 4 4 4 5 ...
$ X3 : Factor w/ 3 levels "SAPvsSH","SAPvsTD6",..: 1 2 3 1 2 3 1 2 3 1 ...
Run Code Online (Sandbox Code Playgroud)
我运行这个ggplot图表:
ggplot(data=data, aes(x=X2, …
Run Code Online (Sandbox Code Playgroud) 我有这个数据集,它由3列和5个观察值组成:
sex <- c("M", "M", "F", "F", "F")
var1 <- c(1, 2, 3, 4, 5)
var2 <- c(6, 7, 8, 9, 10)
data <- data.frame(sex, var1, var2)
print(data)
sex var1 var2
1 M 1 6
2 M 2 7
3 F 3 8
4 F 4 9
5 F 5 10
Run Code Online (Sandbox Code Playgroud)
我想在每一列中将每个男性(M
)除以每个女性(F
)。
在这个例子中,这是非常简单的,我想获得var1
的向量1/3
,1/4
,1/5
,2/3
,2/4
和2/5
。
对于var2
,该矢量是6/8
,6/9
,6/10
, …
我一直在努力研究如何通过保持原始结构将表转换为数据框。
这是我正在谈论的表:
sample_size <- structure(c(0L, 2L, 2L, 0L, 3L, 1L, 3L, 9L, 13L, 0L, 0L, 0L,
0L, 1L, 0L, 0L, 0L, 0L, 1L, 2L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L,
2L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 6L, 0L, 9L, 2L, 0L, 0L, 1L,
0L, 0L, 8L, 0L, 6L, 1L, 0L, 0L, 2L, 1L, 3L, 16L, 10L, 0L, 2L,
0L, 0L, 6L, 33L, 4L, 30L, 18L, 3L, 0L, 14L, 1L, 12L, 40L, 1L,
13L, 9L, 0L, …
Run Code Online (Sandbox Code Playgroud) 我有以下代码:
library(ggplot2)
ggplot(data = bayes, aes(x = Order, y = value, fill=key, color=key)) +
geom_rect(aes(xmin = Order, xmax = dplyr::lead(Order), ymin= -Inf, ymax =Inf, colour=Summary),
alpha=0.1) +
geom_line(size=0.5) +
geom_point() +
xlab("Bayesian combination") +
ylab("Bayesian probability") +
theme(legend.position="none") +
ylim(0,1) +
xlim(1,126)
Run Code Online (Sandbox Code Playgroud)
只是为了让您知道我的数据结构:
> str(bayes)
'data.frame': 252 obs. of 5 variables:
$ Summary : chr "1 vs. 6" "1 vs. 6" "1 vs. 6" "1 vs. 6" ...
$ Combination: chr "I1 if I2CP3P4M1M2" "I2 if I1CP3P4M1M2" "C if I1I2P3P4M1M2" …
Run Code Online (Sandbox Code Playgroud) 在继续阅读之前,我建议您下载并查看本论坛发布的此问题中的原始代码。
我运行这个 ggplot 代码:
ggplot(data=data, aes(x=X2, y=Count, group=X3, colour=X3)) +
geom_point(size=5) +
geom_line() +
xlab("Decils") +
ylab("% difference in nº Pk") +
ylim(-50,25) + ggtitle("CL") +
geom_hline(aes(yintercept=0), lwd=1, lty=2) +
scale_x_discrete(limits=c(orden_deciles)) +
coord_polar() +
geom_area(aes(color=X3, fill=X3), alpha=0.2) +
Run Code Online (Sandbox Code Playgroud)
并得到了这个情节:
正如您想象的那样,代码有问题。蓝色组似乎正确着色。我想为所有组着色,以黑色斜线环为参考,代表 0。
我该如何实施?
我在更改 RMarkdown 的 pdf 输出中内联引用的颜色时遇到麻烦。让我们从 YAML 开始:
\n\n---\ntitle: MY TITLE\nauthor: "Mario Modesto-Mata"\ndate: "20 September 2018"\noutput:\n pdf_document:\n highlight: espresso\n number_sections: yes\n toc: yes\n toc_depth: 4\nbibliography: references.bib\ncsl: ajpa.csl\n---\n
Run Code Online (Sandbox Code Playgroud)\n\n正如您所看到的,我指定了参考书目 ( references.bib
) 和引文样式 ( ajpa.csl
)。我必须说它效果非常好。
然而,我正在写一篇很长的手稿,我希望内嵌引文是彩色的,以便读者区分什么是文本和什么是引文。
\n\n这是我的示例,您可以在其中看到内联引用。
\n\n\n\n\nCada diente se forma en un momento concreto bajo una fuerte regulaci\xc3\xb3n\n gen\xc3\xa9tica。为此,请提供一个完整的固定托盘,以进行切割、脱砂、成型\xc3\xb3n 和启动瞬间\xc3\xb3n,然后相对独立地恢复牙科牙医。由于\n的动机,CADA特别是牙科的设计\n特别是定义在功能\XC3\XB3N中的托盘\n的混凝土结构\n CADA DENTE O CLASE DE DENTES\n [@BermudezdeCastrochicoGranDolina2002 ;\n @SmithDentaldevelopmentevolution1991;\n @SmithDentaldevelopmentmeasure1989;\n @SmithPatternsdentaldevelopment1994]。牙科治疗具有可遗传性和相对抵抗性,与营养不良的过程有关,并且存在变异性,存在变异性,在帕特里克·xc3\xb3n 中存在,与营养不良相关的治疗有关。 xa1metros de maduraci\xc3\xb3n esquel\xc3\xa9ticos\n [@Lewisrelationshiptoothformation1960]。
\n
当我使用 RMarkdown 将其转换为 …