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
1
820
TokyoR109.pdf
kilometer
1
430
TokyoR#108_NestedDataHandling
kilometer
0
740
TokyoR#107_R_GeoData
kilometer
0
390
SappoRo.R_roundrobin
kilometer
0
120
TokyoR#104_DataProcessing
kilometer
1
650
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
CI/CDやテスト自動化の開発プロジェクトへの適用
megascus
3
700
AI Builder について
miyakemito
1
150
「最高のチューニング」をしないために / hack@delta 24.10
fujiwara3
18
3.1k
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
110
Vueで Webコンポーネントを作って Reactで使う / 20241030-cloudsign-vuefes_after_night
bengo4com
4
2.4k
生成AIとAWS CDKで実現! 自社ブログレビューの効率化
ymae
2
280
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.6k
[AWS JAPAN 生成AIハッカソン] Dialog の紹介
yoshimi0227
0
130
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
410
プロダクト成長に対応するプラットフォーム戦略:Authleteによる共通認証基盤の移行事例 / Building an authentication platform using Authlete and AWS
kakehashi
1
120
WHOLENESS, REPAIRING, AND TO HAVE FUN: 全体性、修復、そして楽しむこと
snoozer05
PRO
3
6.4k
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
22
6.4k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Designing for humans not robots
tammielis
249
25k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
The Language of Interfaces
destraynor
154
24k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
780
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
360
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
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©