# Write R Script as Data

You can write an R script to get data. For example, you might want to use R packages like 'Google Trend' to get search terms trending data, use 'Quantmod' package to get financial data like stock prices, currency exchange rates, etc, or write a program to extract data from multiple files and combine into one. You can get pretty much any data in any way by writing R script, it's that powerful.

![](/files/-M4oN74XY6c0QeQZE4yE)

![](/files/-M4oN74Zbz_2v5mgBjBg)

Here's a quick and simple example of how you can write R script as Data.

* [Introduction to tidyquant - Stock Market Data Analysis](https://blog.exploratory.io/introduction-to-tidyquant-quantitative-financial-analysis-for-tidyverse-habitats-e5f72a023ce2)
* [Using dplyr to query databases directly instead of using SQL](https://exploratory.io/note/2ac8ae888097/4608293349858884?cb=1506647866244)
* [How to access to your Spark from Exploratory with sparklyr (SQL version)](https://exploratory.io/note/2ac8ae888097/8385836660075252?cb=1506646442109)
* [Querying Spark Data with dplyr in Exploratory](https://exploratory.io/note/2ac8ae888097/9658701904142809?cb=1506646883371)
* [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.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.
