如何在Rmarkdown中删除特殊注释(PDF输出)

时间:2019-05-28 08:04:49

标签: r-markdown

我正在创建包含一些图形的论文。我只希望图形出现而没有任何警告或代码。因此,我还包括了message = FALSE和warning = FALSE。但是,其他注释仍出现在我的pdf中。如何删除它们?

 ggplot(x_agg_accounts_cumulative_party,
         aes(x=legi_year, y=twitter_account_share)) + 
    facet_grid(~ party_short) +
    geom_bar(stat="identity", width = 0.5, fill="darkcyan") + 
    labs(title="Figure 9. Twitter Account Creation per Party from 2008 to 2019",  
         x=" ",
         y="Share of twitter account", 
         color=NULL)  +
    theme_bw()+
    scale_y_continuous(labels = percent) +
    scale_x_discrete(breaks=c(2008, 2019),limits=c(2008,2019)) +
    theme(axis.text.x = element_text(angle = 45, hjust=1, size = 6),  # rotate x axis text
          panel.grid.minor = element_blank())
  geom_vline(xintercept = y_election_years, color = "gray30", linetype="dashed")```


I expected to have just the graph displayed. However, under the graph appear those comments: 

# mapping: xintercept = ~xintercept## geom_vline: na.rm = FALSE## stat_identity: na.rm = FALSE## position_identity

0 个答案:

没有答案
相关问题