This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create sample data | |
set.seed(1) | |
data <- data.frame(y = rnorm(10), | |
a = rnorm(10), | |
b = rnorm(10), | |
c = rnorm(10), | |
d = rnorm(10)) | |
# Function takes a string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load packages | |
library(dplyr) | |
# Create data | |
set.seed(1) | |
x <- rnorm(1000000, mean = 0, sd = 1) | |
y <- x*x | |
full <- data.frame(x, y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The below demonstrates the madness of R's treatment of NA values. | |
# Some examples taken from https://stackoverflow.com/questions/25100974/na-matches-na-but-is-not-equal-to-na-why/25101796 | |
# Logical examples | |
NA %in% NA | |
# [1] TRUE | |
NA == NA |
NewerOlder