我使用dplyr函数创建了一个新数据集,其中包含少于4行的名称。
df <- data.frame(name = c("a", "a", "a", "b", "b", "c", "c", "c", "c"), x = 1:9)
aa = df %>%
group_by(name) %>%
filter(n() < 4)
Run Code Online (Sandbox Code Playgroud)
但是当我打字
table(aa$name)
Run Code Online (Sandbox Code Playgroud)
我明白了
a b c
3 2 0
Run Code Online (Sandbox Code Playgroud)
我想让我的输出如下
a b
3 2
Run Code Online (Sandbox Code Playgroud)
如何将新框架aa与df完全分开?
我想在 Rmarkdown 投影仪演示文稿中将作者的名字分成两行。我的 YAML 如下:
---
title: "***"
author:
- Author One
- Author Two
date: "`r format(Sys.time(), '%d %B %Y')`"
fontsize: 14pt
output:
beamer_presentation:
fig_height: 5
fig_width: 8
highlight: tango
theme: metropolis
incremental: true
---
Run Code Online (Sandbox Code Playgroud)
但作者的名字仍然印在同一行上。怎样才能分成两半呢?