2014-01-01から1年間の記事一覧

表に小さいグラフを埋め込む

表にグラフを取り入れる.http://omnipotent.net/jquery.sparkline/#s-docs のサンプルを参考に、基本を学ぶ. ./jsに jquery.sparkline.js とjquery-2.1.1.jsを保存したあと <head> <script type="text/javascript" src="jquery-2.1.1.js"></script> </head>

JavascriptでCSVを読み取り表をつくる2

以下バグ。 要素ごどに操作できてない。 <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>tryjquery_hide_p test</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("p#time").html("start…</meta></head></html>

NULLに数字を足すときはNULLでなくなるので注意

R

RでNULL型に数字をたすとエラーなしに、空っぽのnumeric型の変数ができるんだな。。 いいっちゃいいんだけど、なんか注意しないとバグの原因になりそうでやっかい。。> a NULL > a > a NULL > cat(a,"\n")> mode(a) [1] "NULL" > a+3 numeric(0) > cat(a+3,"…

Rの実験計画ライブラリの直交表の行列化

メンバー一覧の取得 attributes*1 desnumメンバーを取得 attr*2,"desnum") attrはクラスの引数で与えた要素の取得こっちのが簡単 data.matrix(oa.design(nfactors=factor_len,nlevels=2,seed=1)) data.matrix関数は「行列化+数値化」 *1:oa.design(nfactors=…

jqueryでCSVを読み取り表をつくる

data.csv Taro,Jiro,Saburo Taro1,Jiro1,Saburo1 Taro2,Jiro2,Saburo2 失敗の記録 jquery.csv.jsを使う→うまくいかない。 で指定しないとだめ。だと変なエラーがでる。 とりあえず、固定タグまではhtmlに書く。中身のうごくとこだけjavascriptを使う感じ こ…

nltkのcygwinへの導入

以下はnumpyがインストール済みの場合のnltkのインストール方法です。 numpyをインストールしていない場合は,別にnumpyのインストールが必要の可能性があります。 (0)ソースのダウンロードnltk http://www.nltk.org/install.html wget http://www.nltk.org/…

rubyでデフォルト値をもつ二重Hash

間違え: a=Hash::new() a.default=Hash::new() a["1"]["3"]=5 puts a["2"]["3"] 5が表示される.おそらく参照がおかしくなる.正解(きちんと初期化 Hash.new.each{...} は...がデフォルト処理): a=Hash.new.each{|hash,key| hash[key]=Hash.new(0)} a["1…

お気軽テキスト解析

TinyTextMiner http://mtmr.jp/ttm/ mecabで頻度解析 http://ldl.ic.kanagawa-it.ac.jp/ioroi/programer/wordcount/wordcount.html mecab | cut -f 1 | sort | uniq -c | sort -r -n パスを通す cygwin 上だと文字コードの都合でうまくいかないので,デフォ…

実験計画法のチュートリアル tutorial desing of experiments using R

tutorial desing of experiments using R http://www1.beuth-hochschule.de/FB_II/reports/Report-2011-004.pdf Rの実験計画法関連の一覧 http://web.warwick.ac.uk/statsdept/user2011/TalkSlides/Invited/Gromping-Design_of_Experiments.pdf oa.design(ID…

Rで組み合わせ一覧を取得する

R

library(gtools) combinations(n=20,r=10,1:20) 参考 http://d.hatena.ne.jp/yusap/20130518/1368845756

igraphで多重エッジを取り除く

g 太さを変える。 g weight E(g)$weight E(g)$width=E(g)$weighthttp://kappa-bioinformatics.blogspot.jp/2011/02/gene-ontologygodb.htmlhttp://homepage3.nifty.com/kaku-chan/graphviz/chapter_005.html矢印の大きさは変えられないらしい arrow.size を…

Rでデバッグ

Rのデバッグ http://stat.biopapyrus.net/dev/debug.html エラーの原因の関数をさぐる。エラー後実行 traceback() browser() をしかける。ここからデバッグモードを入る。 f z browser() return(z) } デバックモードに入るので、 ls で参照可能な変数をみる…

Rのbs()関数の解読

Rのbs関数の解読 以下コピペ function (x, df = NULL, knots = NULL, degree = 3, intercept = FALSE, Boundary.knots = range(x)) { x <- x if (smart.mode.is("read")) { return(eval(smart.expression)) } nx <- names(x) x <- as.vector(x) nax <- is.na…

Rで日付の文字列化

Rで日付の文字列化format関数 t cat(forman(t),"\n") t2 write.table(data.frame(forman(t2)))

端末から端末のカレントディレクトリをGUIで開く

nautilus .