Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
68th Tokyo.R Beginner session1
Search
kilometer
March 03, 2018
Technology
1
650
68th Tokyo.R Beginner session1
第68回Tokyo.Rの初心者セッション1:data import/exportのスライドです。
kilometer
March 03, 2018
Tweet
Share
More Decks by kilometer
See All by kilometer
TokyoR#111_ANOVA
kilometer
2
830
TokyoR109.pdf
kilometer
1
440
TokyoR#108_NestedDataHandling
kilometer
0
750
TokyoR#107_R_GeoData
kilometer
0
390
SappoRo.R_roundrobin
kilometer
0
120
TokyoR#104_DataProcessing
kilometer
1
660
TokyoR#103_DataProcessing
kilometer
0
850
TokyoR#102_RMarkdown
kilometer
1
610
TokyoR#101_RegressionAnalysis
kilometer
0
350
Other Decks in Technology
See All in Technology
Lambdaと地方とコミュニティ
miu_crescent
2
370
【若手エンジニア応援LT会】ソフトウェアを学んできた私がインフラエンジニアを目指した理由
kazushi_ohata
0
150
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
元旅行会社の情シス部員が教えるおすすめなre:Inventへの行き方 / What is the most efficient way to re:Invent
naospon
2
330
TypeScript、上達の瞬間
sadnessojisan
46
13k
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
150
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Designing the Hi-DPI Web
ddemaree
280
34k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
For a Future-Friendly Web
brad_frost
175
9.4k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Building Applications with DynamoDB
mza
90
6.1k
Building an army of robots
kneath
302
43k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Transcript
@kilometer BeginneR Session 1 -- Data
Import / Export -- 2018.03.03 at Shiodome
Who
Who @kilometer Postdoc (Ph.D engineering)
Animal Behavior Neuro Imaging Medical Engineering R ~ 10 years? :
BeginneR Session
Before After BeginneR Session
Input Output Today’s talk ? ? Table data Image data
Other formats Introduction Summary
! # $"
$ $
# % &$
! & ! & "
! "
" "
! "
" "
Input Output Do NOT start from here
Input Output Do NOT start from here Whatever …
Input Output Do NOT start from here Whatever … 1
2 3
Input Output Today’s talk ? ?
Integrated Development Environment RStudio https://www.rstudio.com/ !
Integrated Development Environment RStudio https://www.rstudio.com/
RStudio
Projects RStudio
RStudio > Project .H21474836474<: G RStudio 7@ ,R&-%("#+!')0FC ,')JA!3? ,')6=!("#+!3<
RStudio!E1 ฤू్தͷ༰Λอ࣋ D5921474836472R*-$-QOL!;8/ BI > 34UVEJPͬͯͳΜͩʁ 1SPKFDUͬͯͳΜͩ !XBLVUFLB https://qiita.com/wakuteka/items/9599bb0a8985d98928d7
RStudio > Project R +( .'"&
#%"$ RStudio)! *- , #%"& 34UVEJPͬͯͳΜͩʁ 1SPKFDUͬͯͳΜͩ !XBLVUFLB https://qiita.com/wakuteka/items/9599bb0a8985d98928d7
File > New Project… > New Directory > New Project
hogehoge
hogehoge ~/Documents/R hogehoge.Rproj .Rproj.user Project Root Directory Double click!! .RData
.Rhistory Auto saved project information Open project New!!
~/Documents/R project1 project2 project3 project4
Input Output Today’s talk ? ? Table data Image data
Other formats Summary Introduction
Table format data Table data Image data Other formats Introduction
Summary
Table format data Comma-separated values (.csv) Tab-separated values (.tsv) Space-SV
Semicolon-SV … Delimiter-separated values or Character-SV
Import Table format
data object assignment operator file path function
Import Table format
data object assignment operator file path function
~/Documents/ import.txt data
or 1. set working directory 2. then use relative path Method②: use absolute path Method ① Import Table format data
# # Method②: use absolute path Method ①: setwd –
relative path " # or
prj ~/Documents/R prj.Rproj import.txt Default working directory (project root)
can use relative path without
Import Table format data
Import Table format data
) ! ( ) ! ! ( ) ∖ #
" !( !! ! (( # ! (( # ! (( # " ( ! # " ( ( ( () # ( ( ) ( # () # ( ! ! (( ( # ( ( # " ( !! ! # ! # ( ( () ) ! # ! # ( ( "" #) !! ( ( ! ( () # ( ( ) ( !) () # ( ( ) ( ! # # # # # # # ) ,) ( ! Import Table format data
) ! ( ) ! ! ( ) ∖ #
" !( !! ! (( # ! (( # ! (( # " ( ! # " ( ( ( () # ( ( ) ( # () # ( ! ! (( ( # ( ( # " ( !! ! # ! # ( ( () ) ! # ! # ( ( "" #) !! ( ( ! ( () # ( ( ) ( !) () # ( ( ) ( ! # # # # # # # ) ,) ( ! Import Table format data
Usage read.table(file, skip = 0, header = FALSE,
nrows = -1, row.names, fileEncoding = "") Import Table format data
cf. R-Tips: 40. http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html
Import Table format data
" " " " " cf. R-Tips: 40.
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
" " " " " cf. R-Tips: 40.
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
" " " " " cf. R-Tips: 40.
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
" " " " " cf. R-Tips: 40.
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
" " " " " cf. R-Tips: 40.
# $ http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data # &_"# $ # " # "/! # %"
" " " " " cf. R-Tips: 40.
# $ http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data # &_"# $ # " # "/! # %"
67 1 @y__mattu https://github.com/ymattu/TokyoR67 Import Table format data
∖ Import Table format data Wrap
Import Table format data
Wrappers
Import Table format data
Wrappers
Package … {utils} Package {base} Package
Package Package Package Package Package Package Package Package Package Package
Package Package Package Package Package
packages
cf. http://rpkg.gepuro.net/ cf. https://cran.r-project.org/web/packages/ at 2018.02.20
Package Default pkgs Package Package Package CRAN Guithub Package Package
Package Package Package Package Package Package
Import Table format data Default
installed pkg (optional) Function Install REQUIRED
Import Table format data List of installed packages
Import Table format data
Installation (from CRAN) Usage or
Import Table format data Global environment # Attach {data.table}
Import Table format data
Fast!!! Flexible!!! Need installation Should specify: data.table =FALSE Automatic!!! Simple!!!
object file path Export Table format data Wrapper
Input Output Today’s talk ? ? Table data Image data
Other formats Summary Introduction
Image data Table data Image data Other formats Summary Introduction
Export image data ?
Export image data Use Graphic Device ready graphic device close
graphic device draw graph(s) plotting functions High-level Low-level Interactive Basic Graphics in R http://bcb.dfci.harvard.edu/~aedin/courses/BiocDec2011/2.Plotting.pdf
Export image data Use Graphic Device ready close draw
High-level plotting function
hogehoge ~/Documents/R hogehoge.Rproj hoge.png New!!
Export image data Graphic Devices in
Export image data Graphic Devices in
ready graphic device close graphic device draw graph(s)
Image data processing Import & Export image processing
Import image data
Import image data
Import image data
Import image data
Import image data
Export image data # not CRAN pkg # low googlability !
Import image data
Export image data # not CRAN pkg # low googlability !
None
None
None
Salvador Dalí 1904-1989 profile of time wikipedia
http://seekr.jp/
None
None
Input Output Today’s talk ? ? Table data Image data
Other formats Summary Introduction
Table data Image data Other formats Other formats Summary Introduction
.xls or .xlsx GJMFQBUI
TIFFUOBNFPS/P
.json Wrap
Wrap
.wav or .mp3
.sas or .dta or .sav SAS Stata SPSS
Table data Image data Other formats Summary Introduction
Input Output Do NOT start from here Whatever … 1
2 3
Data Import / Export ? ?
packages
Data Import / Export ? ?
packages
~/Documents/R project1 project2 project3 project4
Before After BeginneR Session ?
! KMT©
KMT©