Skip to content

Instantly share code, notes, and snippets.

# frame.match ####
frame.match <- function(data.1, data.2, id.col, ...) {
# User defined for comparing dataframe cells
require(dplyr)
results <- list()
# Most of R, from an applied point of view anyway, is the process of creating objects and feeding them into functions to make amazing,
# new objects.
# amazing_new_object <- f(object)
x <- c(3, 4, 5)
y <- mean(x)
# This is true in the big picture sense as well
# information
# Table 1
# A basic, descriptive table that you would usually see as Table 1 in a
# publication
# Tests if multiple groups (data$arm)
tests.1 <- function(data, ...) {
tests.list <- list()
install.packages("tidyverse")
library(tidyverse)
# Objects ####
# Most of R, from an applied point of view anyway, is the process of creating
# objects and feeding them into functions to make amazing, new objects.
# amazing_new_object <- f(object)
urlfile <-"https://raw.githubusercontent.com/dantalus/intro_workshop/master/plot.csv"
plotDf <-read.csv(urlfile)
# install.packages(c("ggthemes", "ggbeeswarm"))
library(ggthemes)
library(ggbeeswarm)
library(ggplot2)
library(dplyr)
# Apply functions ####
# There are cases where you want to "do something" to each element in a given
# data structure. For example, we might want to calcuate the
# mean for each variable (column) in a dataframe.
# Looping is a common way to do this.
# Data
# Table 1
# A basic, descriptive table that you would usually see as Table 1 in a
# publication
plotDf <-read_csv(urlfile)
# Tests if multiple groups (data$arm)
tests.1 <- function(data, ...) {