similar to: Recommendation for website to format R code

Displaying 20 results from an estimated 20000 matches similar to: "Recommendation for website to format R code"

2013 Jul 18
1
Looking for knitr example for beginner (NO RStudio)
Hi everyone, I am using package knitr, FIRST TIME. I don't have access to RStudio. Read through Yihui's page, didn't find it helpful. Stuck on terms Rnw, GFM (GitHub Flavored Markdown). Never used Sweave, so the reference is not helping. Is there a simple step-by-step example WITHOUT RStudio? My question: What is the procedure? The documentation explains the functions, but does
2014 Sep 18
2
formatR 1.0 caused error
Recently in our R 3.1.0 installation the package formatR was upgraded to version 1.0, doing my usual thing, I got the following error, and the destination html file was not generated. What can I do if I want to stay at the current formatR version? Jun Error: unrecognized fields specified in html_dependency: attachment In addition: Warning messages: 1: 'function (...) {
2012 Nov 29
5
bootstrapped cox regression (rms package)
Hi, I am trying to convert a colleague from using SPSS to R, but am having trouble generating a result that is similar enough to a bootstrapped cox regression analysis that was run in SPSS. I tried unsuccessfully with bootcens, but have had some success with the bootcov function in the rms package, which at least generates confidence intervals similar to what is observed in SPSS. However, the
2013 Jan 28
1
Setting inline hook to a function identical to default in knitr turns of exponential formatting
Hello List, while dealing with a questin of 'xiaodao' ( http://r.789695.n4.nabble.com/Problem-with-large-small-numbers-in-knitr-tp4653986.html) I noticed that copying the default inline hook function obtained by knit_hooks$get("inline") into a knit_hook$set(inline = <...>) call turns off exponential fomatting in the resulting .tex file. I used a stripped version of
2010 Apr 13
1
formatR: farewell to ugly R code
This is an announcement of the release of an R package 'formatR', which can help us format our R code to make it more human-readable. If you have ugly (I mean unformatted) R code like this: ?# rotation of the word "Animation" # in a loop; change the angle and color # step by step for (i in 1:360) { ? # redraw the plot again and again
2010 Apr 13
1
formatR: farewell to ugly R code
This is an announcement of the release of an R package 'formatR', which can help us format our R code to make it more human-readable. If you have ugly (I mean unformatted) R code like this: ?# rotation of the word "Animation" # in a loop; change the angle and color # step by step for (i in 1:360) { ? # redraw the plot again and again
2017 Jun 12
2
Paths in knitr
Hi Yihui, Hi Duncan, I corrected my typo. Unfortunately knitr did not find my plots in the directory where they reside which is different from the Rmd document. The documentation of knitr says: base.dir: (NULL) an absolute directory under which the plots are generate root.dir: (NULL) the root directory when evaluating code chunks; if NULL, the directory of the input document will be used
2017 Jun 12
0
Paths in knitr
Will there be anything wrong if you do not set these options? Regards, Yihui -- https://yihui.name On Mon, Jun 12, 2017 at 2:24 AM, <G.Maubach at weinwolf.de> wrote: > Hi Yihui, > Hi Duncan, > > I corrected my typo. Unfortunately knitr did not find my plots in the > directory where they reside which is different from the Rmd document. > > The documentation of knitr
2012 Jun 07
2
¿Reglas de estilo para código en R?
Hola: Me suena algo de que el año pasado alguien dijo algo sobre unas sugerencias de reglas de estilo para escribir código en R. No he oído nada más en esta lista (a lo mejor se me ha pasado por alto) Ayer se publicó un mensaje sobre esto precisamente en un blog en inglés: http://pairach.com/2012/06/06/r-style-guide/ (copiado debajo para facilitar la lectura y comentarios en esta lista)
2013 Feb 17
1
tidy.source() gets confused when # is not a comment but a part of a literal string?
I needed to clean someone else code and run it through tidy.source. It encountered a number of hangups which after some experimentation lead me to suspect that the culprit is # symbol when it is a part of literal string. For example if i copy the following to the clipboard confuse.tidy <-    function() {   txt <- 'abra # cadabra' } and run with default arguments >tidy.source()
2013 Jan 04
1
Bug in R CMD check for \ in Rd?
Hi, I have a function knit_expand() and its source/Rd are below: https://github.com/yihui/knitr/blob/master/R/template.R#L43-L44 https://github.com/yihui/knitr/blob/master/man/knit_expand.Rd When I run R CMD check on the package I get this warning (with both R 2.15.2 and R-devel): * checking for code/documentation mismatches ... WARNING Codoc mismatches from documentation object
2013 Sep 02
1
Sweave: printing an underscore in the output from an R command
I am working with Sweave and would like to print out into my latex document the result of the R command version$platform So what I first tried in my .Rnw document was \Sexpr{print(version$platform)}. However, the output from this command is the string "x86_64-apple-darwin10.8.0" (without the quotes). This contains an underscore, which is a special character in tex and so I get an error
2016 May 03
2
vignette/knitr help
I need some help understanding a problem running the tests on the 'digest' package. Initially, I got the message that the 'knitr' package was needed to run vignettes: Running vignettes for package ?digest? Error in loadVignetteBuilder(vigns$pkgdir) : vignette builder 'knitr' not found So I installed the knitr package and all its dependents (?mime?, ?stringi?,
2012 May 09
1
Sweave, beamer and alert within code chunks
Hi all, Using Beamer, in order to highlight a piece of R code I do something like this - note the "\structure" and "\alert" commands: \begin{semiverbatim} > mleOut <- \structure{dlmMLE}(Nile, + parm = c(0.2, 120), # initial values for optimizer + lower = c(1e-7, 0)) \alert<2>{# V must be positive} > mleOut$convergence
2012 Dec 26
2
Problem with large/small numbers in knitr
I have problems with very large numbers using knitr. In the following, my a and b are extremely small and ssrr and ssru are extremely large. Knitr delivers error messages. Scaling ssrr and ssru by 1000 resolved the problem: ssrr <-ssrr/1000 ; ssru<-ssru/1000 Any clue as to how I might resolve the problem? BTW, the same program does run in another computer. I am wondering whether my
2012 Nov 08
2
Controlling R fonts through LaTeX
Dear help list Does anybody know if it is possible to somehow tell R to let LaTeX handle the fonts for postscript plots produced by R? It is for a thesis and I have MANY figures. These are created by R scripts dynamically as the document is compiled, using the Make system. I see that I can `manually' specify the font family each time I call the postscript device, but I am looking for a
2017 Jun 08
3
Paths in knitr
Hi All, I have to compile a report for the management and decided to use RMarkdown and knitr. I compiled all needed plots (using separate R scripts) before compiling the report, thus all plots reside in my graphics directory. The RMarkdown report needs to access these files. I have defined ```{r setup, include = FALSE} knitr::opts_knit$set( echo = FALSE, xtable.type = "html",
2013 Oct 03
1
Error in "Writing R Extensions"
In Section 1.4.2 of "Writing R Extensions" %\VignetteEngine{knitr::knitr} should be %\VignetteEngine{knitr::knit} > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-apple-darwin10.8.0 (64-bit) Is this sort of thing best reported here, or is a huge report in order? John Maindonald email: john.maindonald at anu.edu.au phone : +61 2 (6125)3473 fax
2014 Dec 19
1
UTF8 markdown vignette
On 18/12/2014, 12:17 AM, Yihui Xie wrote: > For the record, I saw a change had been made in R-devel: > https://github.com/wch/r-source/commit/d53b098 (Thanks, Duncan) > Meanwhile, I also made a change in knitr to assume UTF-8 unless R > passes an encoding to the vignette engine: > https://github.com/yihui/knitr/commit/23c6c8e2 Both will solve the > original problem, but
2013 Jan 10
1
help with knit_hooks
Dear R-listers, does anybody can suggest some manual where I can learn more about how the hooks in knitr work? I am trying to enclose the output of an R command in the Latex verbatim environment. I defined a hook as follows: knit_hooks$set(fsverb = function(x, options) { paste("\\begin(verbatim)\n", x, "\\end(verbatim)\n", sep = "") } then I set a chunk as