search for: formatr

Displaying 20 results from an estimated 25 matches for "formatr".

Did you mean: format
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:...
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 plot(1,an...
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 plot(1,an...
2010 Apr 19
1
Follow up on installing formatR...
...irst attempt ended up with two of the four dependencies installed so only the Rgtk related items would be needed this time. Went into synaptic and found r-cran-rgtk2. Okay. Sounded likely so I installed it successfully. Using a root terminal session I went back into R and ran install.packages("formatR"). Pulled in two dependencies plus the main choice. Rejected one and kept two when it came time to install but still installed successfully, or so it seemed when I ran library(formatR). Go figure. A copy of the message run follows. Any comments or suggestions will be of interest. > install...
2010 Dec 03
0
formatR update (0.1-5)
In formatR 0.1-5, the dependency on the gWidgets and animation packages are removed. The GUI by gWidgets is optional now. Meanwhile, the function tidy.source() has been moved from the animation package to this package. > library(formatR) > tidy.source(textConnection(' # rotation of the word &quo...
2010 Dec 03
0
formatR update (0.1-5)
In formatR 0.1-5, the dependency on the gWidgets and animation packages are removed. The GUI by gWidgets is optional now. Meanwhile, the function tidy.source() has been moved from the animation package to this package. > library(formatR) > tidy.source(textConnection(' # rotation of the word &quo...
1999 Oct 13
1
formatReal()-bug (or Is there anybody out there w/o IEEE754?)
On a system with IEEE_754 undefined, I run into an bug, when the value of an element of the first argument (e.g., x[0]) of formatReal() is NA: 1. (format.c:235) if (!R_FINITE ..) gives nanflag=1 (!naflag remains 0) 2. (format.c:272..288) *m gets an value of -2147483643 (from the format fiddling, should not matter to us) 3. (format.c:289) because naflag is zero, m does not get the value of...
2012 Jun 07
2
¿Reglas de estilo para código en R?
...dea to agree on a common style up-front." 4. R Core''s coding standard * Official R coding standard <http://cran.r-project.org/doc/manuals/R-ints.html#R-coding-standards> in R Internals Manual <http://cran.r-project.org/doc/manuals/R-ints.html> 5. formatR package * Links to the package''s CRAN<http://cran.r-project.org/package=formatR>, GitHub <https://github.com/yihui/formatR/wiki> site * One can also use Yihui''sformatRpackage to tidy R codes with function tidy.source(). * Package description is as fo...
2003 Jan 29
1
printing reals from C with digits
Hi, I want to print real numbers in C code with different values for digits. How to do that? As I have understood, what I should do is to call StringFromReal() which calls FormatReal(), that one suggests the parameters (width, decimal places and exponential form). FormatReal() includes eps = pow(10.0, -(double)R_print.digits); So I guess I have to change the value of R_print.digits. R_print.digits is defined in include/Print.h in the package source, but unfortunately...
2013 Jan 24
1
Recommendation for website to format R code
Hi list, Could anyone recommend some good website for formatting R code? For example, when you copy paste R code to gmail and back to R, it loses its format, the dash symbol causes errors. I've had someone used it to format my code here on the list, but can't find it anymore. Mike [[alternative HTML version deleted]]
2013 Aug 15
1
format bug and patch
..., while testing this bug I found another related issue: > format(complex(real=10, imaginary=4), digits = 1); [1] "10+0i" I think this should've been "10+4i". I have entered this as a bug #15427. But a patch for formatComplex() would be a bigger change, than the patch for formatReal() I made. So, before I start, I would like to gauge your opinion. Do you agree it is a bug?
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()
2016 May 03
2
vignette/knitr help
...ge 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?, ?magrittr?, ?evaluate?, ?formatR?, ?highr?, ?markdown?, ?stringr?, ?yaml?) . Now I get some different warnings: Running vignettes for package ?digest? Running ?sha1.Rmd? Warning messages: 1: In readLines(if (is.character(input2)) { : cannot open file 'sha1.Rmd': No such file or directory 2: In engine$weave(file, qu...
2003 Feb 02
1
printing reals from C with digits -- once more
...ow to do that? | | Use Rprintf or PrintValue. You'll need to work hard to convince me that | Rprintf is not adequate. | | > As I have understood, what I should do is to call | > | > StringFromReal() | | That's a coercion, not a printing routine. | | > which calls FormatReal(), that one suggests the parameters (width, | > decimal places and exponential form). FormatReal() includes | > | > eps = pow(10.0, -(double)R_print.digits); | > | > So I guess I have to change the value of R_print.digits. | > R_print.digits is defined in include/Pri...
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
...+ replace = (char *) p; + } + } + while (*(replace++) = *(p++)) { + ; + } + break; + } + } + return s; +} + SEXP attribute_hidden StringFromReal(double x, int *warn) { int w, d, e; formatReal(&x, 1, &w, &d, &e, 0); if (ISNA(x)) return NA_STRING; - else return mkChar(EncodeReal(x, w, d, e, OutDec)); + else return mkChar(elim_trailing(EncodeReal(x, w, d, e, OutDec), OutDec)); } SEXP attribute_hidden StringFromComplex(Rcomplex x, int *warn)
2016 May 03
0
vignette/knitr help
...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?, > ?magrittr?, ?evaluate?, ?formatR?, ?highr?, ?markdown?, ?stringr?, ?yaml?) . > Now I get some different warnings: > > Running vignettes for package ?digest? > Running ?sha1.Rmd? > Warning messages: > 1: In readLines(if (is.character(input2)) { : > cannot open file 'sha1.Rmd': No such file or direct...
2011 Jan 10
0
Package animation update 2.0-1
...nd ani.replay() to record and replay ?the animations; they can be used to capture the changes in the ?graphics made by low-level plotting commands (see ?ani.record for ?examples) SIGNIFICANT CHANGES ? ?o the function tidy.source() was completely removed from this ?package; users should go to the formatR package (tidy.source() is ?there now) MINOR CHANGES ? ?o the argument 'expr' in saveHTML(), saveLatex(), saveMovie() and ?saveSWF() will be evaluated by eval(), so we may pass a real R ?expression (see ?expression) to 'expr', e.g. saveHTML(expression(for ?(i in 1:10) plot(runif(3...
2011 Jan 10
0
Package animation update 2.0-1
...nd ani.replay() to record and replay ?the animations; they can be used to capture the changes in the ?graphics made by low-level plotting commands (see ?ani.record for ?examples) SIGNIFICANT CHANGES ? ?o the function tidy.source() was completely removed from this ?package; users should go to the formatR package (tidy.source() is ?there now) MINOR CHANGES ? ?o the argument 'expr' in saveHTML(), saveLatex(), saveMovie() and ?saveSWF() will be evaluated by eval(), so we may pass a real R ?expression (see ?expression) to 'expr', e.g. saveHTML(expression(for ?(i in 1:10) plot(runif(3...
2011 Nov 23
1
R-latex syntax highlighting?
Hello, Can anyone provide or point me to a good setup for the listings latex package that would produce nice R-syntax highlighting? I am using an example I found in internet for setting up listings like this: \lstset{ language=R, basicstyle=\scriptsize\ttfamily, commentstyle=\ttfamily\color{gray}, numbers=left, numberstyle=\ttfamily\color{red}\footnotesize, stepnumber=1, numbersep=5pt,
2012 Jul 20
4
Paquetización
Buenos días: Por favor, ¿alguien puede indicarme si sólo hay que documentar las funciones visibles del paquete?. Además, ¿cómo se consigue que sólo algunas de las funciones estén visibles?. ¿Cómo manejo el namespaces para ello?. Gracias. Eva [[alternative HTML version deleted]]