我需要在列表中插入子列表,然后继续项目中的文本:
1. Start of the item text
- First item of sublist;
- Second item of sublist;
More text of the first item.
2. Second Item
3. Third item
Run Code Online (Sandbox Code Playgroud)
嵌套列表后面的文本在渲染后未正确对齐(应与“Start”对齐,与“1.”对齐)。有什么建议吗?
我正在努力理解如何使用{{ }}运算符在自定义函数中传递裸变量名称。当我将运算符与子句结合使用时,出现错误if。
该函数的工作原理:
f <- function(.data, .vars=NULL){
require(dplyr)
df = select(.data, {{ .vars }})
print(head(df))
}
f(iris, c(Species, Sepal.Length))
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#> Species Sepal.Length
#> 1 setosa 5.1
#> 2 setosa 4.9
#> 3 setosa 4.7
#> 4 setosa 4.6
#> 5 …Run Code Online (Sandbox Code Playgroud)