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
850
TokyoR109.pdf
kilometer
1
450
TokyoR#108_NestedDataHandling
kilometer
0
770
TokyoR#107_R_GeoData
kilometer
0
410
SappoRo.R_roundrobin
kilometer
0
130
TokyoR#104_DataProcessing
kilometer
1
670
TokyoR#103_DataProcessing
kilometer
0
870
TokyoR#102_RMarkdown
kilometer
1
620
TokyoR#101_RegressionAnalysis
kilometer
0
370
Other Decks in Technology
See All in Technology
12 Days of OpenAIから読み解く、生成AI 2025年のトレンド
shunsukeono_am
0
670
AI×医用画像の現状と可能性_2024年版/AI×medical_imaging_in_japan_2024
tdys13
0
430
2024年にチャレンジしたことを振り返るぞ
mitchan
0
160
組み込みアプリパフォーマンス格闘記 検索画面編
wataruhigasi
1
180
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
200
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
39k
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
340
10年もののバグを退治した話
n_seki
0
110
20241220_S3 tablesの使い方を検証してみた
handy
4
780
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
180
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
250
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Music & Morning Musume
bryan
46
6.2k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Designing for Performance
lara
604
68k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Statistics for Hackers
jakevdp
796
220k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
1
120
Done Done
chrislema
182
16k
Optimising Largest Contentful Paint
csswizardry
33
3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Visualization
eitanlees
146
15k
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©