統計解析R たぶんpart3くらい (587レス)
上下前次1-新
抽出解除 レス栞
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
78: 2014/06/25(水)12:37:16.63 ID:2DQs2BI0(2/2) AAS
ご返答ありがとうございます
three Wayパッケージについて調べてみたいと思います。
136(1): 2016/02/20(土)11:42:28.63 ID:OYmUxYa1(1) AAS
Pythonのyieldに相当するものってないの?
169: 2018/02/11(日)00:58:01.63 ID:WMQeXuiD(1) AAS
上限100%の上部90%以上カットしたらそうなるわ
214: 2018/05/17(木)18:14:17.63 ID:0I05aDJU(1) AAS
そのあたりは「名前空間」で調べて見るといいよ
259: 2019/03/21(木)23:21:26.63 ID:2X9Nl1zM(1) AAS
わかる人が来るまでのつなぎ - 30年以内に来ればラッキーだと思うけど
* ['rvest::html' is deprecated, but rvest::read_html doesn't exist. Issue #191 tidyverse/rvest GitHub](外部リンク:github.com
* [rvest package | R Documentation](外部リンク:www.rdocumentation.org
``` {r}
with (list (`%>%` = purrr::`%>%`, size = length, null = NULL), {
home = '外部リンク:stackoverflow.com';
depth = 0;
done = list ();
todo = list ('/questions/28863775/scraping-linked-html-webpages-by-looping-the-rvestfollow-link-function');
while (0 < size (todo) & depth < 2) {
depth = depth + 1;
done = c (done, todo);
todo = purrr::reduce (.init = null, .x = todo, .f = function (out, path) {
url = paste0 (home, path);
text = xml2::read_html (url);
nodes = rvest::html_nodes (text, css = '.related a.question-hyperlink');
purrr::reduce (.init = out, .x = nodes, function (out, node) {
path = rvest::html_attr (node, 'href');
if (path %in% done) {
cat ('what a small world:', path, '\n');
out;
} else {
cat ('i am going to stalk:', rvest::html_text (node), '\n');
c (out, path);
}
});
});
}
});
```
312: 2019/10/19(土)23:50:11.63 ID:V1NSQDNE(1) AAS
素晴らしい
[dataAnim](外部リンク:github.com
``` {r}
with (list (), {
no_thanks = function (...) data.frame (..., stringsAsFactors = F);
j = 1 : 3;
a = no_thanks (name = LETTERS [j], a = j, b = letters [j]);
j = j + 1;
b = no_thanks (name = LETTERS [j], a = j, c = letters [j]);
dataAnim::join_anim (join_type = "left", speed = 1
, x = a, y = b, by = 'name', show_msg = T);
});
```
318: 2019/11/23(土)18:54:17.63 ID:uVrSZXJh(1) AAS
[mathjax-node-page](外部リンク:github.com
を使って`knitr`が作ったMathJaxの数式をsvgに変換する
工具ディレクトリ`$(tool)`に`mathjax-node-page`をインストールする
~~~ {.bash}
cd $(tool)
npm install mathjax-node-page
~~~
ディレクトリ`$(tool)/node_modules/`ができる
ファイル`$(tool)/page.js`を作る
~~~ {.js}
const fs = require ('fs'); const path = require ('path');
const mathjax = require ('mathjax-node-page'); const argv = process.argv;
const usage = () => {
return ['[usage]', path.basename (argv [0]), path.basename (argv [1]), '<input-html-file>'].join (' ');
}; if (argv.length !== 3) { console.log (usage ()); process.exit (1);
}; const encoding = {encoding: 'utf-8'}; const inn_file = argv [2];
const inn = fs.readFileSync (inn_file, encoding);
mathjax.mjpage (inn, {format: ['TeX']}, {svg: true}, (out) => {
process.stdout.write (out); });
~~~
よっこらしょ
~~~ {.bash}
nodejs $(tool)/page.js R/a.html > html/a.html
~~~
オフラインでも読めるようになる
もっと賢い方法があるかも
482: 2023/03/04(土)20:37:50.63 ID:0X36s/jF(3/3) AAS
ワンセットの関数群をインターフェースと書く。
1. Pythonのクラスでは、
* 構造体の定義とインターフェースの定義と実装が同時に行われる。
1. HaskellのクラスやRのS3では、
* 構造体とインターフェースは別々に定義される。
* インターフェースの実装は既存の"構造体"に対して行われる。
HaskellやRの"構造体"には、通常の構造体に加えて、関数も含まれる。
構造体とインターフェースが別々に定義される点で、RのS3はHaskellのクラスに
近いように思う。
おしまい
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.035s