Can you clarify please? R is an interpreted language so there is no compiling, maybe you actually mean that you are trying to knit your document?
This suggests that you are including install commands in your Rmd file, you shouldn't do that, you only need to install packages once, if you include these commands in your file, R is going to try to install them each time you knit your document.
I have an R script (.R) and I wanted to ''transform'' it into something like in R markdown or a jupyter notebook, however, R markdown won't run some of my lines of code and jupyter notebook uploads my script as text.
At the top of my script, next to a ''wand'' there's a notebook that says ''compile report'' and that's what I was using.
I don't use Jupyter, I use R and RStudio so I will restrict my comments to that.
Have you therefore rewritten your script placing the 'code' portions you want into designated code blocks, using backticks etc, and otherwise adding your own text around it ? the rmarkdown headers are important also I believe.
I tried line by line but at some point it had problems running.
I guess my overall question would be if there is a quick way of transfering my R script to an R markdown instead of having to input each bit of code line by line.
You can familiarise yourself with the basics. With this resource.
Presumably the simplest thing you can do, is have your headers and make a single code chunk for all your old rscript.
However I don't see this giving you any advantage over the plain r script. But I suppose you can start there and iterate.