I’ll start with R. My personal philosophy is that R can do anything, and I’ve yet to be proven wrong. I want to share the wonders of R, but I should start by saying there are thousands of amazing resources online for R, coding, data analysis, GitHub, etc., some of which I’ll link below. What I share here is definitely repeated. So maybe this is more a resource for myself than anyone else. But much of what I have learned came from others’ personal websites, blogs, and answers on stack exchange. So maybe someone out there googling random things on the interweb will find these resources.. I can only hope.
Please contact me if you have questions or want help!
I use GitHub Desktop for my workflow. But you can also use the command line or RStudio to do everything I’m doing below. I’ll share how I use GitHub Desktop, and maybe later I’ll share some other workflows, so stay tuned! This workflow was adapted from Eli Holmes’ Practical R Workflow for Scientists Course, which you can follow along with online. It’s a GREAT resource for begining your GitHub and RStudio journey!
Readme.md
.gitignore
(type R to get the R .gitignore)Documents/GitHub
so they are
easier to find.R and GitHub did this, not me! Here’s a step-by-step of how I built this website, so that even someone with little to no experience with R or GitHub can do it too - because not all scientists use these platforms, but I think all scientists should have a personal website that they don’t have to wrestle with wordpress, wix, squarespace, etc. to build (believe me, I’ve been there). I first learned of this in Ben Best’s R3 Workshop. All the workshop materials and recordings are online, so check it out if you want more RStudio learnings.
picture step-by-step coming soon
Like I showed above, create a new repo in GitHub.
Use your workflow of choice to clone the repo from GitHub to your computers directory. If you’ve never used GitHub before, and you created it to make this website (go you!), the easiest way is to do this all in RStudio,
_site.yml
Your RStudio project is now open! Congrats! In the top right corner you should see the R cube with the name of your repo next to it. In the bottom right window you should see, in the ‘Files’ tab, you are in the project directory. Now,
---
title: "Haley Oleynik (she/her)"
---
Type all your info below this, here’s what my whole index file looks like for reference. Here’s a great short-and-sweet guide on R Markdown, if you’ve never done it. It’s seriously very easy, it just takes a little while to remember all the formatting tricks.
Add more pages! Save another page, maybe
research.Rmd
:
---
title: "Research"
---
Research description, publications, etc.
_site.yml
page. RStudio needs this to
build the website.name: "Haley Oleynik"
navbar:
title: "Haley Oleynik"
left:
- text: "Home"
href: index.html
- text: "Research"
href: research.Rmd
output_dir: "."
_site.yml
Now, to build the website all you’ll need to do is run
rmarkdown::render_site()
in your R console.
To see how it looks, knit your
index.Rmd
or Research.Rmd
. You’ll be able to
view the whole site locally, in your viewer pane (or in a pop up
window).
Now commit
and push
the changes you’ve
made to the files.
Back in your online GitHub repository:
Branch: main, folder / (root)
Now to the fun stuff! These are things I learned slowly while building my website. Since you’re on my website you can see some of these details in action. For example, the theme (journal) and all the icons on the top menu!
Okay this is the easiest, but for me it was surprisingly hard to find all my options. I finally found this awesome resource: A THEME GALLERY.
Another way to try them out is to just change the theme and knit locally to see how they look (I think I did this with almost every theme…)
Here’s a list of all the theme options:
“default”, “bootstrap”, “cerulean”, “cosmo”, “darkly”, “flatly”, “journal”, “lumen”, “paper”, “readable”, “sandstone”, “simplex”, “spacelab”, “united”, “yeti”
To implement a theme, go to your recently created
_site.yml
and add the last few lines:
name: "Haley Oleynik"
navbar:
title: "Haley Oleynik"
left:
- text: "Home"
href: index.html
- text: "Research"
href: research.Rmd
output_dir: "."
output:
html_document:
theme: journal
Now rmarkdown::render_site()
in your R console and
knit one of your pages again to view it locally. Don’t
forget to commit and push to GitHub so these changes are made on your
real site!
Okay, this is super easy, there are a bunch of font awesome icons
built in so you can just call them in your _site.yml
. Here
is the ICON GALLERY
(just be sure to choose the free icons). Once you’ve picked out your
icons, all you do is add them to your _site.yml
like I have
below:
name: "Haley Oleynik"
navbar:
title: "Haley Oleynik"
left:
- text: "Home"
icon: fa-ship
href: index.html
- text: "Research"
icon: fa-fish
menu:
- text: "Publications"
icon: fa-copy
href: Publications.html
- text: "Presentations"
icon: fa-file-powerpoint
href: Presentations.html
- text: "CV"
icon: fa-paperclip
href: collaborate.html
- text: "Contact"
icon: fa-at
href: Contact.html
right:
- icon: fa-github fa-lg
href: https://github.com/haleyoleynik-noaa
- icon: fa-twitter fa-lg
href: https://twitter.com/fish_follower
- icon: fa-info-circle fa-la
href: info.html
output_dir: "."
output:
html_document:
theme: journal
highlight: textmate
#css: style.css
fig_caption: true
toc: true
toc_float: true
You can even have only icons with no text, shown under the right header for my github and twitter links.
And if you want a drop down menu, like I have for my research, you can add that second level menu as shown above.
This is easy, just save them to an images
folder in your
GitHub repo and then call them like this anywhere in your
.Rmd
file:
![](./images/picwithfish.jpg)
Here’s a list of seminar series I mostly learned about while I was a Knauss fellow, but that I still now attend as a PhD student. Sometimes it’s nice to get out of your PhD bubble and see some research going on at different institutions or outside your field entirely.