Hot answers tagged

4

You are probably better off using Lisp formulas for things like this. As @db48x's answer points out, there are a couple of cooks in that kitchen and what they are doing is not always obvious. Formula debugging can help but it is not always effective (I presume that's how @db48x discovered the "(a)" thing, but that may not be the case). I find the ...


3

I don't know exactly what's going on here, but after doing a little debugging I found that this works: | a | | | b | | #+TBLFM: $2=if("$1"=="(a)", 1, 0) It looks to me like it's doing algebraic simplification in order to get an answer, and if that fails it can be left with a more complicated form than you expected. b = a ? 1 : 0 is a ...


3

You can represent points with complex numbers or vectors. The calc-abs (A) function returns the absolute value of a complex number or the Euclidean norm of a vector. For instance this is the trail trace which results from the calculus of the distance from [7 -2] to [4 2] Emacs Calculator Trail alg' [7, -2] alg' [4, 2] - [-3, 4] abs 5


3

I've got the same issue here (emacs 27.1 and gnuplot 5.4). Calc is issuing an option which is unknown to gnuplot: set notime. This seems to be a bug in calc. Calc is also issuing multiple deprecated commands (it should use unset instead of set no...), but these only trigger warnings. To work around the unknown option, locate file calc-graph.el and edit it. ...


1

You can use a range formula for cases like this. The relevant section in the manual, which you can get to with C-h i g (org) Field and range formulas, says: ‘@1$2..@4$3=’ Range formula, applies to all fields in the given rectangular range. This can also be used to assign a formula to some but not all fields in a row. That, combined with relative ...


1

(use-package macro-math :bind ("\C-x=" . macro-math-eval-region) ("\C-x~" . macro-math-eval-and-round-region)) And I have this note in my emacs.org: NOTE: Edit macro-math.el and fix: # ;;(delete-region beg end) # (goto-char (region-end)) # (insert " = " rounded) And there is an issue to support appending = <result&...


1

The Org mode spreadsheet is not like Excel: you don't create formulas in one cell and then propagate them to other cells (well, you can - do C-h i g (org)Field and range formulas, but propagating them is basically a matter of cutting and pasting). You can instead use a #+TBLFM after the table to do all that: |------------+------------+------------+-----------...


1

You can either use the calc syntax or the elisp syntax. | x | calc syntax | elisp syntax | |---+-------------+--------------| | 1 | 0 | 0.0000 | | 2 | 0.6931 | 0.6931 | #+TBLFM: $2=log($1);n4::$3='(log $1);N%.4f Notice that the output format of the calc syntax depends on the ~/.emacs.d/calc.el parameters. (plist-put org-calc-...


1

The code works for me: (org-table-time-seconds-to-string (apply '+ (mapcar 'string-to-number (mapcar 'org-table-time-string-to-seconds (org-lookup-all $1 '(remote(works,@2$2..@>$2)) '(remote(works,@2$3..@>$3)))))) 'hh:mm) org-...


1

After a bit of trial and error, it seems that something like this might work: | Element | $ | |---------+------| | E1 | 35% | | E2 | 65% | |---------+------| | Total | 100% | #+TBLFM: @>$>=vsum(@I..II)*100;%.0f%% You always think of the entries as the corresponding decimal fraction (35% = 35/100 = 0.35 etc) and the result is the sum ...


1

You may well be right about the eager evaluation (which might be a bug). EDIT: Actually, there is no evaluation at all: the user error is precipitated just by pattern matching - while in row 2, it finds the @-14$6 in the formula and proceeds to check it immediately; it does not matter at all that the formula would never hit that. Fixing that is probably ...


1

You may try the orgtb-aggregate package available on Melpa. It will create new tables from yours. In this example, partial sums are computed for similar values of enable: #+name: mytable | | | col1 | enable | |---+-------+------+--------| | | | 1 | 1 | | | | 3 | 0 | | | | | 0 | | | | 7 | ...


Only top voted, non community-wiki answers of a minimum length are eligible