Advertisement
elena1234

Read and Write into a CSV file

Apr 6th, 2022 (edited)
1,237
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement