3 ;;; Time-stamp: <2010-01-14 07:55:00 tony>
4 ;;; Creation: <2009-03-12 17:14:56 tony>
5 ;;; File: template.lisp
6 ;;; Author: AJ Rossini <blindglobe@gmail.com>
7 ;;; Copyright: (c)2009--, AJ Rossini. BSD, LLGPL, or GPLv2, depending
9 ;;; Purpose: Template header file
11 ;;; What is this talk of 'release'? Klingons do not make software
12 ;;; 'releases'. Our software 'escapes', leaving a bloody trail of
13 ;;; designers and quality assurance people in its wake.
15 ;; start within the common-lisp-stat-user
16 (in-package :cls-user
)
18 ;; we'll be loading from directories in the CLS homedir, so we want to
19 ;; make it easier to reach.
20 (defun localized-pathto (x)
21 "return a string denoting the complete path.
22 FIXME: UNIX-centric (though might work on Mac OSX). Might want to
23 return a pathspec, not a string/namespec"
25 (concatenate 'string
*cls-home-dir
* x
))
30 ;; FIXME: Need to clean up data examples, licenses, attributions, etc.
31 ;; The following breaks because we should use a package to hold
32 ;; configuration details, and this would be the only package outside
33 ;; of packages.lisp, as it holds the overall defsystem structure.
34 (load-data "iris.lsp") ;; (the above partially fixed).
42 ;; Importing data from DSV text files.
44 (rsm.string
:file-
>string-table
45 (localized-pathto "Data/example-mixed.csv"))
47 (rsm.string
:file-
>number-table
48 (localized-pathto "Data/example-numeric.csv"))
51 (defparameter *my-df-2
*
52 (make-instance 'dataframe-array
54 (listoflist:listoflist-
>array
55 (rsm.string
:file-
>string-table
56 (localized-pathto "Data/example-mixed.csv")))
57 :doc
"This is an interesting dataframe-array"))
61 (defparameter *my-df-3
*
62 (make-instance 'dataframe-array
64 (listoflist:listoflist-
>array
65 (rsm.string
:file-
>number-table
66 (localized-pathto "Data/example-numeric.csv")))
67 :doc
"This is an interesting dataframe-array"))
70 ;; Need to the this using the make-dataframe example, or write a
71 ;; dsvfile->dataframe command.
74 (defparameter *tmp-csv-filedata
* (rsm.string
:file-
>number-table
75 (localized-pathto "Data/example-numeric.csv")))
76 (defparameter *tmp-csv-filedata
* (rsm.string
:file-
>number-table
77 (localized-pathto "Data/R-chickwts.csv")
79 (defparameter *tmp-var-name-list
* (car *tmp-csv-filedata
*))
80 (defparameter *tmp-data-list
* (cdr *tmp-csv-filedata
*))
81 (defparameter *tmp-data-array
* (listoflist:listoflist-
>array
(cdr *tmp-csv-filedata
*)))
82 (aref *tmp-data-array
* 0 2)
83 (aref *tmp-data-array
* 1 1)
84 (aref *tmp-data-array
* 4 0)
86 (defparameter *test-df
*
87 (let ((csv-file-data (rsm.string
:file-
>number-table
88 (localized-pathto "Data/R-chickwts.csv")
90 (let ((var-name-list (car csv-file-data
))
91 (data-list (listoflist:listoflist-
>array
(cdr csv-file-data
))))
92 (make-instance 'dataframe-array
94 :var-labels var-name-list
95 :doc
"This is an interesting dataframe-array"))))
100 (defparameter *testdf-2
* (filename.dsv-
>dataframe
(localized-pathto "Data/R-chickwts.csv")))