Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rの基礎 3 ベクターの操作
Search
xjorv
January 17, 2021
Education
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rの基礎 3 ベクターの操作
Rの基礎3では、Rでデータを取り扱う場合の基礎となる、ベクター(Vector)の作り方や使用方法を説明します。
xjorv
January 17, 2021
More Decks by xjorv
See All by xjorv
コンパートメントモデル
xjorv
3
6.1k
コンパートメントモデルをStanで解く
xjorv
0
540
生物学的同等性試験 検出力の計算法
xjorv
0
3.7k
生物学的同等性試験ガイドライン 同等性パラメータの計算方法
xjorv
0
6.7k
粉体特性2
xjorv
0
2.6k
粉体特性1
xjorv
0
3k
皮膜5
xjorv
0
2.4k
皮膜4
xjorv
0
2.3k
皮膜3
xjorv
0
2.3k
Other Decks in Education
See All in Education
本格化するOSSベースのソフトウェア駆動型開発とセキュリティ技術最前線
lfj
PRO
0
100
2026年度秋学期 統計学 講義の進め方と成績評価について (2026. 9. 28)
akiraasano
PRO
0
230
Human Perception and Cognition - Lecture 4 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.7k
学生のうちに考えておきたい信頼の話
suisan
1
830
SANG PENCIPTA BERBICARA (01ABSG-Q4-2026)
ssmedikasda
0
430
Introduction to M&A
bvr7352
0
230
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 1
hiola
0
12k
1人 × AI、1か月でここまで作れる ー 数年前の外注換算3.8〜7.4億円・241〜379人月分の作業を、AI費用 約10万円・31日で
frievea
0
560
武藤の処世術を書いてみた
mutomasa
0
130
Antigravityを使ってGeminiAPI(NanobananaPro)と連携して挿絵メーカーを作った
yoshimura_datam
0
250
Web Application Frameworks - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
【2026年サマースクール用ZEPメタバース校舎操作ガイド】
ainischool
0
130
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
247
13k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
We Are The Robots
honzajavorek
0
390
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Technical Leadership for Architectural Decision Making
baasie
3
590
ラッコキーワード サービス紹介資料
rakko
1
5.2M
Marketing to machines
jonoalderson
1
5.9k
GitHub's CSS Performance
jonrohan
1033
470k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Transcript
Rの基礎 3 ベクターの操作 2020/8/5 Ver. 1.0
ベクターとは? 数値・文字列、もしくはその集合のこと “a” 1 c(1, 2) c(“a”, “b”, “c”) 文字列はベクター
数値もベクター 数値のまとまりもベクター 文字列のまとまりもベクター c()は“combine”の略で、数字や文字を”結合する”ための関数
ベクターの作り方 基本的にcを使うが、他の方法もある :(コロン)を使うと連続した数を生成できる repやseq関数で繰り返しベクターを生成できる
ベクターのインデックス ベクターにはインデックスがあり、中身をインデックスで指定できる ベクター 1 2 3 2 4 6 インデックス
代入された数値 インデックスは[]に挟んで記入する *他の言語で配列(array、list)と呼ばれるものに近い
ベクターの演算 ベクターは演算可能で、結合もできる
ベクターと関数 ベクターを引数にできる関数を使えば、演算ができる mean()は平均値 sd()は標準偏差 max()は最大値 min()は最小値 median()は中央値 を求める関数
ベクターから条件にあったものを取り出す 条件式から、Boolean(真偽値)が得られる 3と等しいものの真偽値 4より小さいものの真偽値
ベクターから条件にあったものを取り出す []内に条件式を書けば、真になるものだけ取り出せる 3と等しいものだけ取り出す 4より小さいものだけ取り出す
ベクターの要素の名前 ベクターの要素には名前を付けることができる names()は名前の取り出し/代入のための関数
名前で要素を取り出し ベクターの要素を名前で取り出すこともできる a[names(a) == “cat”]と同じ 名前と要素を結び付けてデータを引き出せる *名前と要素を結び付けるのは他言語でHashやDictionaryと呼ばれる型に当たる
まとめ • ベクターは数値や文字列の集まりのこと • ベクターは演算できる • ベクターの要素はインデックスで取り出せる • ベクターの要素には名前を付けることができる