Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. chart_2009 <- read.csv('BCHAIN-AVBLS (3).csv')
  2. chart_2009_days = data.frame(date=c(chart_2009[1]))
  3. chart_2009_days["2009 Days of the Week"] <- NA
  4. chart_2009_days[2] <- weekdays(as.Date(chart_2009[1]))
  5.  
  6. ## create a dummy data.frame
  7. df <- data.frame(date = c("2010-01-03", "2010-01-02"))
  8. df
  9. # date
  10. # 1 2010-01-03
  11. # 2 2010-01-02
  12.  
  13. ## add a new column
  14. df$newColumn <- c("new", "column")
  15. df
  16. # date newColumn
  17. # 1 2010-01-03 new
  18. # 2 2010-01-02 column
  19.  
  20. chart_2009$days <- weekdays(as.Date(chart_2009[, 1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement