Skip to content

Instantly share code, notes, and snippets.

View perthr's full-sized avatar

Greg White perthr

  • Curtin University
  • Perth, Western Australia
View GitHub Profile
@perthr
perthr / sourceGist.r
Last active March 30, 2020 03:37 — forked from jtoll/sourceGist.r
Source a Gist from R
# Example: Easily source a Gist from R using devtools
# 1) install devtools
if (!("devtools" %in% installed.packages()[, 1])) {
install.packages("devtools")
}
# 2) source
library(devtools)
source_gist("https://gist.github.com/perthr/9a37f173fe3f5535c5b61dfb5b5c42bc")
@perthr
perthr / analysis.Rmd
Created March 30, 2020 03:47 — forked from sebkopf/analysis.Rmd
R markdown tutorial
---
title: "Analysis test"
output: html_document
---
```{r, echo=FALSE, warning=FALSE}
# This code chunk simply makes sure that all the libraries used here are installed, it will not be shown in the report (notice echo = FALSE).
packages <- c("readxl", "knitr", "tidyr", "dplyr", "ggplot2", "plotly")
if ( length(missing_pkgs <- setdiff(packages, rownames(installed.packages()))) > 0) {
message("Installing missing package(s): ", paste(missing_pkgs, collapse = ", "))
@perthr
perthr / cheatsheets.md
Created March 30, 2020 03:51 — forked from FlorianHeigl/cheatsheets.md
Printable Cheat Sheets for Software

A collection of links to useful cheat sheets.

Only what's properly printable can get in. It should also be small enough to fit on a few pages.

Pleae contribute any you remember you've seen and liked. It would be wonderful if we can get these to be something more commonly made.

Search Engines

https://www.alienvault.com/blog-content/GoogleHackingCheatSheet.pdf (nicely put together!)

---
title: "Making Interactive Maps of Public Data in R"
author: "Ryan Rosenberg"
output: html_document
---
<style>
.leaflet {
margin: auto;
}
</style>
@perthr
perthr / ggplot_tutorial.Rmd
Created March 30, 2020 04:02 — forked from emitanaka/ggplot_tutorial.Rmd
ggplot tutorial with kunoichi + ninjutsu xaringan theme
---
title: "ggplot tutorial"
subtitle: "with kunoichi + ninjutsu theme"
author: "<br><br> Emi Tanaka"
date: "<br>2018/09/16"
output:
xaringan::moon_reader:
lib_dir: libs
css: ["kunoichi", "ninjutsu"]
nature:
@perthr
perthr / dplyr_tutorial.Rmd
Created March 30, 2020 04:05 — forked from dgrapov/dplyr_tutorial.Rmd
hands on with dplyr
---
title: "Hands-on with dplyr"
author: "Dmitry Grapov"
output:
html_document:
keep_md: yes
---
## Introduction
---
title: "Untitled"
author: "Ben Marwick"
date: "Wednesday, September 24, 2014"
output: html_document
---
## Introduction
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. You should read through this entire document very carefully before making any changes or pressing any buttons.
---
title: "Beginner R Workshop"
output: html_document
date: October 27, 2016
author: Keegan Korthauer and Joseph N. Paulson
---
Today's workshop will be a gentle introduction to the
[R programming language](https://cran.r-project.org/). We have provided RStudio Server instances that you can access on the web, but we'll also briefly overview how you can install R and RStudio on your own computer. We'll start with some basics about programming and then get some hands-on experience with analyzing a real-world messy dataset that we'll collect from everyone live. We hope that you'll get a feel for what R can do as well as learn where you can learn more to use it on your own (great resources are listed at the end).
@perthr
perthr / r-interview.md
Created March 30, 2020 05:49 — forked from peterhurford/r-interview.md
R Interview Questions

1.) If I have a data.frame df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6), c(7, 8, 9))...

1a.) How do I select the c(4, 5, 6)?

1b.) How do I select the 1?

1c.) How do I select the 5?

1d.) What is df[, 3]?