Lab notes in Rmarkdown

To publish an analysis note in the notebook, you need to have blogdown and hugo installed on your computer.

  • install.packages('blogdown')
  • blogdown::install_hugo()
  • git clone this repository (for example git clone https://github.com/hakyimlab/web-internal-notes.git)
  • Go to the folder where you cloned the repo and open RStudio by double clicking internal-notes.Rproj (your Rproj name may be different depending on which repo you cloned)
  • Start a new analysis by adding a New Post from the addin option at the top of the source panel (this creates a folder in the contents/post/ folder with and index.md and subfolders with figures)
  • Choose the title, author, tags
  • Choose the md format unless you will be be running R commands in the post in which case select R Markdown (.Rmd) format option
  • Save the md or Rmd (for the Rmd this will trigger the rendering of the html). The reason we use *.md format instead of the *.Rmd format is the the md format can be edited directly from github and will be rendered automatically. Rmd needs to be rendered by Rstudio.
  • git add, commit and push
  • check your note has been added in https://lab-notes.hakyimlab.org/

Publishing in the internal notebook

Moving posts between different websites

  • To move posts between websites (lab-notes.hakyimlab.org, internal-notes.hakyimlab.org, predictdb.org, etc) just move the specific folder under contents/post. For example, move the folder with all its contents in ~/Github/web-internal-notes/content/post/2020-10-29-first-note-hki/ to ~/Github/web-lab-notes/content/post/2020-10-29-first-note-hki/ or vice versa. When in doubt, publish first on the internal repo.

Netlify is hosting the content here

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The source code is licensed under MIT.

Suggest changes

If you find any mistakes (including typos) or want to suggest changes, please feel free to edit the source file of this page on Github and create a pull request.

Citation

For attribution, please cite this work as

Haky Im (2021). Creating a new post. ImLab Notes. /post/2021/06/16/creating-a-new-post/

BibTeX citation

@misc{
  title = "Creating a new post",
  author = "Haky Im",
  year = "2021",
  journal = "ImLab Notes",
  note = "/post/2021/06/16/creating-a-new-post/"
}