Created
January 3, 2014 01:27
-
-
Save dfalster/8230860 to your computer and use it in GitHub Desktop.
Revisions
-
dfalster renamed this gist
Jan 3, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dfalster created this gist
Jan 3, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ csv_metadata <- function(filename){ data <- read.csv(filename, stringsAsFactors=FALSE, fill=TRUE, header=TRUE, check.names = FALSE) write.csv(data.frame(variable=names(data), units="",description="", notes=""), quote=TRUE, row.names=FALSE, file = file.path(dirname(filename), paste0("metadata_",basename(filename)))) }