美文网首页R可视化小本本
Rmarkdown生成明信片

Rmarkdown生成明信片

作者: 高大石头 | 来源:发表于2020-12-08 14:36 被阅读0次

    只用Rmarkdown就可生成简洁又漂亮的个人明信片(postcards)。

    remotes::install_github("seankross/postcards@main")
    

    一共有4种模板可以选择:

    rmarkdown::draft("index.Rmd","Jolla",package = "postcards")
    rmarkdown::draft("index.Rmd","Jolla-Blue",package = "postcards")
    rmarkdown::draft("index.Rmd","Trestles",package = "postcards")
    rmarkdown::draft("index.Rmd","Onofre",package = "postcards")
    

    在Rmarkdown输入后,经过knitr处理,即可得到目的postcards。下面来欣赏这4种postcards吧

    模板一:

    ---
    title: "Tobi Burns"
    image: "tobi.jpg"
    links:
      - LinkedIn: "https://linkedin.com/"
      - Twitter: "https://twitter.com/"
      - GitHub: "https://github.com/"
      - Email: "mailto:email@email.com"
    output:
      postcards::jolla
    ---
    I am a classically trained data scientist living in the San Fransisco Bay Area. 
    Currently I work on the Oculus team at Facebook. I love talking about baseball, 
    true crime podcasts, and causal inference.
    
    postcards-jolla.png

    模板二:

    ---
    title: "Xiang Guo"
    image: "xiang.jpg"
    links:
      - LinkedIn: "https://linkedin.com/"
      - Twitter: "https://twitter.com/"
      - GitHub: "https://github.com/"
      - Email: "mailto:email@email.com"
    output:
      postcards::jolla_blue
    ---
     
    Raised in New Jersey by two lawyers, I am now an aspiring data artist and 
    competitive rock climber. I moved to Seattle to fly floatplanes, but I got 
    caught up in the startup world. Send me a WhatsApp message if you have good 
    turnip prices.
    
    postcards-jolla-blue.png

    模板三:

    ---
    title: "Frank Hermosillo"
    image: "frank.jpg"
    links:
      - LinkedIn: "https://linkedin.com/"
      - Twitter: "https://twitter.com/"
      - GitHub: "https://github.com/"
      - Email: "mailto:email@email.com"
    output:
      postcards::trestles
    ---
     
    ## Bio
    
    Frank Hermosillo studies neural networks and their applications at Google 
    rain. His research focuses on differentiable network pruning approximation and 
    decentralized gradient inversion mechanics. He frequently collaborates with 
    researchers who study machine learning, computer vision, and cognitive science.
    His work has been featured in WIRED, The Atlantic, Newsweek, and The New York 
    Times Magazine.
    
    ## Education
    
    postcards-trestles.png

    模板四:

    ---
    title: "Willkommen!"
    image: "herzl.jpg"
    color1: "#5A59A3"
    color2: "#C66060"
    angle: 130
    links:
      - YouTube: "https://youtube.com/"
      - Vimeo: "https://vimeo.com/"
      - Twitter: "https://twitter.com/"
      - Email: "mailto:email@email.com"
    output:
      postcards::onofre
    ---
     
    György Herzl is a filmmaker and computational storyteller based in Leipzig,
    Germany. Their work has been featured at the Festival do Rio, Internationale
    Filmfestspiele Berlin, Kunsthalle Basel, and the New Museum of Contemporary Art
    in New York City. "ГУМ" is their latest project which examines the rise of
    consumerism in post-Soviet republics.
    
    postcards-onofre.png

    常见报错:

    常见error原因,多是Pandoc版本较低引起(postcards要求:Pandoc>2.8)。

    解决方案:查看Pandoc版本并更新。

    rmarkdown::pandoc_version()
    rmarkdown::find_pandoc(cache = FALSE)
    

    备注:文章参考翻译自https://github.com/seankross/postcards

    相关文章

      网友评论

        本文标题:Rmarkdown生成明信片

        本文链接:https://www.haomeiwen.com/subject/ienfgktx.html