> For the complete documentation index, see [llms.txt](https://sugiaki1989.gitbook.io/r-for-data-science-answers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sugiaki1989.gitbook.io/r-for-data-science-answers/chapter02-basis.md).

# 2章 ワークフロー：基本

### 2.0 ライブラリーの読み込み&#x20;

```
library("tidyverse")
```

### 2.1 コーディングの基本

{% hint style="info" %}
練習問題はありません
{% endhint %}

### 2.2 名前の中には何があるのか。

{% hint style="info" %}
練習問題はありません
{% endhint %}

### 2.3 関数呼び出し

#### 練習問題1 : 次のコードは何がおかしいのか。

`i`が`ı`になっているためエラーが起こります。類似文字を区別しやすいフォントを使うことを推奨します。`o(O)`と`0(zero)`や`I(I)`と`l(L)`などです。

```
my_variable <- 10
my_varıable
エラー:  オブジェクト 'my_varıable' がありません 
```

#### 練習問題2 : 次のRコマンドを正しく修正してください。

`data`が`dota`になっているため、エラーが起こります。タイポはよくあるので気をつけるしかありません。

```
ggplot(dota = mpg) +
  geom_point(mapping = aes(x = displ, y = hwy))
 FUN(X[[i]], ...) でエラー:  オブジェクト 'displ' がありません 
```

`filter()`が`fliter()`になっているため、エラーが起こります。

```
fliter(mpg, cyl = 8)
fliter(mpg, cyl = 8) でエラー: 
  関数 "fliter" を見つけることができませんでした 
```

`diamonds`が`diamond`になっているため、エラーが起こります。

```
filter(diamond, carat > 3)
filter(diamond, carat > 3) でエラー: 
  オブジェクト 'diamond' がありません 
```

#### 練習問題3 : Alt + Shift + Kを押すと何が起こるのか。

キーボードショートカットが表示されます。メニューの`Tools -> Keyboard Shortcuts Help`からでも表示できます。

![](/files/-LgvCmGvtt8ZEJVoCYRG)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sugiaki1989.gitbook.io/r-for-data-science-answers/chapter02-basis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
