我想创建一个长到宽格式的数据集。当我在R控制台上运行这个程序时,它会给出输出。但它不能在R markdown工作。
library(gapminder)
library(dplyr)
library(knitr)
dat <- gapminder%>%
group_by(continent,year) %>%
summarize(mean = mean(lifeExp))
dat1 <- as.data.frame(dat)
res <- reshape( dat1 , timevar ="continent" , idvar ="year", direction =
"wide" , v.names="mean")
kable(res)
但是当我在R markdown运行此程序时,它显示错误消息:[.data.frame
中的错误(data ,,,timevar):选择了未定义的列
电话:...重塑 - &gt; reshapeWide - &gt;独特的 - &gt; [ - &gt; [.data.frame
执行暂停
答案 0 :(得分:3)
通过以下简单的调用对我有用:
import {Component, trigger, state, style, transition, animate} from '@angular/animations';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
animations: [
trigger('slideInOut', [
state('in', style({
transform: 'translate3d(0, 0, 0)'
})),
state('out', style({
transform: 'translate3d(100%, 0, 0)'
})),
transition('in => out', animate('400ms ease-in-out')),
transition('out => in', animate('400ms ease-in-out'))
]),
]
})
export class AppComponent {
title = 'app works!';
toggleMenu() {
}
}