I have merged multiple CSV files with the following code:
library(data.table)
setwd("C:\\Users\\jessi\\Desktop\\Selenium\\TASK 001\\Extracted CSV\\test_batch")
files <- list.files(pattern = ".csv")
temp <- lapply(files, fread, sep="")
data <- rbindlist(temp)
write.csv(data, file="rmergeoutput2.csv", row.names = FALSE)
My entries are held in a single cell on each line and seperated by "|" as follows:
Year|RecID|ParID|ConParID|Country|Divisi..............
1861|2549365|281|186|ENG|I|London (Parts Of Middlesex.....
1861|9|1|1|ENG|I|London (Parts Of Middlesex, Surrey ..........
1851|2549365|281|186|ENG|I|London (Parts Of Middlesex.....
1851|9|1|1|ENG|I|London (Parts Of Middlesex, Surrey ..........
My dataframe isn't ordered and I'd like to order it in ascending order. In particular, I'd like for the Year, RecID, ParID, ConParID to all be displayed in an orderly manner. How can I do this? I have tried order(data) to no success.