Skip to content

Instantly share code, notes, and snippets.

@paulhendricks
Created November 30, 2016 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulhendricks/9bd79327762ddf46f9efc3359b9fe900 to your computer and use it in GitHub Desktop.
Save paulhendricks/9bd79327762ddf46f9efc3359b9fe900 to your computer and use it in GitHub Desktop.
# Good - I can customize the way the file is read in
df <- read.csv("foo.csv", stringsAsFactors = FALSE)
df <- read.table("foo.txt", delimiter = "\t", stringsAsFactors = FALSE)
df <- read.table("foo.txt", delimiter = "|", stringsAsFactors = FALSE)
analyze(df)
# Bad - arguments are needed to customize how foo.csv is read in
analyze("foo.csv", stringsAsFactors = FALSE)
analyze("foo.txt", delimiter = "\t", stringsAsFactors = FALSE)
analyze("foo.txt", delimiter = "|", stringsAsFactors = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment