Last active
December 31, 2015 15:58
-
-
Save johnmyleswhite/8010089 to your computer and use it in GitHub Desktop.
Zany stuff that happens in R 3.0.2 on OS X: some cool, some absolutely awful
This file contains 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
M <- matrix(c(1, 0, 0, 1), byrow = 1, nrow = 2) | |
df <- data.frame(A = 1) | |
df$B <- list(M) | |
df | |
# A B | |
# 1 1, 0, 0, 1 |
This file contains 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
# Only works on some platforms: this was on OS X 10.9 with R version 3.0.1 (2013-05-16) -- "Good Sport" | |
NaN + NA_real_ | |
# [1] NaN | |
NA_real_ + NaN | |
# [1] NA |
This file contains 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
x <- c(1, 2, 3, 4) | |
x[NA] | |
# [1] NA NA NA NA | |
x[TRUE] | |
# [1] 1 2 3 4 |
This file contains 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
data <- "MySQLID\n1000\n1001" | |
ids <- read.csv(text = data) | |
ids[1, 1] == ids[2, 1] | |
# [1] FALSE | |
data <- "MySQLID\n100000000000000000\n100000000000000001" | |
ids <- read.csv(text = data) | |
ids[1, 1] == ids[2, 1] | |
# [1] TRUE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good point. Changed to remove row name.