.content a.button:first-of-type {
margin: 20px 0px 0px 0px;
}
.content a.button {
background: #54809b;
color: #ffffff;
text-decoration: none;
display: block;
float: left;
margin: 20px 0px 0px 16px;
font-size: 11px;
padding: 12px 20px;
-webkit-transition: background 0.5s linear;
-moz-transition: background 0.5s linear;
-ms-transition: background 0.5s linear;
-o-transition: background 0.5s linear;
transition: background 0.5s linear;
}
.content a.button:hover {
background: #4d758d;
}
.content a.button i {
margin: 0px 4px 0px 0px;
font-size: 10px;
}
如果我希望每次迭代的关键是例如" iteration1"," iteration2"等等,当我在循环中进行每次迭代时,我将如何构建它?
现在没有钥匙?我认为:<a href="?do=search" class="button"><i class="fa fa-search"></i> Search Coupons</a>
<a href="?do=add" class="button"><i class="fa fa-plus"></i> Add Coupon</a>
返回NULL。我怎样才能使名称或键成为&#34; iteration1&#34;,&#34; iteration2&#34;等?
答案 0 :(得分:2)
你的意思是这样的:
my_list <- list()
for(i in 1:2) {my_list[[paste0("iteration", i)]] <- i^2}
names(my_list)
[1] "iteration1" "iteration2"
或者在循环中使用 命名
my_list <- list()
for(i in 1:2) {my_list[[i]] <- i^2}
names(my_list) <- paste0("iteration", 1:2)