Last active
July 20, 2016 19:54
-
-
Save anarosner/20ab109bd5aa0d0890bf642b5148819b to your computer and use it in GitHub Desktop.
Quick function to read in csv with underscores in column names and no factor conversion
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
read.csv.custom <- function(filename) { | |
x <- read.csv( filename, stringsAsFactors=F ) | |
names(x) <- gsub( x=names(x), pattern="[.]", replacement="_" ) | |
return(x) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment