4

I have an org-mode table

|----+----+----+----+----+----+-----+-----+-----|
| 40 | 40 | 30 | 20 | 50 | 50 | 100 | 100 | 200 |
|----+----+----+----+----+----+-----+-----+-----|
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|    |    |    |    |    |    |     |     |     |
|----+----+----+----+----+----+-----+-----+-----|

I'd like to fill in the empty cells each with a random integer between 0 and the top number of each column. Is this possible?

I'm very new to emacs and org-mode but really excited about learning!

  • You could also use R or any other langauge to build the table and return it as an org table using babel. I mentioned R since it has excellent statistical capabilities out of box and it is a GNU project. – wdkrnls Jul 8 '15 at 1:16
7

The following formula will do the trick:

#+TBLFM: @2$<..@>$>=random(@1)

This means: all rows 2 onwards, and all columns, get a random number in the range of the first row.

Results will be integers. If you want real numbers, do random(@1 * 1.0).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.