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
680
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
920
TokyoR109.pdf
kilometer
1
500
TokyoR#108_NestedDataHandling
kilometer
0
860
TokyoR#107_R_GeoData
kilometer
0
460
SappoRo.R_roundrobin
kilometer
0
160
TokyoR#104_DataProcessing
kilometer
1
720
TokyoR#103_DataProcessing
kilometer
0
930
TokyoR#102_RMarkdown
kilometer
1
680
TokyoR#101_RegressionAnalysis
kilometer
0
510
Other Decks in Technology
See All in Technology
信頼できる開発プラットフォームをどう作るか?-Governance as Codeと継続的監視/フィードバックが導くPlatform Engineeringの進め方
yuriemori
1
360
Delegate authentication and a lot more to Keycloak with OpenID Connect
ahus1
0
240
kintone開発チームの紹介
cybozuinsideout
PRO
0
73k
Amazon Inspector コードセキュリティで手軽に実現するシフトレフト
maimyyym
0
160
Autonomous Database Serverless 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
18
52k
工業高校で学習したとあるエンジニアのキャリアの話
shirayanagiryuji
0
130
Devinを使ったモバイルアプリ開発 / Mobile app development with Devin
yanzm
0
130
生成AIによるソフトウェア開発の収束地点 - Hack Fes 2025
vaaaaanquish
35
16k
Amazon S3 Vectorsは大規模ベクトル検索を低コスト化するサーバーレスなベクトルデータベースだ #jawsugsaga / S3 Vectors As A Serverless Vector Database
quiver
2
1.1k
株式会社ARAV 採用案内
maqui
0
190
あなたの知らない OneDrive
murachiakira
0
210
自治体職員がガバクラの AWS 閉域ネットワークを理解するのにやって良かった個人検証環境
takeda_h
2
360
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
20k
Designing for humans not robots
tammielis
253
25k
Making Projects Easy
brettharned
117
6.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
For a Future-Friendly Web
brad_frost
179
9.9k
[RailsConf 2023] Rails as a piece of cake
palkan
56
5.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Adopting Sorbet at Scale
ufuk
77
9.5k
Building an army of robots
kneath
306
45k
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©