# knitr and external R script

#### jfca283

##### Member
Hi,
I have a R script. My plan is to use rmarkdown and import some values and tables from the global environment produced by the R script.
I've been trying to do that, but I always get errors.
I mean, for example, how can I import the values from the vector "zxc" into knitr in order to print it as an HTML file?

#### Dason

Can you create a minimal reproducible example?

#### jfca283

##### Member
R script
Code:
BJsales
out1=mean(BJsales)
out2=BJsales[NROW(BJsales)]
Rmarkdown
Code:
---
output:
html_document:
df_print: paged
pdf_document: default
word_document: default
---

## Details

### The mean of the data was out1 and the last value was out2
Something like that I need to reproduce. I know that I can especify the source R script inside rmarkdown, but I can't make it work.
By the way, the R script has many lines and I'm extracting many values as out1 and out2. I'm taking about 60.