Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

tpapp/data-omnivore

Repository files navigation

This repository is archived. You may find an updated version of these libraries at https://github.com/Lisp-Stat/dfio/

This library is experimental. Your comments are very welcome.

Reading text-based tabular data into Common Lisp

This is a library for reading text-based tabular data (such as CSV) into Common Lisp, using the cl-data-frame library.

Documentation is currently incomplete, you should look at the unit tests. A short demonstration:

(asdf:load-systems "data-omnivore" "cl-slice")

(defparameter *d* (data-omnivore:csv-to-data-frame
                   (format nil "Gender,Age,Height~@
                                \"Male\",30,180.~@
                                \"Male\",31,182.7~@
                                \"Female\",32,1.65e2")))

(cl-slice:slice *d* t :gender)
    ; => #("Male" "Male" "Female")

(let ((strings (cl-slice:slice *d* t :gender)))
  (eq (aref strings 0) (aref strings 1)))
    ; => T, strings in the same column are interned once

(cl-slice:slice (data-omnivore:csv-to-data-frame
                 (format nil "\"All kinds of wacky number formats\"~%.7~%19.~%.7f2"))
                t :all-kinds-of-wacky-number-formats)
    ; => #(0.7d0 19.0d0 70.0)

more documentation

talk about accepting numbers like .1 and 1., possibility of parsing into R-like factors from string-tables

Reporting bugs

Please report bugs using the issue tracker.

About

Read tabular data into data frames

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published