[R-SIG-Mac] R code chunks

Mark Sharp msharp at txbiomed.org
Tue Apr 12 17:33:22 CEST 2016


Ivan,

Perhaps you are not aware of the ability to open scripts in a new window within the RStudio IDE. Look up the RStudio IDE tutorial on the subject at (https://support.rstudio.com/hc/en-us/articles/207126217-Using-Source-Windows).

However, there is no way to have multiple copies of the same document within the same instance of RStudio. I use multiple instances of RStudio running for that purpose when I am looking at code in more than one location within the same script.

R. Mark Sharp, Ph.D.
Director of Primate Records Database
Southwest National Primate Research Center
Texas Biomedical Research Institute
P.O. Box 760549
San Antonio, TX 78245-0549
Telephone: (210)258-9476
e-mail: msharp at TxBiomed.org







> On Apr 12, 2016, at 9:20 AM, Ivan Calandra <ivan.calandra at univ-reims.fr> wrote:
>
> Thanks a lot John.
> I had tried, but only with the whole Editor window, not trying to extract single tabs from the Editor window...!
>
> Ok, I think I'll switch to RStudio then, but still, the Mac R Editor is great ;)
>
> Ivan
>
> --
> Ivan Calandra, PhD
> University of Reims Champagne-Ardenne
> GEGENAA - EA 3795
> CREA - 2 esplanade Roland Garros
> 51100 Reims, France
> +33(0)3 26 77 36 89
> ivan.calandra at univ-reims.fr
> --
> https://www.researchgate.net/profile/Ivan_Calandra
> https://publons.com/author/705639/
>
> Le 12/04/2016 15:56, John Magnotti a écrit :
>> Hi Ivan,
>>
>> The latest version of RStudio does allow for at least the Source Editor windows to be popped out of the main RStudio window. And you can create a new graphics device (dev.new()) which effectively pops the graph window out as well. I've found multiple sources windows + graph windows on one monitor and the rest of RStudio on another monitor is reasonably close to my workflow with R.app.
>>
>> take care,
>>
>> John
>>
>> On Tue, Apr 12, 2016 at 8:53 AM, Ivan Calandra <ivan.calandra at univ-reims.fr <mailto:ivan.calandra at univ-reims.fr>> wrote:
>>
>>    Thank you Mollie and all,
>>
>>    So it looks like there's no way to properly use chunks within the
>>    Mac R GUI.
>>    I will have to decide whether I completely switch to RStudio, or
>>    develop in the R GUI and then run in RStudio.
>>
>>    Still, until now I was a great fan of the R GUI on Mac so I'm a
>>    bit frustrated. It would be great if this feature were integrated
>>    to the R GUI some day! Alternatively, a better GUI for RStudio
>>    allowing for multiple screens would be fine too (but that's for
>>    another list!).
>>
>>    Bests,
>>    Ivan
>>
>>    --
>>    Ivan Calandra, PhD
>>    University of Reims Champagne-Ardenne
>>    GEGENAA - EA 3795
>>    CREA - 2 esplanade Roland Garros
>>    51100 Reims, France
>>    +33(0)3 26 77 36 89 <tel:%2B33%280%293%2026%2077%2036%2089>
>>    ivan.calandra at univ-reims.fr <mailto:ivan.calandra at univ-reims.fr>
>>    --
>>    https://www.researchgate.net/profile/Ivan_Calandra
>>    https://publons.com/author/705639/
>>
>>    Le 12/04/2016 15:05, Mollie Brooks a écrit :
>>
>>        Hi Ivan,
>>
>>        Using the R GUI and the built-in editor, you should be able to
>>        format your document in the standard Rmarkdown or knitr way
>>        and save it with the appropriate extension (Rmd or Rnw), but
>>        only run lines within chunks in the console (using command +
>>        enter in the normal way). You can make sure all the chunks are
>>        working in that way. Then to format the whole document you can
>>        use a command in the Terminal as described in the links Tom
>>        sent or reopen the document in Rstudio.
>>
>>        Somehow my R GUI can’t find the right pieces to make the pdf,
>>        so I have to use the Terminal. render("EstObsErr.Rmd")
>>        produces the error
>>        /usr/local/bin/pandoc EstObsErr.utf8.md
>>        <http://EstObsErr.utf8.md> --to latex --from
>>        markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures
>>        --output EstObsErr.pdf --template
>>        /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/latex/default-1.14.tex
>>        --highlight-style tango --latex-engine pdflatex --variable
>>        'geometry:margin=1in'
>>        pandoc: pdflatex not found. pdflatex is needed for pdf output.
>>        Error: pandoc document conversion failed with error 41
>>
>>        cheers,
>>        Mollie
>>
>>        ------------------------
>>        Mollie Brooks, PhD
>>        Postdoctoral Researcher, Population Ecology Research Group
>>        Department of Evolutionary Biology & Environmental Studies,
>>        University of Zürich
>>        http://www.popecol.org/team/mollie-brooks/
>>
>>            On 12Apr 2016, at 12:57, Ivan Calandra
>>            <ivan.calandra at univ-reims.fr
>>            <mailto:ivan.calandra at univ-reims.fr>
>>            <mailto:ivan.calandra at univ-reims.fr
>>            <mailto:ivan.calandra at univ-reims.fr>>> wrote:
>>
>>            Thank you for your answer.
>>
>>            I don't usually use the Terminal, so I'm not sure how to
>>            do it.
>>            But do you mean to start it from the Terminal and then use
>>            the R GUI or do everything in the Terminal? In the latter
>>            case, I would prefer using RStudio... My question was
>>            about using the R GUI Editor rather than RStudio.
>>
>>            Ivan
>>
>>            --
>>            Ivan Calandra, PhD
>>            University of Reims Champagne-Ardenne
>>            GEGENAA - EA 3795
>>            CREA - 2 esplanade Roland Garros
>>            51100 Reims, France
>>            +33(0)3 26 77 36 89 <tel:%2B33%280%293%2026%2077%2036%2089>
>>            ivan.calandra at univ-reims.fr
>>            <mailto:ivan.calandra at univ-reims.fr>
>>            <mailto:ivan.calandra at univ-reims.fr
>>            <mailto:ivan.calandra at univ-reims.fr>>
>>            --
>>            https://www.researchgate.net/profile/Ivan_Calandra
>>            https://publons.com/author/705639/
>>
>>            Le 12/04/2016 11:41, Tom Hopper a écrit :
>>
>>                Ivan,
>>
>>                You need to run knitr manually from the terminal
>>                (RStudio automates this with the “knit” button). See
>>
>>                http://joshldavis.com/2014/04/12/beginners-tutorial-for-knitr/
>>                http://kbroman.org/knitr_knutshell/pages/Rmarkdown.html
>>
>>                for short tutorials on using knitr from the terminal.
>>
>>                Regards,
>>
>>                Tom
>>
>>                    On 201604 12, at 05:15, Ivan Calandra
>>                    <ivan.calandra at univ-reims.fr
>>                    <mailto:ivan.calandra at univ-reims.fr>
>>                    <mailto:ivan.calandra at univ-reims.fr
>>                    <mailto:ivan.calandra at univ-reims.fr>>> wrote:
>>
>>                    Dear Mac useRs,
>>
>>                    A colleague of mine have introduced me to
>>                    rmarkdown and knitr to produce nice reports. The
>>                    other interesting thing here is to have so-called
>>                    chunks of code, which I find very practical to
>>                    organize scripts.
>>
>>                    I have found that it works well within RStudio.
>>                    But is there a way to enable chunks within the R
>>                    GUI (and its great editor)?
>>                    What I don't like with RStudio (except that I need
>>                    to install still another software, and place is
>>                    limited on the 256GB SSD of my MacBook Air) is
>>                    that it is not able to work on multiple screens.
>>
>>                    Thank you in advance for your help.
>>                    Ivan
>>
>>                    --                     Ivan Calandra, PhD
>>                    University of Reims Champagne-Ardenne
>>                    GEGENAA - EA 3795
>>                    CREA - 2 esplanade Roland Garros
>>                    51100 Reims, France
>>                    +33(0)3 26 77 36 89
>>                    <tel:%2B33%280%293%2026%2077%2036%2089>
>>                    ivan.calandra at univ-reims.fr
>>                    <mailto:ivan.calandra at univ-reims.fr>
>>                    <mailto:ivan.calandra at univ-reims.fr
>>                    <mailto:ivan.calandra at univ-reims.fr>>
>>                    --
>>                    https://www.researchgate.net/profile/Ivan_Calandra
>>                    https://publons.com/author/705639/
>>
>>                    _______________________________________________
>>                    R-SIG-Mac mailing list
>>                    R-SIG-Mac at r-project.org
>>                    <mailto:R-SIG-Mac at r-project.org>
>>                    https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>>
>>
>>            _______________________________________________
>>            R-SIG-Mac mailing list
>>            R-SIG-Mac at r-project.org <mailto:R-SIG-Mac at r-project.org>
>>            https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>>
>>
>>    _______________________________________________
>>    R-SIG-Mac mailing list
>>    R-SIG-Mac at r-project.org <mailto:R-SIG-Mac at r-project.org>
>>    https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>>
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments transmitted, may contain privileged and confidential information and is intended solely for the exclusive use of the individual or entity to whom it is addressed. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or copying of this e-mail and/or attachments is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender stating that this transmission was misdirected; return the e-mail to sender; destroy all paper copies and delete all electronic copies from your system without disclosing its contents.


More information about the R-SIG-Mac mailing list