Skip to content

Instantly share code, notes, and snippets.

@anarosner
Last active July 20, 2016 19:54
Show Gist options
  • Save anarosner/20ab109bd5aa0d0890bf642b5148819b to your computer and use it in GitHub Desktop.
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
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