]d =. 20080102 ; 20080104 ; 20080106
+--------+--------+--------+
|20080102|20080104|20080106|
+--------+--------+--------+
1&todayno &.> d
+-----+-----+-----+
|75971|75973|75975|
+-----+-----+-----+
At 15:14 -0600 2008/03/03, Hahn, Harvey wrote:
I was trying to create a plot of my blood sugar levels for my doctor
(I'm diabetic and thought I'd put J to another practical use for me),
when I ran into a problem I just couldn't see to resolve, no matter what
I tried (following whatever examples I could).
Here's the situation: I have a CSV file containing "yyyymmdd,data"
pairs. I was able to load that file with no problems, resulting in a
boxed array:
data =: readcsv 'c:\bloodtest.txt'
Following the demo example of the "Gold Fixed Price", I transposed rows
and columns:
'x y' =. |: data
After the transposition, the boxed data looks like this:
+----------+----------+------------
| 20080102 | 20080104 | 20080106 ...
+----------+----------+------------
| 147 | 197 | 173 ...
+----------+----------+------------
The "Gold Fixed Price" example's chart uses dates converted with the
"todayno" verb. That's where I have my problem. The "Gold" script's
data is ALREADY in a converted form before being operated upon by the
script, so there's no example of a real-life conversion of multiple data
(which ought to be possible, I should think). What I'd like is to
convert this:
+----------+----------+------------
| 20080102 | 20080104 | 20080106 ...
+----------+----------+------------
to this (somehow using "1 todayno data"), so that I can proceed with the
plotting:
+-------+-------+---------
| 75971 | 75973 | 75975 ...
+-------+-------+---------
I've tried several different approaches to "feeding" todayno with
elements from the row of date data, even using a function with a for.
loop, but I'm missing something somewhere, because nothing has worked
successfully. Thanks for your insights as I continue to learn J!
Harvey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm