I am new to clojure and want to do this correctly. I have two data sources of date stamped data from two CSV files. I have pulled them in a put them in vector of vectors format. I would like to do a join(outer join) sort of combining of the data.
;--- this is how I am loading the data for each file.... works great ---
(def csvfile (slurp "table.csv"))
(def csvdat (clojure.string/split-lines csvfile))
(def final (vec (rest (map (fn [x] (clojure.string/split x #",")) csvdat))))
CSV File 1: date value1 value2 value3
CSV File 2: date valueA valueB valueC
Resulting vector of vectors format: date value1 value2 value3 valueA valueB valueC
I have several ugly ideas I just want to do the best ugly idea. :)
Option 1: get a unique set of times in sequnence and map all the data from the two vector of vectors into a new vector of vectors Option 2: is there a clever way I can do a map from two vector of vectors to a new vector of vectors(more advanced mapping than I can speak to with my experience)
What is the most clojure idomatic method of doing "joins"? Should I be doing maps? I like vectors because I will be doing a lot of range calculations after csv's are joined, like moving a window(groups of rows) down the rows of the joined data.