日録2008年12月 のバックアップ(No.30) - アールメカブ

アールメカブ


日録2008年12月 のバックアップ(No.30)


_ 2008年12月18日 (木) 晴

  • 06:15 起床
    • 07:30 研究室着
  • 午前
    • 朝一で郵便の発送.
    • LaTeX の makeindex で,漢字を指定する場合,読み仮名から濁音などを省く処理を長いこと続けている.すなわち「漢字」であれば以下のようにしているのだが,
      \index{かんし@漢字} 
      ふっと,この根拠は何なのだろうか.検索すると,濁音をそのまま利用している例もあるのだが.
      \index{かんじ@漢字}
      

_ 2008年12月17日 (水) 曇

  • 06:30 起床
    • 07:40 研究室着
  • 午前
    • こういうページがあった.Rserveの試行例が書いてある.
    • 二三の細々した用事を片付ける.
    • T氏とベキ乗モデルの話.モデルを見直して,ロジットに落ち着くべきか?
  • 午後
    • Comparative Box-and-Whisker Plots という言葉があるのだが,これは要するに Box-and-Whisker Plots を複数並べて比較しやすくしたと言うことか.Comparison boxplot という表現もあるが.比較と訳すのも芸がないので,対照箱ひげ図?

_ 2008年12月16日 (火) 晴

  • 06:30 起床
    • 07:40 研究室着
  • 午前
    • RMeCab のインストール方法について書き直し,修正ファイルを関連ページに反映させる.
    • Wedderburn rank reduction

      #mimetex(E = A - \omega^{-1} (Ax) (y^T Y); rank(E) = rank(A)-1) where

      #mimetex(\, \, \, \, \, \omega = y^T A x, x \in R^n, y \in R^m )

  • 午後
    • Lattice のソースで定義されている newcommand だが,使ってしまうかな?

_ 2008年12月15日 (月) 晴

  • 08:30 起床
    • 09:50 研究室着
  • 午前
    • fractional number 「分数」というと,私などはついつい分母の上に分子が乗った形,例えば &mimetex(\frac{1}{2}); をイメージしてしまうのだが,英語圏の本を見ていると,英語のネーティブらは,むしろ小数 0.5 を思い浮かべるような気がする.
  • 午後.工学部で栄養420.目玉焼きののったハンバーグとポテトサラダ,味噌汁,ご飯.
    • 日韓比較データの分析

_ 2008年12月14日 (日) 曇・晴

  • 07:40 起床
    • 一日仕事

_ 2008年12月13日 (土) 晴

  • 07:40 起床
    • 09:00 研究室着
    • 一日仕事
    • Lattice に取りかかる.原著ソースが届いたので,訳出作業と平行して \index を追加し始める.原ソースには \addindex と \index が混在しているので,見にくい.

_ 2008年12月12日 (金) 晴

  • 06:00 起床
    • 07:30 研究室着
  • 午前
    • T氏とデータの分析方法について雑談
    • 10:25-11:55 講義
    • RMeCabのデータセットを作成し直した.
  • 午後.来客と食事
    • 午後から連続で演習
    • 重力モデルとハフモデルについてちょっと調べた
    • シャンペンを少々飲んで就寝

_ 2008年12月11日 (木) 晴

  • 06:00 起床
    • 07:30 研究室着
  • 午前
    • 朝一で,献本の発送を行った.
    • 10:25-12:00 演習
  • 午後
    • 昨日届いた,Lattice のソース一式を改めて眺める.複雑だなぁ.コンパイルにはSweaveを使っている.
    • 日本酒を少々飲んで就寝

_ 2008年12月10日 (水) 晴

  • 06:00 起床
    • 07:30 研究室着
  • 午前
    • 08:35-10:10 演習
    • 献本の準備
  • 午後

_ 2008年12月9日 (火) 晴

  • 06:00 起床
    • 07:30 研究室着
  • 午前
    • RjpWiki? Q&A初級者コースに
      vistaは基本的にC:\Program Files、
      C:\直下には書き込み権限はありません。
      とあった.たまにVistaでRを使ってみるが,パッケージをインストールする際,管理者なのホームフォルダを明示してやらにゃいかんのかぁ!?,と思っていた.
  • 午後

_ 2008年12月8日 (月) 晴

_ 2008年12月7日 (日) 晴

  • 07:30 起床
    • 携帯の電源切れたが,時間がなかったので,とりあえず1時間ほど充電.
    • 午前中,サーバーを設定した部屋で停電があった模様で,サーバーが落ちてしまっていた.そういえば,そういう通知があったな.忘れてた.

_ 2008年12月6日 (土) 晴

  • 07:00 起床
    • 午前中,IASC2008で発表があるのだが,プレゼンは共同研究者に任せ,Rのセッションを見に行く.最後のSimon Urbanek による FastRWeb: Fast Interactive Web Framework for Data Mining Using R が特に印象深かった.
    • 共同発表者の用事を済ませたが,みなとみらい周辺に馴染みはない.東横線で渋谷まで出て,そこからさらに乗り継いで,久しぶり藪蕎麦にいった.15時だというのに込んでいる.日本酒のお燗と突き出し類はうまいのだが,肝心の蕎麦の味がひどく落ちている気がする.ぶつぶつ言いながらも,3合ばかり飲んで,赤坂のホテルに移る.

_ 2008年12月5日 (金) 雨

  • 07:00 起床
  • 12時の飛行機で東京へ
  • 14時時半頃,横浜.
    • 地方で暮らすようになるまでは,しばしば横浜周辺には出かけていたものだが,みなとみらい線には乗ったことがない.みなとみらい駅を出てみると,ものすごい強風である.パシフィコ横浜に隣接するホテルに宿泊.チェックイン後,外を見ると大変な大雨である.
    • 今頃,Rのチュートリアルが開催されているはずだが,他の用事で参加できず.
    • ホテル内で, 『Rによるテキストマイニング入門』森北出版用データをもう一度実行し直してみた.

_ 2008年12月4日 (木) 晴

  • 06:00 起床
    • 07:30 研究室着,
  • 午前
    • 朝いちで,昨日の日本語アンケートデータの分析を続ける.レポート担当のB君のために,多重ロジットモデルの結果の解釈方法を,説明したメモを書く.明日から学会なので,口頭で説明する余裕がない.
    • 10:25-12:00 演習
  • 午後. K 氏,N 氏らと近くのファミレスに.ハンバーグランチ523円なり.
    • Elecomのブックスタンド EDH-004 を買ってみた.Latticeなどの原稿書きを進めるのに,いくつかの本を開きっぱなしに作業しなければならないので,役に立つかもしれないと思ったのだが,結構よさそう.

_ 2008年12月3日 (水) 晴

  • 06:00 起床
    • 07:30 研究室着
  • 午前
    • 今日も一日授業の日だが、合間を縫って、日本語アンケートデータの分析。分析だけではなく、結果をレポートする担当の方のために、解説も書かなければならない。
    • 08:30-10:30 演習
  • 午後
    • データフレームをランダムに二つに分ける処理って、こうする 以外に、もっと簡単な手があった気がするんだが。。。
    • 12:55-16:05 講義
    • 18:00-19:30 演習
    • 面白そうな R パッケージが公開されている.
New Rcpp versions 0.6.0 and 0.6.1
---------------------------------
		
The Rcpp package provides C++ classes that greatly
facilitate  interfacing C
or C++ code in R packages using the .Call() interface
 provided by R.

Rcpp provides matching C++ classes for a large number of 
basic R data  types. 
Hence, a package author can keep his data in normal 
R data structure
without having to worry about translation or transfer
 to C++. 
At the same time, the data structures can be accessed as
 easily  at the C++ level, and used in the normal manner.

The mapping of data types works in both directions.
It is as straightforward to pass data from R to C++, 
as it is it return data from C++ to R.  
The following two sections list supported data types.

Transfer from R to C++:
Standard R datatypes that are understood in C++ are
o named lists containing numeric (i.e. floating point),
  integer,  character, logical (i.e. boolean) or Date and
 Datetime (i.e. POSIXct at
  the microsecond granularity) arguments;
o data frames containing numeric, integer, logical,
 character, Date, Datetime or Factor columns;
o named vectors containing numeric or integer values,
o vectors and matrices of different values
o character strings
 
Transfer from C++ to R:
Standard C++ datatypes can be returned to R 
in a named list,  the most general data type in R.
Permissible components of the returns list are the
following   C++ types:
o double (scalar as well as vectors and vectors of vectors),
o int (scalar as well as vectors and vectors of vectors), 
      string,
o STL vector types and vector<vector> types of int 
      and double
o STL vector of strings
o internal Rcpp types RcppDate, RcppDateVector,
      RcppDatetime,   RcppDatetimeVector, 
      RcppStringVector, RcppVector of int or double,
      RcppMatrix of int or double, RcppFrame
 
Rcpp was initially written by Dominick Samperi as part of 
his contributions to RQuantLib, and later released as a 
standalone package (under both the Rcpp and
 RcppTemplate  names). 
 Its development had ceased in late 2006.
 
As of November 2008, I have made new release with
 substantially expanded documentation, 
simpler yet more comprehensive build structure leading to
easier use of Rcpp from other packages, and 
support for Windows, Linux and Mac OS X 
(with special thanks to Simon for some extended
 cluebat waving).
More information for Rcpp can be found at
o the package homepage at 
http://dirk.eddelbuettel.com/code/rcpp.html
o the R-forge repository at 
https://r-forge.r-project.org/projects/rcpp/
o the CRAN page at
http://cran.r-project.org/web/packages/Rcpp/index.html
Regards,  Dirk
  • すき焼きで獺祭を一杯

_ 2008年12月2日 (火) 晴

  • 06:00 起床
    • 07:30 研究室着
  • 午前
    • 昨日の午後から,花粉症の症状がひどい.例年は,年明けぐらいからなんだけど,,,
    • Lattice にタイタニックのデータがあった,等級ごとの生存割合をみるには,モザイクプロットより分かりやすい気がする.
> barchart(Class ~ Freq | Sex + Age,
             data = as.data.frame(Titanic),
	      groups = Survived, stack = TRUE, layout = c(4, 1),
	      auto.key = list(title = "Survied", colums = 2),
	      scales = list(x = "free") )
  • 午後
    • 14:35-18:30 演習

_ 2008年12月1日 (月) 晴

  • 06:00 起床
    • 07:30 研究室着,
  • 午前
    • Lattice を翻訳していると,目から鱗という機能が山ほどあることに気がつく.
    • Atok for Linux を Emacs 上で使って原稿書いているんだが,時々,Atok がフリーズすることがあって,そんな場合 Emacs ごと落とす羽目になるので,厄介だ.
  • 午後 ひたすらLattice
    • 急に花粉症風の症状が出てきた.何で,突然?
    • latice パッケージの関数は,引数の指定が正しくない場合,妙なエラーや,あるいは妙なグラフを作成している.それはそれで面白いけど.
key.variety <- list(space = "right", 
         text = list(levels(Oats$Variety)), 
         points = list(pch = 1:3, col = "black"))
xyplot(yield ~ nitro | Block, Oats, aspect = "xy", 
         type = "o",  groups = Variety, 
          key = key.variety, lty = 1, pch = 1:3, 
         col.line = "dargrey", col.symbol = "black") 

darkgrey の綴りを間違えて指定すると,グラフは作成されるものの,折れ線の代わりに,「パラメータの設定がおかしいだろう!」というメッセージがずらずらと表示されてしまう. また引数名と間違えると,その引数に設定したオブジェクトがないだろうなどというエラーに遭遇する.

dotplot(variery ~ yield | site,  barley, layout = c(1,6), 
           aspect = c(0.7), grous = year, 
           auto.key = list(space = "right") ) 
以下にエラー bwplot.formula(x = variery ~ yield | site, 
  data = list(yield = c(27,  : 
  オブジェクト "year" は存在しません 

groups の綴りを間違えたんだけど...