From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Moszynski Subject: 3 beginner table questions Date: Tue, 6 May 2014 02:51:08 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301d3edccc670f04f8b682d6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wha9j-0007Dc-ET for emacs-orgmode@gnu.org; Tue, 06 May 2014 03:51:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wha9e-00089U-AK for emacs-orgmode@gnu.org; Tue, 06 May 2014 03:51:15 -0400 Received: from mail-ie0-x232.google.com ([2607:f8b0:4001:c03::232]:58151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wha9e-00088r-2W for emacs-orgmode@gnu.org; Tue, 06 May 2014 03:51:10 -0400 Received: by mail-ie0-f178.google.com with SMTP id lx4so9429742iec.9 for ; Tue, 06 May 2014 00:51:09 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --20cf301d3edccc670f04f8b682d6 Content-Type: text/plain; charset=UTF-8 So, i'm using org mode to keep track of my workouts on a rowing machine and need help with 3 questions to allow me to finish off my table. The questions are based on the provided table, which is what I have so far. 1: in @4$4 and @4$7 i'm using vmean on a column of HMS values, how do I floor or round to the nearest second, so I don't get fractions of seconds in my output? $4=0@ 16' 6.3333333" to $4=0@ 16' 6" 2: i'm lazy and i don't want to type in the split time since I can derive it from the Watts column. pace(or 500m split time) from watts formula - 3rd root(2.8/watts) so if W = 66 then pace= 3rdRt(2.8/66) = 0.3487 * 500 = 174 seconds = 0@ 2' 54" so if $11 = 66, whats the best way to put $7 = 0@ 2' 54"? does this call for a lisp function where the output is a text string, or is there an easier/TBLFM way? 3: the $1 column of my table is just an i++ value, 1, 2, 3 ... n where n is the number of rows between the 2nd and 3rd hline. is there a function I can call to tell me how many rows are in that part of my table, or, if I want to be able to refer to a variable which is the number of rows in my table, do I have to keep track of it manually like this? so what I want to be able to do is the following, without having to use a count up column. @7$2 = Total(3), where "3" is the number of rows between the 2nd and 3rd hline Thanks so much, Ryan Moszynski |---+---------+-----+-------------------+--------+-----+------------------+------+------+------+----| | | date | lb | h m s | meters | spm | split500 | C_c2 | C_rl | C_AB | W | | | May | | | | | | | | | | |---+---------+-----+-------------------+--------+-----+------------------+------+------+------+----| | 1 | 050114 | 236 | 0@ 15' 36" | 2686 | 29 | 0@ 2' 54" | 527 | 632 | 164 | 66 | | 2 | 050214 | 236 | 0@ 16' 7" | 2793 | 28 | 0@ 2' 53" | 531 | 636 | 170 | 67 | | 3 | 050414 | 234 | 0@ 16' 36" | 3023 | 29 | 0@ 2' 44" | 568 | 669 | 185 | 78 | |---+---------+-----+-------------------+--------+-----+------------------+------+------+------+----| | | Average | 235 | 0@ 16' 6.3333333" | 2834 | 29 | 0@ 2' 50.333333" | 542 | 646 | 173 | 70 | | | Total | | 0@ 48' 19" | 8502 | | | | | 519 | | |---+---------+-----+-------------------+--------+-----+------------------+------+------+------+----| #+TBLFM: @6$3=vmean(@II..@III);%.0f:: @7$4=vsum(@II..@III):: @6$4=vmean(@II..@III):: @7$5=vsum(@II..@III):: @6$5=vmean(@II..@III);%.0f:: @6$6=vmean(@II..@III);%.0f:: @6$7=vmean(@II..@III):: @6$11=vmean(@II..@III);%.0f:: $9=if($8 > 0, vsum($8, -300+$3*1.714), 0);%.0f:: $10=vsum(0, ((3600*deg($4))/3600)*$9);%d:: @7$10=vsum(@II..@III):: @6$10=vmean(@II..@III);%.0f:: @7$9=string(""):: @6$8=vmean(@II..@III);%.0f:: @6$9=vmean(@II..@III);%.0f:: -- He felt that his whole life was some kind of dream and he sometimes wondered whose it was and whether they were enjoying it. - Douglas Adams --20cf301d3edccc670f04f8b682d6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
So, i'm using org mode to keep track of my workouts on a rowing = machine and need help with 3 questions to allow me to finish off my table.<= /span>
The questi= ons are based on the provided table, which is what I have so far.

1: in @4$4= and @4$7
<= span style=3D"font-family:'courier new',monospace">i'm using vm= ean on a column of HMS values, how do I floor or round to the nearest secon= d, so I don't get fractions of seconds in my output?
$4=3D0@ 16'= 6.3333333"
to=
$4=3D0@ 16'= 6"
2: i'm lazy and i don't wa= nt to type in the split time since I can derive it from the Watts column.
pace(or 500m split time= )
=C2=A0f= rom watts formula - 3rd root(2.8/watts)
so<= br style=3D"font-family:'courier new',monospace">if W =3D 66 then pace=3D 3rdRt(2.= 8/66) =3D 0.3487 * 500 =3D 174 seconds =3D 0@ 2' 54"
so
if $11 =3D 66, whats the best way to p= ut $7 =3D 0@ 2' 54"?
does this call = for a lisp function where the output is a text string, or is there an easie= r/TBLFM way?
3:
the $1 column of my table is just an i++ value, 1, 2, 3= ... n where n is the number of rows between the 2nd and 3rd hline.<= br style=3D"font-family:'courier new',monospace"> is there a func= tion I can call to tell me how many rows are in that part of my table, or, = if I want to be able to refer=C2=A0
to a variable w= hich is the number of rows in my table, do I have to keep track of it manua= lly like this?
so what I want = to be able to do is the following, without having to use a count up column.=
@7$2 =3D Total(3), where = "3" is the number of rows between the 2nd and 3rd hline

Tha= nks so much, Ryan Moszynski

|---+---------+-----+-------------------+--------+-----+------= ------------+------+------+------+----|
| =C2=A0 | date =C2=A0 =C2=A0| = =C2=A0lb | h =C2=A0m =C2=A0 s =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| meters | = spm | split500 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | C_c2 | C_rl | C_AB | =C2=A0W |=
| =C2=A0 | May =C2=A0 =C2=A0 | =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 = =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| = =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0| =C2=A0 = =C2=A0|
|---+---------+-----+-------------------+--------+-----+--------= ----------+------+------+------+----|
| 1 | 050114 =C2=A0| 236 | 0@ 15&#= 39; 36" =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 2686 | =C2=A029 | 0@ 2'= ; 54" =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0527 | =C2=A0632 | =C2=A0164 |= 66 |
| 2 | 050214 =C2=A0| 236 | 0@ 16' 7" =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= =C2=A0 2793 | =C2=A028 | 0@ 2' 53" =C2=A0 =C2=A0 =C2=A0 =C2=A0| = =C2=A0531 | =C2=A0636 | =C2=A0170 | 67 |
| 3 | 050414 =C2=A0| 234 | 0@ 1= 6' 36" =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 3023 | =C2=A029 | 0@ 2&= #39; 44" =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0568 | =C2=A0669 | =C2=A018= 5 | 78 |
|---+---------+-----+-------------------+--------+-----+------------------+= ------+------+------+----|
| =C2=A0 | Average | 235 | 0@ 16' 6.33333= 33" | =C2=A0 2834 | =C2=A029 | 0@ 2' 50.333333" | =C2=A0542 |= =C2=A0646 | =C2=A0173 | 70 |
| =C2=A0 | Total =C2=A0 | =C2=A0 =C2=A0 | 0@ 48' 19" =C2=A0 =C2=A0= =C2=A0 =C2=A0| =C2=A0 8502 | =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2= =A0| =C2=A0519 | =C2=A0 =C2=A0|
|---+---------+-----+-------------------= +--------+-----+------------------+------+------+------+----|
#+TBLFM:= =C2=A0
@6$3=3Dvmean(@II..@III);%.0f::=
@7$4=3Dvsum(@II..@III)::<= /div>
@6$4=3Dvmean(@II..@III)::
@7$5=3Dvsum(@II..@III)::<= /div>
@6$5=3Dvmean(@II..@III);%.0= f::
@6$6=3Dvmean(@II= ..@III);%.0f::
@6$7=3Dvmean(@II..@III)::=
@6$11=3Dvmean(@II..@III);%= .0f::
$9=3Dif($8 > 0, vsum($8, -300= +$3*1.714), 0);%.0f::
@7$10=3Dvsum(@II..@III)::
@6$10=3Dvmean(@II..@III);%.0f::<= /font>
@7$9=3Dstring("= ")::
@6$8=3Dvme= an(@II..@III);%.0f::
@6$9=3Dvmean(@II..@III);%.0f::


--
He felt that his whole life was some kind of dream and= he sometimes wondered whose it was and whether they were enjoying it. - Do= uglas Adams
--20cf301d3edccc670f04f8b682d6--