Advertisement
elena1234

Read and Write into a CSV file

Apr 6th, 2022 (edited)
2,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.24 KB | None | 0 0
  1. listings = read.csv('listings.csv')
  2. print(listings)
  3.  
  4. days <- c('Mon', 'Tue', 'Wed', 'Thur', 'Fri')
  5. temp <- c(20, 30, 20, 24, 25)
  6. rain <- c(T, F, F, F, T)
  7. df <- data.frame(days, temp, rain)
  8.  
  9. write.csv(df, file = 'days.with.temps.csv')
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement