Tsukubar8

1,985 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,985
On SlideShare
0
From Embeds
0
Number of Embeds
619
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Tsukubar8

  1. 1. For the Interactive Design Using R R Tsukuba.R #8 @yag_ays
  2. 2. • @yag_ays ( ) • M1 • • • DBCLS •
  3. 3. Tsukuba.R • #4 • #5 • #6 diagram • #7 *blottan*
  4. 4. • • R • RSRuby
  5. 5. ... • • • ( ) •
  6. 6. http://twitter.com/iNut/status/24541521327 http://www.slideshare.net/ybenjo/tsukubar7-4027417
  7. 7. • • • • •
  8. 8. NM_019441 -371 15918 873 43.9056603773585 NM_029791 -45113 -45199 -45117 0.00190269696232218 NM_172755 -15823 -16895 -16815 0.0634507250665877 NM_133766 373 373 357 0.0448179271708683 NM_026742 -314 -1234 -1234 0.745542949756888 NM_009892 -3272 -10724 -3274 0.694889966430436 NM_133939 -657 -478 -495 0.272450532724505 NM_133685 -113 -117 -1952 0.942110655737705 NM_178592 217 173 201 0.254335260115607 NM_053159 2554 1662 2128 0.536702767749699 NM_030559 934 573 573 0.630017452006981 NM_020586 300 239 221 0.357466063348416 NM_027978 -879 -953 -964 0.0881742738589212 NM_026661 -821 -18169 -18153 0.954813143266003 NM_008819 -9574 -9513 -19638 0.515582034830431 NM_024211 -465 -450 -490 0.0816326530612245 NM_001045864 -154 213 199 2.38311688311688 NM_030113 -2119 -12733 -2119 0.833582030943218 NM_026467 2377 662 192 11.3802083333333 NM_030254 56722 56190 56503 0.00946787684641395 NM_001161851 -524 -2513 12607 6.01671309192201 NM_008828 1054 990 571 0.845884413309983 NM_025797 -544 -407 -549 0.258652094717668 NM_001113198 -106878 -130782 -94520 0.27727057240293 NM_053068 -3535 -1384 -3492 0.608486562942009 NM_001013806 1175 15158 1042 13.5470249520154 NM_026119 1300 18771 1293 13.5174013921114 NM_025379 385 1891 -491 4.85132382892057 NM_025813 12563 4047 3138 3.00350541746335 NM_181070 2161 1481 1486 0.459149223497637 NM_007918 1038 138 1086 6.8695652173913 NM_008929 3803 5213 3406 0.530534351145038 NM_207515 2071 2066 2071 0.00242013552758954 NM_001113417 -69003 -70568 -68990 0.022361410 NM_153056 -275 -296 -302 0.0894039735099338 NM_010738 -51178 -50897 -51175 0.005490640509593
  9. 9. http://jp.makezine.com/blog/2010/07/massive_printable_tree_of_life_grap.html
  10. 10. • • • • R • TIBCO Spotfire • Excel
  11. 11. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 9 10 34 10 11 17
  12. 12. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 9 10 34 10 11 17
  13. 13. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 9 10 34 10 11 17
  14. 14. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 9 10 34 10 11 17
  15. 15. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 9 10 34 10 11 17
  16. 16. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 9 10 34 10 11 17
  17. 17. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 ... apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 speed dist 9 10 34 15.40 42.98 10 11 17
  18. 18. R speed dist data(cars) 1 4 2 head(cars) 2 4 10 cars[1,2] 3 7 4 cars$speed 4 7 22 cars[cars$speed<5,] 5 8 16 apply(cars,2,mean) 6 9 10 table(cars$speed) 7 10 18 8 10 26 4 7 8 9 10 11 12 13 9 10 34 2 2 1 1 3 2 4 4 10 11 17
  19. 19. R http://bm2.genes.nig.ac.jp/RGM2/index.php
  20. 20. TIBCO Spotfire • TIBCO Spotfire • • R S-PLUS “ TIBCO Spotfire Analytics Spotfire ” http://spotfire.tibco.jp/products/overview/analytics-products.aspx
  21. 21. TIBCO Spotfire
  22. 22. TIBCO Spotfire • • “Details on Demand” •
  23. 23. Excel •
  24. 24. R ... • R • R R •
  25. 25. Rails • RSRuby + Ruby on Rails R • • •
  26. 26. Ruby on Rails • Ruby web • MySQL Sqlite3 DB rails hoge cd hoge ruby script/generate scaffold hoge id:integer val:integer rake db:migrate
  27. 27. RSRuby • “RSRuby is a bridge between Ruby and the R interpreted language.” http://rubyforge.org/projects/rsruby/ • Ruby R • Tsukuba.R #7 @jj0c_0jjj • 2009 Feb. http://open-bio.jp/archive/20070302_OB6/OB6-RSRuby-Gutteridge.pdf
  28. 28. • Project : misanote • Ruby on Rails http://g86.dbcls.jp/misanotes/ • RSRuby
  29. 29. RSRuby on Rails • Rails RSRuby • Rails RSRuby • Rails
  30. 30. RSRuby sudo gem install -- --with-R-dir=/usr/lib/R • • Mac OSX --with-R-dir=/opt/local/ lib/R
  31. 31. RSRuby yag_ays@g86:~% irb > require 'rubygems' => true > require 'rsruby' => true > r = RSRuby.instance => #<RSRuby:0x1011e0bc0 ... > r.rnorm(10) => [1.10492948446846, ...
  32. 32. Rails • config/environment.rb Rails::Initializer.run do |config| config.gem 'rsruby' end • RSRuby Ruby 1.9 Rails 3.0
  33. 33. • • • Rails
  34. 34. a = [] open("path/data.txt","r"){|f| f.each{|l| a.push(l.chomp.split("t")[1].to_i) } } • Ruby • RSRuby [1,2,3] • RSRuby read_csv ...
  35. 35. RSRuby @misanote.each do |misanote| @@r = RSRuby.instance @@r.png("path/#{misanote.id}.png") @@r.hist(a,:xlab => "x",:ylab => "y", :xlim => [-10000, 10000], :nclass => 10000, :main => "#{misanote.id}") @@r.abline(:v => misanote.diff, :lty => 1,:lwd => 5,:col => 2) @@r.eval_R("dev.off()") end
  36. 36. Rails @@r = RSRuby.instance @@r.png("path/#{misanote.id}.png") @@r.hist(a, :xlab => "x", :ylab => "y", :xlim => [-10000, 10000], :nclass => 10000, :main => "#{misanote.id}") @@r.abline(:v => misanote.diff, :lty => 1, :lwd => 5, :col => 2) @@r.eval_R("dev.off()")
  37. 37. a = [] open("path/data.txt","r"){|f|f.each{|l| a.push(l.split("t")[1].to_i)}} @misanote.each do |misanote| @@r = RSRuby.instance @@r.png("path/#{misanote.id}.png") @@r.hist(a, :xlab => "x label", :ylab => "y label", RSRuby :xlim => [-10000, 10000], :nclass => 10000, :main => "#{misanote.id}") @@r.abline(:v => misanote.diff, :lty => 1, :lwd => 5, :col => 2) @@r.eval_R("dev.off()") end
  38. 38. ID : NM_027468 ID : NM_153774
  39. 39. • • • ID •
  40. 40. • • • ggplot2 • zip
  41. 41. • Ajax jQuery • R •
  42. 42. • • Rails • RSRuby ... •

×