r - 在 r markdown 中为打印命令修剪空白
问题描述
当我使用命令打印数据帧的字符变量时,R Markdown 在行之间显示不需要的空格print(df[[i]])
我想要的输出将保留换行符,但在行之间没有空格,类似于以下内容。我可以使用 R 中的命令获得它print(df[[i]])
,但我无法在 R Markdown 中获得它
[1] "No negative points"
[2] "The course was too short, not all interesting parts of the method could be covered."
[3] "the exercises to do at home were done together during course hours, which took too long in comparison to learning new stuff daily. furthermore, I would have wished for even more theoretical input instead of the long R exercises (see above)"
更新:问题似乎是在中间乳胶文件中有时降价避免插入 //
. 下面是一个由降价产生的乳胶代码的例子
{[}1{]} ``good overview over underlying principles of web scraping''\\
{[}2{]} ``none''\\
{[}3{]} ``very well presented''\\
{[}4{]} ``- clear distinction between `big data' and `medium data' -
insight into what R can do in terms of webscraping'' {[}5{]} ``- a good
insight into what is possible with R w.r.t. webscraping''
任何帮助表示赞赏
解决方案
鉴于这种:
```{r}
df <- data.frame(c("No negative points", "The course was too short, not all interesting parts of the method could be covered.", "the exercises to do at home were done together during course hours, which took too long in comparison to learning new stuff daily. furthermore, I would have wished for even more theoretical imput instead of the long R exercises (see above)"), stringsAsFactors = FALSE)
```
尝试results
在 Markdown 中使用 R 块的参数:
```{r, results = "asis"}
print(df[[1]])
```
对于像这样的输出:
推荐阅读
- sql - 如何以特定时间在 Oracle 中获取昨天的日期时间?
- c++ - C ++中的“符号无法解析”错误
- sql - 在 QUERY 匹配中使用 TRIM
- node.js - 无法从 Windows 卸载 Angular 1.7.4
- sql - 在数据透视聚合函数中使用 CONCAT 函数的 SQL Server 错误
- docker - Nginx 和 Docker - 将 localhost 端口 8000 暴露给 localhost 端口 80
- java - 如何在 RX Java 中处理嵌套事件
- vba - vba access - datediff
- javascript - 如何在 owl-carousel 中重置 SVG 动画
- java - 使用 firebase 的实时数据库 - 检索特定信息