(This article was first published on

**R – The Hack-R Blog**, and kindly contributed to R-bloggers)**>> sample_size = 10**

>> R.eval “x <- rnorm(#{sample_size})”

>> R.eval “summary(x)”

>> R.eval “sd(x)”

>> R.eval “x <- rnorm(#{sample_size})”

>> R.eval “summary(x)”

>> R.eval “sd(x)”

With a here document:

```
require "rinruby"
#Set all your variables in Ruby
n = 10
beta_0 = 1
beta_1 = 0.25
alpha = 0.05
seed = 23423
R.x = (1..n).entries
#Use actual R code to perform the analysis
R.eval <
```

```
```

```
```

To **leave a comment** for the author, please follow the link and comment on their blog: ** R – The Hack-R Blog**.

R-bloggers.com offers **daily e-mail updates** about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...