I put together this J based on the "fivenum" routine in R mentioned in the
Wikipedia link:

fivenum=: 3 : 0
   if. 0=#y=. /:~y do. 5#_.
   else. n4=. -:<.-:3+#y
       d=. <:1,n4,(-:>:#y),(n4-~>:#y),#y
       -:(y{~<.d)+y{~>.d
   end.
)

It returns the minimum, the quartile points, and the maximum of a series.
The first branch of the "if" roughly replicates some of the R function's
NA-handling.

On Thu, Jun 25, 2015 at 10:14 AM, David Lambert <[email protected]>
wrote:

> Is simplify supposed to report the i.x moments of the data?  Would be
> useful.
> When I removed the question marks from simplify to make valid j
>    1 simplify DATA NB. does report the mean
> Otherwise I haven't made sense of the results for the verb I created.
>
>    datatype N
> integer
>
>    3 simplify N
> _951.236j1533.8 _951.236j_1533.8 2658.39
>
>  Date: Thu, 25 Jun 2015 08:39:51 +0000 (UTC)
>> From: "'Bo Jacoby' via Programming"<[email protected]>
>> To: Programming Forum<[email protected]>
>> Subject: [Jprogramming] simplify
>> Message-ID:
>>         <[email protected]>
>> Content-Type: text/plain; charset=UTF-8
>>
>> NB.?If you have got a bunch of numbers? ? ? ]n=.?20#10035 32 66 37 94 56
>> 44 30 25 70 27 68 49 92 96 79 74 99 72 22NB. and you want to simplify, then
>> take the mean value
>>
>
>  <unreadable cut>
>>
>
>  )NB.?If you can simplify the programming, the please let me know.
>> ThanksBo
>>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to