[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [R example for org-table with ifs]
From: |
Greg Minshall |
Subject: |
Re: [R example for org-table with ifs] |
Date: |
Thu, 08 Jul 2021 10:33:45 +0300 |
Uwe,
> Thanks but I have to disappoint you the correct result should be 10.1
ah, well. :)
i realized you probably wanted the table back. below it is, with your
explanation of "@3$3".
> Thanks I will play around a bit, but for the moment I think I have to
> stick with calc
well, takes all kinds. :)
cheers, Gerg
----
#+begin_src R :var some=thing :session R :colnames yes
## in imported colnames, spaces are replaced with periods
some[, "Result"] <-
ifelse(some[, "DMNI.H"] > 10, (some[, "DMNI.H"] - 10.0) *
(some[X == "Weight:", "Weight2"]),
0.0) +
(min(10, some[, "DMNI.H"]) * some[X == "Weight:", "ExNDM.I"]) +
(ifelse(some[, "ExNDNM.J"] > 10, some[, "ExNDNM.J"] - 10 *
some[X == "Weight:", "DMNI.H"], 0)) +
(min(10, some[, "ExNDNM.J"]) *
some[X == "Weight:", "ExNDNM.J"]) +
(some[X == "Weight:", "Result"] *
some[, "Result"])
some
#+end_src
#+RESULTS:
| X | DMI.G | DMNI.H | ExNDM.I | ExNDNM.J | Result | Weight2 |
|---------+-------+--------+---------+----------+--------+---------|
| Weight: | 1 | 0.2 | 1 | 0.1 | | 0.1 |
| User1 | 0 | 0 | 11 | 0 | 10.1 | |
- export org table to other formats (gnumeric or scalc or xlsx), Uwe Brauer, 2021/07/04
- Re: export org table to other formats (gnumeric or scalc or xlsx), Tim Cross, 2021/07/04
- Re: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx), Daniel Ortmann, 2021/07/04
- Re: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx), Uwe Brauer, 2021/07/05
- Re: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx), Eric S Fraga, 2021/07/05
- Re: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx), Greg Minshall, 2021/07/06
- [R example for org-table with ifs] (was: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx)), Uwe Brauer, 2021/07/07
- Re: [R example for org-table with ifs], Eric S Fraga, 2021/07/07
- Re: [R example for org-table with ifs] (was: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx)), Greg Minshall, 2021/07/08
- Re: [R example for org-table with ifs], Uwe Brauer, 2021/07/08
- Re: [R example for org-table with ifs],
Greg Minshall <=
Re: export org table to other formats (gnumeric or scalc or xlsx), Uwe Brauer, 2021/07/05
Re: export org table to other formats (gnumeric or scalc or xlsx), Uwe Brauer, 2021/07/05