alexcolson

RLoadCsv

Apr 21st, 2011
1,908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.42 KB | None | 0 0
  1. dataFile <- "test_data.csv"
  2. dataFile_strip <- "test_data2.csv"
  3. dataDir <- "/Users/alex/Dev/R/stockdata"
  4. file <- paste(dataDir,"/",dataFile,sep="")
  5. file2 <- paste(dataDir,"/",dataFile_strip,sep="")
  6.  
  7. csv <- read.csv(file,header=TRUE,sep=",")
  8. csv$row.names <- as.POSIXct(as.character(csv$row.names),tz="",format="%Y.%m.%d")
  9.  
  10. #write the file and remove the column with symbol name
  11. write.csv(csv[-2],file2,row.names=FALSE)
Advertisement
Add Comment
Please, Sign In to add comment