Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #sample CSV with long file name '2018_October_10_regional_users_action_x'
- ID email address action x
- 1 365367 joe.schmoe@email.com 1
- 2 953164 fake.guy@email.com 0
- #sample CSV with long file name '2018_October_10_regional_users_action_z'
- ID email addresss action z
- 1 798842 Jill.fake@email.com 0
- 2 100321 madeup.j@email.com 1
- #code I've been using
- setwd(choose.dir())
- temp <- list.files(pattern = "\.csv" # picking all the csv's from my folder
- #I was inserting these all as separate objects, since that's the way I know
- # how to do what I need, but super manual
- #list2env(
- lapply(setNames(temp, make.names(gsub("*.csv$", "", temp))),
- read_csv), envir = .GlobalEnv)
- # Manual way I was dropping my column
- 2018_October_10_regional_users_action_x <- select(2018_October_10_regional_users_action_x, -Id)
- 2018_October_10_regional_users_action_z <- select(2018_October_10_regional_users_action_z, -Id)
Add Comment
Please, Sign In to add comment