# Write R Script as Data (日本語)

Exploratoryの中で、R スクリプトを書いてデータを取得できます。例えば"Google Trend"のようなR パッケージを使って検索用語のトレンディングデータを取得したり、"Quantmod"パッケージを使って株価、為替レートのような金融データを取得したり、または複数のファイルからデータを抽出して一つのデータフレームにするプログラムを書くこともできます。Rスクリプトを使うと、様々なデータを色々な方法で取得できるようになり、とても強力な機能です。

![](/files/-M4oN74XY6c0QeQZE4yE)

![](/files/-M4oN74Zbz_2v5mgBjBg)

Rスクリプトを使ってデータを取得する、簡単に試せる例をいくつか以下に紹介しておきます。

* [Introduction to tidyquant - Stock Market Data Analysis(英語)](https://blog.exploratory.io/introduction-to-tidyquant-quantitative-financial-analysis-for-tidyverse-habitats-e5f72a023ce2)
* [SQLがややこしいのでdplyrでクエリーを書いて直接データベースからデータを取ってくる](https://exploratory.io/note/2ac8ae888097/7616236230994462?cb=1506281367163)
* [SparklyrでExploratoryからSparkに接続してみる (SQL編)](https://exploratory.io/note/2ac8ae888097/2569131745987096?cb=1506281323040)
* [SparklyrでExploratoryからSparkに接続してみる (dplyr編)](https://exploratory.io/note/2ac8ae888097/0305916276166750?cb=1506281306518)
* [Accessing SQLite with RSQLite and Querying with dplyr in R Script(英語)](https://exploratory.io/note/2ac8ae888097/6847080671738131)


---

# Agent Instructions: 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:

```
GET https://docs.exploratory.io/data_import/r-script-data_ja.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
