R Markdown HTML输出正在左移底部文本

ilmyapht  于 2023-06-19  发布在  其他
关注(0)|答案(1)|浏览(89)

我正在处理一个HTML输出rmd文件。底部的文字是左移,我不知道为什么。output where bottom text is shifted
这是代码底部的一段

`<p>
  <a class="btn btn-primary" data-toggle="collapse" href="#msrpt" role="button" aria-expanded="false" aria-controls="msrpt">
    Base MSRP vs # of EVs (Tesla filtered)
  </a>
</p>
<div class="collapse" id="msrpt">
{r, echo = FALSE}
ev_pop_data_prices_g %>%
  filter(make != "TESLA") %>% 
  filter(n>500)%>%
  ggplot(mapping = aes(x = base_msrp))+ 
  geom_col(mapping = aes(y = n, fill = make))+
  theme(axis.text.x = element_text(angle = 45, vjust = 0.5, hjust=0.5))+
  scale_fill_manual(values = c25)+
  labs(x = "Base MSRP", y = "Number of EVs")
   </div>
</div> 

This is where text is forced left.  `

此外,如果我尝试添加标题,文本根本不会显示在输出中。No text when adding title
这是代码底部的一段

`<p>
  <a class="btn btn-primary" data-toggle="collapse" href="#msrpt" role="button" aria-expanded="false" aria-controls="msrpt">
    Base MSRP vs # of EVs (Tesla filtered)
  </a>
</p>
<div class="collapse" id="msrpt">
{r, echo = FALSE}
ev_pop_data_prices_g %>%
  filter(make != "TESLA") %>% 
  filter(n>500)%>%
  ggplot(mapping = aes(x = base_msrp))+ 
  geom_col(mapping = aes(y = n, fill = make))+
  theme(axis.text.x = element_text(angle = 45, vjust = 0.5, hjust=0.5))+
  scale_fill_manual(values = c25)+
  labs(x = "Base MSRP", y = "Number of EVs")

   </div>
</div> 

### Different formatting
This is where text is forced left. `

任何帮助将不胜感激。

z31licg0

z31licg01#

插入

<div class="card card-body">

之间

<div class="collapse" id="msrpt">
{r, echo = FALSE}

<div class="collapse" id="msrpt">
<div class="card card-body">
{r, echo = FALSE}

相关问题