統計解析R たぶんpart3くらい (587レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
313: 2019/11/01(金)23:50 ID:JL+xq15p(1) AAS
[JavaScript const in R](外部リンク:colinfay.me
やってみる
``` {js}
$ (window).on ('load', function () { const out = new Map ();
out.hello = 'world'; $ ('#const-here').html (JSON.stringify (out)); });
```
<pre id='const-here'></pre>
``` {r}
with (list (), { your_name = function (x) deparse (substitute (x));
out = new.env (); lockBinding (your_name (out), environment ());
tryCatch ({ out $ hello = 'world'; }, error = function (ex) {
assign ('hello', toString (ex), env = out); });
jsonlite::toJSON (as.list (out), auto = T); });
```
``` {Rcpp}
#include <Rcpp.h>
// [[Rcpp::export]]
void kossori (Rcpp::List out, Rcpp::String key, Rcpp::RObject val) {
out [key] = val; }
```
``` {r}
with (list (), { your_name = function (x) deparse (substitute (x));
out = list (hello = ''); lockBinding (your_name (out), environment ());
tryCatch ({ out $ hello = 'world'; }, error = function (ex) {
kossori (out, 'hello', toString (ex)); });
jsonlite::toJSON (out, auto = T); });
```
仕様上は、`env`に対する`$`でのセッターは、たとえ`lockBinding`が
施されていても無問題と思うが、実際は、弾くようにしている。
何か理由があるのかな?
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.031s