package ocaml-r
Objective Caml bindings for the R interpreter
Install
Dune Dependency
Authors
Maintainers
Sources
ocaml-r-0.6.0.tbz
sha256=8ecea70a631896b4328c465028b628a6bcbbb7dbad8571df69c0297ff9a088ca
sha512=ac77d473ba35f98f2ea4034db3be514720d4dadae2e12692d4a846ab6ee03db66a24b846a0f1cd1a2b9cd674dd89c45a82b7d78e884cb3b36f17afff64ffe72c
doc/src/ocaml-r.grDevices/OCamlR_grDevices.ml.html
Source file OCamlR_grDevices.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
open OCamlR let () = ignore (eval_string "require(grDevices, quietly=TRUE)") module Stub = struct let png = symbol "png" let pdf = symbol "pdf" let postscript = symbol "postscript" let svg = symbol "svg" let dev_off = symbol "dev.off" (* TODO: This segfaults: let dev = symbol "dev" *) end type length_unit = [`pixel | `inch | `cm | `mm] let string_of_length_unit = function | `pixel -> "px" | `inch -> "in" | `cm -> "cm" | `mm -> "mm" let r_length_unit x = Enc.string (string_of_length_unit x) let png ?width ?height ?unit ?pointsize path = ignore ( call Stub.png [ arg Enc.string path ; opt_arg Enc.float "width" width ; opt_arg Enc.float "height" height ; opt_arg r_length_unit "unit" unit ; opt_arg Enc.int "pointsize" pointsize ]) let pdf ?width ?height ?pointsize path = ignore ( call Stub.pdf [ arg Enc.string path ; opt_arg Enc.float "width" width ; opt_arg Enc.float "height" height ; opt_arg Enc.int "pointsize" pointsize ]) let postscript ?width ?height ?pointsize path = ignore ( call Stub.postscript [ arg Enc.string path ; opt_arg Enc.float "width" width ; opt_arg Enc.float "height" height ; opt_arg Enc.int "pointsize" pointsize ]) let svg ?width ?height ?pointsize path = ignore ( call Stub.svg [ arg Enc.string path ; opt_arg Enc.float "width" width ; opt_arg Enc.float "height" height ; opt_arg Enc.int "pointsize" pointsize ]) let dev_off () = ignore ( call Stub.dev_off [] )
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>