Knitr 奇怪的输出语言问题

Knitr weird problem with output languages

所以我正在 Rstudio 中使用 Rmarkdown 做一份报告。当然,使用 Knitr 来获取输出。对于 PDF 输出,我安装了 tinytex 包。

报告是英文的,所以我希望日期格式是英文的。

这是文档的开头:

---
title: "MyTitle"
subtitle: "Assignment 3"
date: "`r as.character(Sys.time(), '%d %B')`"
author: "MyName"
output:

  html_document:
    df_print: paged
    theme: paper
    highlight: tango
  pdf_document: default
  html_notebook: default
---

我把那个命令放在那里自动获取当前日期。

现在到了有趣的部分。如果我在 Knitr 下拉菜单中单击 "preview notebook",它会显示:

MyTitle
Assignment 3
MyName
27 February
First, the csv with the data is read.

注意当月的语言,这很重要。这里的语言是英语。都好。 现在,如果我想以 PDF 或 HTML 格式输出它,我会得到:

MyTitle
Assignment 3
MyName
27 fevereiro
First, the csv with the data is read.

月份语言现在是葡萄牙语,我想这是安装的语言。还有我的键盘语言,如果重要的话。

问题是:如何在 PDF 和 HTML 上输出英文? 谢谢

========================

找到答案了!

我的 SO 是 windows10。

  1. 我转到 Windows 设置 window,选择 "Time and Language"
  2. 点击了左侧的 "Region" 按钮
  3. 在 'Regional Format' 部分下的下拉菜单 'Current format' 中选择 "English (Germany)"。

希望这对以后阅读此问题的人有用:)

找到答案了!

我的 SO 是 windows10。

  1. 我转到 Windows 设置 window,选择 "Time and Language"
  2. 点击了左侧的 "Region" 按钮
  3. 在 'Regional Format' 部分下的下拉菜单 'Current format' 中选择 "English (Germany)"。

希望这对以后阅读此问题的人有用:)