[R-SIG-Mac] R code chunks

Ivan Calandra ivan.calandra at univ-reims.fr
Tue Apr 12 16:18:04 CEST 2016


Sorry, I thought it would be clear based on the previous emails...

I don't know much yet about chunks and other functionalities of knitr 
and rmarkdown, so I might be missing some points, but three interesting 
aspects about chunks that I have already notices is that it is possible 
to give them names, expand them or reduce them in the script (making the 
code more readable) and evaluating them but not displaying the results 
in the html/pdf report. This is possible in RStudio, but it seems that 
it is not in the R GUI Editor.

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 16:04, Mollie Brooks a écrit :
> Hi Ivan,
>
> Can you be more explicit about what it means to you to "enable chunks" 
> or "properly use chunks"? Then developers will understand what you’re 
> looking for.
>
> 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 15:53, 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
>> 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 --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>> 
>>>> 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
>>>> 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>> 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
>>>>>> 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
>>>>>> 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
>>>
>>
>> _______________________________________________
>> 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
>



More information about the R-SIG-Mac mailing list