小编m-d*_*-dz的帖子

RMarkdown文件中R代码块输出的宽度编织为html

题:

在html文件中设置r代码输出宽度的当前工作解决方案是什么?我想将宽度设置为大的并在html输出中使用滑块.

options(width = XXX) 似乎不再工作了.

例:

---
title: "Width test"
output:
  html_document:
    theme: default
---
```{r global_options, echo = FALSE, include = FALSE}
options(width = 999)
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE,
                      cache = FALSE, tidy = FALSE, size = "small")
```
```{r}
sessionInfo()
```
```{r}
dataM <- matrix(rnorm(100, 5, 2), ncol = 15)
dataM
```
Run Code Online (Sandbox Code Playgroud)

结果:

在此输入图像描述

sessionInfo()输出在上面的截图中.

有关:

(options(width = 999)不适合我)

knitr:如何防止输出中的文本换行?

如何调整RStudio Markdown输出的输出宽度(到HTML)

html css r knitr r-markdown

9
推荐指数
2
解决办法
3968
查看次数

RStudio:使用存储在网络驱动器上的项目中的第一条指令意外调用`dir.create()`

首先,对缺乏可重复的示例表示道歉,但我无法真正提供一个,因为我认为问题在于我的网络设置.请将此问题视为调试问题的求助电话...

在RStudio中打开一个项目,存储在网络驱动器上并运行第一条指令(即它是一个包加载甚至a <- 1),我在控制台中看到一个非常奇怪的输出:

> a <- 1
Warning message:
In dir.create(tempPath, recursive = TRUE) :
  cannot create dir 'F:\Marketing', reason 'Permission denied'
Run Code Online (Sandbox Code Playgroud)

我在用户环境变量(TEMP,TMP,TMPDIR)中设置了所有可能的临时目录,并Sys.getenv()正确打印它们.

"F:\ Marketing"是我的网络驱动器上的有效路径,它是项目的根目录.

我曾尝试debugonce(dir.create)在.RProfile中查看tempPath是什么,但不幸的是,这导致了"无效'envir'参数"错误.

将项目复制到本地驱动器后,问题就消失了,所以这显然是网络驱动器/网络设置问题,但我不知道在哪里挖掘更多和我的IT部门.在这里真的没用......

任何想法如何调试此警告?

windows directory r network-drive rstudio

8
推荐指数
0
解决办法
2072
查看次数

通过devtools :: install_git通过代理从GitLab安装软件包会引发“安装失败:'git2r_clone”错误

执行摘要:

devtools::install_git通过代理与GitLab一起引发Installation failed: Error in 'git2r_clone': failed to send request: A connection with the server could not be established错误。

自定义包(R默认示例):

为了测试我的GitLab和GitHub工作流程,我创建了一些存储库:

git bash:

在文件的.gitconfig建立我公司的代理服务器设置后,我能够访问他们所有HTTPS与例如从混帐bash的控制台git fetch github_public master,在那里github_public简直就是https://github.com/m-dz/md.test_public.git

R:

设置代理(需要使用devtools::install_github)后:

httr::set_config(
  httr::use_proxy(
    url = 'proxy_url',
    port = proxy_port,
    username = 'username',
    password = 'password'
  )
)
Run Code Online (Sandbox Code Playgroud)

和更新都devtoolsgit2r到开发版本(只是要确定)与devtools::install_github我能够使用:

devtools::install_git('https://github.com/m-dz/md.test_public.git', quiet = FALSE)
Run Code Online (Sandbox Code Playgroud)

从GitHub安装公共仓库(但devtools::install_github('m-dz/md.test_public') …

git r devtools libgit2 gitlab

5
推荐指数
0
解决办法
1282
查看次数

find /C "A" 结果为 "find: 'A': No such file or directory"

我正在尝试按照此处的答案计算文件中的行数,例如 using find /C,但我在控制台中看到的只是:

find: '/C': No such file or directory
find: 'A': No such file or directory
Run Code Online (Sandbox Code Playgroud)

我有一个简单的“TEST.txt”文件,其中包含三个 As 和三个 B,都在新行中:

$ type TEST.txt
A
A
A
B
B
B
Run Code Online (Sandbox Code Playgroud)

findstr 似乎工作,但它不能返回计数:

$ type TEST.txt | findstr "A" 
A                             
A                             
A   
Run Code Online (Sandbox Code Playgroud)

查找不起作用:

$ type TEST.txt | find "A"
find: 'A': No such file or directory
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

PS:1中的整个示例也不起作用:

$ findstr /R /N "^" TEST.txt | find /C ":"
find: '/C': No such file or directory …
Run Code Online (Sandbox Code Playgroud)

windows cmd findstr

1
推荐指数
1
解决办法
3073
查看次数

标签 统计

r ×3

windows ×2

cmd ×1

css ×1

devtools ×1

directory ×1

findstr ×1

git ×1

gitlab ×1

html ×1

knitr ×1

libgit2 ×1

network-drive ×1

r-markdown ×1

rstudio ×1