我正在尝试为使用Rosdown版本0.98.1028的ioslides_presentation输出类型创建的表创建自己的表格格式.不幸的是我无法更改表头的格式.
这是rmd文件:
---
title: "I can't change table headers with css"
author: "Blah Blah"
date: "August 27, 2014"
output: ioslides_presentation
css: slidetheme.css
---
## Ugly table
A B C
--------- -------- --------
1 2 4
2 3 5
Run Code Online (Sandbox Code Playgroud)
我的css文件:
td, th {
width: 4rem;
height: 2rem;
border: 1px solid #ccc;
text-align: center;
}
td, tr {background:white; background-color:white; color: black;}
th {
background: black;
border-color: white;
}
body {
padding: 1rem;
}
Run Code Online (Sandbox Code Playgroud)
表格分区响应css更改,但标题不会更改.我一直在这里来回,但无法弄清楚发生了什么.有谁知道如何做到这一点 ?
提前谢谢,米格尔
今天,由于数据帧子集操作,我遇到了代码中的错误.我想知道我发现的问题是一个错误还是我违反了R语义.
我正在使用R 2.15.2-61015(Trick或Treat)运行RHEL x86_64.我正在使用基础包中的子集操作.
以下代码应该是可重现的,并且它是在为此测试目的而启动的干净R控制台上运行的.
>teste <-data.frame(teste0=c(1,2,3),teste1=c(3,4,5))
>teste0<-1
>teste1<-1
>subset(teste,teste[,"teste0"]==1 & teste[,"teste1"]==1)
[1] teste0 teste1
<0 rows> (or 0-length row.names)
>subset(teste,teste[,"teste0"]==teste0 & teste[,"teste1"]==teste1)
teste0 teste1
1 1 3
2 2 4
3 3 5
Run Code Online (Sandbox Code Playgroud)
但是,如果我在子集操作之外运行逻辑代码:
>teste[,"teste0"]==teste0 & teste[,"teste1"]==teste1
[1] FALSE FALSE FALSE
Run Code Online (Sandbox Code Playgroud)
我希望两个子集操作都会产生一个空的数据帧.但是,第二个返回完整的数据帧.这是一个错误还是我错过了R环境和名称空间的一些内容?
谢谢你的帮助,米格尔